[PATCH] Refactor xinetd in a separate role

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

 



From: Michael Scherer <misc@xxxxxxxx>

---
 handlers/restart_services.yml   |  3 ---
 roles/git/server/meta/main.yml  |  4 ++++
 roles/git/server/tasks/main.yml |  5 -----
 roles/rsyncd/meta/main.yml      |  3 +++
 roles/rsyncd/tasks/main.yml     |  7 -------
 roles/xinetd/handlers/main.yml  |  2 ++
 roles/xinetd/tasks/main.yml     | 10 ++++++++++
 7 files changed, 19 insertions(+), 15 deletions(-)
 create mode 100644 roles/git/server/meta/main.yml
 create mode 100644 roles/rsyncd/meta/main.yml
 create mode 100644 roles/xinetd/handlers/main.yml
 create mode 100644 roles/xinetd/tasks/main.yml

diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml
index 58396a0..d4ba5fe 100644
--- a/handlers/restart_services.yml
+++ b/handlers/restart_services.yml
@@ -90,9 +90,6 @@
 - name: restart postfix
   action: service name=postfix state=restarted
 
-- name: restart xinetd
-  action: service name=xinetd state=restarted
-
 - name: restart netapproute
   action: command /etc/sysconfig/network-scripts/ifup-routes eth1
 
diff --git a/roles/git/server/meta/main.yml b/roles/git/server/meta/main.yml
new file mode 100644
index 0000000..6bbd92f
--- /dev/null
+++ b/roles/git/server/meta/main.yml
@@ -0,0 +1,4 @@
+---
+dependencies:
+- role: xinetd
+  when: "ansible_distribution_major_version|int == 6"
diff --git a/roles/git/server/tasks/main.yml b/roles/git/server/tasks/main.yml
index ef9fe4f..81bc437 100644
--- a/roles/git/server/tasks/main.yml
+++ b/roles/git/server/tasks/main.yml
@@ -20,11 +20,6 @@
   tags: git/server
 
 # If using xinetd
-- name: install xinetd
-  yum: pkg=xinetd state=present
-  when: ansible_distribution_major_version|int == 6
-  tags: git/server
-
 - name: install the xinetd config file
   template: >
     src="git.j2"
diff --git a/roles/rsyncd/meta/main.yml b/roles/rsyncd/meta/main.yml
new file mode 100644
index 0000000..380b0d1
--- /dev/null
+++ b/roles/rsyncd/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+- role: xinetd
diff --git a/roles/rsyncd/tasks/main.yml b/roles/rsyncd/tasks/main.yml
index 7d1a83b..0898da8 100644
--- a/roles/rsyncd/tasks/main.yml
+++ b/roles/rsyncd/tasks/main.yml
@@ -7,7 +7,6 @@
   yum: state=present name={{item}}
   with_items:
   - rsync
-  - xinetd
   - libsemanage-python
   tags:
   - packages
@@ -17,7 +16,6 @@
   dnf: state=present name={{item}}
   with_items:
   - rsync
-  - xinetd
   - libsemanage-python
   tags:
   - packages
@@ -49,11 +47,6 @@
   tags:
   - config
 
-- name: make sure xinetd is started
-  service: name=xinetd state=started
-  tags:
-  - services
-
 - name: set sebooleans so rsync can read dirs
   seboolean: name=rsync_export_all_ro
                     state=true
diff --git a/roles/xinetd/handlers/main.yml b/roles/xinetd/handlers/main.yml
new file mode 100644
index 0000000..e910312
--- /dev/null
+++ b/roles/xinetd/handlers/main.yml
@@ -0,0 +1,2 @@
+- name: restart xinetd
+  action: service name=xinetd state=restarted
diff --git a/roles/xinetd/tasks/main.yml b/roles/xinetd/tasks/main.yml
new file mode 100644
index 0000000..8149be4
--- /dev/null
+++ b/roles/xinetd/tasks/main.yml
@@ -0,0 +1,10 @@
+---
+- name: install xinetd
+  package: state=present name=xinetd
+  tags:
+  - packages
+
+- name: make sure xinetd is started
+  service: name=xinetd state=started
+  tags:
+  - services
-- 
1.8.3.1
_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx




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

  Powered by Linux