[PATCH 1/2] split memcached into a separate roles from mailman

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Scherer <misc@xxxxxxxx>

---
 roles/mailman/files/memcached.sysconfig   |  5 -----
 roles/mailman/handlers/main.yml           |  3 +--
 roles/mailman/meta/main.yml               |  4 ++++
 roles/mailman/tasks/main.yml              | 10 ----------
 roles/memcached/files/memcached.sysconfig |  5 +++++
 roles/memcached/handlers/main.yml         |  3 +++
 roles/memcached/tasks/main.yml            | 15 +++++++++++++++
 7 files changed, 28 insertions(+), 17 deletions(-)
 delete mode 100644 roles/mailman/files/memcached.sysconfig
 create mode 100644 roles/mailman/meta/main.yml
 create mode 100644 roles/memcached/files/memcached.sysconfig
 create mode 100644 roles/memcached/handlers/main.yml
 create mode 100644 roles/memcached/tasks/main.yml

diff --git a/roles/mailman/files/memcached.sysconfig b/roles/mailman/files/memcached.sysconfig
deleted file mode 100644
index 6a53e3e..0000000
--- a/roles/mailman/files/memcached.sysconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-PORT="11211"
-USER="memcached"
-MAXCONN="1024"
-CACHESIZE="256"
-OPTIONS=""
diff --git a/roles/mailman/handlers/main.yml b/roles/mailman/handlers/main.yml
index ee96b7a..0761d2f 100644
--- a/roles/mailman/handlers/main.yml
+++ b/roles/mailman/handlers/main.yml
@@ -8,5 +8,4 @@
 - name: reload apache
   action: service name=httpd state=reloaded
 
-- name: restart memcached
-  action: service name=memcached state=restarted
+
diff --git a/roles/mailman/meta/main.yml b/roles/mailman/meta/main.yml
new file mode 100644
index 0000000..ccebbea
--- /dev/null
+++ b/roles/mailman/meta/main.yml
@@ -0,0 +1,4 @@
+---
+dependencies:
+- { role: memcached }
+
diff --git a/roles/mailman/tasks/main.yml b/roles/mailman/tasks/main.yml
index 686f3db..a4b338e 100644
--- a/roles/mailman/tasks/main.yml
+++ b/roles/mailman/tasks/main.yml
@@ -45,7 +45,6 @@
   - hyperkitty
   - hyperkitty-selinux
   - postorius
-  - memcached
   - python-pylibmc
   - yum-plugin-post-transaction-actions
   - mailman3-fedmsg-plugin
@@ -235,12 +234,3 @@
 - name: create the postfix aliases
   command: su mailman -s /bin/sh -c "mailman3 aliases"
            creates=/var/lib/mailman3/data/postfix_lmtp.db
-
-# Memcached
-- name: set the memcached sysconfig file
-  copy: src=memcached.sysconfig dest=/etc/sysconfig/memcached
-  notify:
-  - restart memcached
-
-- name: start memcached
-  service: state=started enabled=yes name=memcached
diff --git a/roles/memcached/files/memcached.sysconfig b/roles/memcached/files/memcached.sysconfig
new file mode 100644
index 0000000..6a53e3e
--- /dev/null
+++ b/roles/memcached/files/memcached.sysconfig
@@ -0,0 +1,5 @@
+PORT="11211"
+USER="memcached"
+MAXCONN="1024"
+CACHESIZE="256"
+OPTIONS=""
diff --git a/roles/memcached/handlers/main.yml b/roles/memcached/handlers/main.yml
new file mode 100644
index 0000000..5af2e59
--- /dev/null
+++ b/roles/memcached/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart memcached
+  action: service name=memcached state=restarted
diff --git a/roles/memcached/tasks/main.yml b/roles/memcached/tasks/main.yml
new file mode 100644
index 0000000..cd591bc
--- /dev/null
+++ b/roles/memcached/tasks/main.yml
@@ -0,0 +1,15 @@
+---
+- name: install needed packages
+  yum: pkg={{ item }} state=installed
+  with_items:
+  - memcached
+  tags:
+  - packages
+
+- name: set the memcached sysconfig file
+  copy: src=memcached.sysconfig dest=/etc/sysconfig/memcached
+  notify:
+  - restart memcached
+
+- name: start memcached
+  service: state=started enabled=yes name=memcached
-- 
1.9.0

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure





[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux