[PATCH 5/8] move postgresql_server to roles

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

 



---
 handlers/restart_services.yml             |  3 ---
 playbooks/groups/postgresl-server.yml     |  2 +-
 roles/postgresql_server/handlers/main.yml |  3 +++
 roles/postgresql_server/tasks/main.yml    | 27 +++++++++++++++++++++++++++
 tasks/postgresql_server.yml               | 27 ---------------------------
 5 files changed, 31 insertions(+), 31 deletions(-)
 create mode 100644 roles/postgresql_server/handlers/main.yml
 create mode 100644 roles/postgresql_server/tasks/main.yml
 delete mode 100644 tasks/postgresql_server.yml

diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml
index 8b90f0f..993d799 100644
--- a/handlers/restart_services.yml
+++ b/handlers/restart_services.yml
@@ -65,9 +65,6 @@
 - name: restart postfix
   action: service name=postfix state=restarted
 
-- name: restart postgresql
-  service: name=postgresql state=restarted
-
 - name: restart rpcbind
   action: service name=rpcbind state=restarted
 
diff --git a/playbooks/groups/postgresl-server.yml b/playbooks/groups/postgresl-server.yml
index 8e8822b..d709057 100644
--- a/playbooks/groups/postgresl-server.yml
+++ b/playbooks/groups/postgresl-server.yml
@@ -34,6 +34,7 @@
   - rkhunter
   - denyhosts
   - nagios_client
+  - postgresql_server
 
   tasks:
   - include: $tasks/hosts.yml
@@ -44,7 +45,6 @@
   - include: $tasks/motd.yml
   - include: $tasks/sudo.yml
   - include: $tasks/collectd/client.yml
-  - include: $tasks/postgresql_server.yml
 
 # TODO: add iscsi task
 
diff --git a/roles/postgresql_server/handlers/main.yml b/roles/postgresql_server/handlers/main.yml
new file mode 100644
index 0000000..c51e7d1
--- /dev/null
+++ b/roles/postgresql_server/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart postgresql
+  service: name=postgresql state=restarted
diff --git a/roles/postgresql_server/tasks/main.yml b/roles/postgresql_server/tasks/main.yml
new file mode 100644
index 0000000..ca74bc6
--- /dev/null
+++ b/roles/postgresql_server/tasks/main.yml
@@ -0,0 +1,27 @@
+---
+#
+# Setup postgresql server. 
+#
+- name: install postgresql server packages
+  yum: name=$item state=installed
+  with_items:
+  - postgresql-server
+  - postgresql-contrib
+  - postgresql-plpython
+  tags:
+  - packages
+
+- name: initialize postgresql
+  command: service postgresql initdb
+           creates=/var/lib/pgsql/data/postgresql.conf
+  ignore_errors: true
+  tags:
+  - service
+
+- name: Set postgresql-server to run on boot
+  service: name=postgresql enabled=yes
+  ignore_errors: true
+  notify:
+  - restart postgresql
+  tags:
+  - service
diff --git a/tasks/postgresql_server.yml b/tasks/postgresql_server.yml
deleted file mode 100644
index ca74bc6..0000000
--- a/tasks/postgresql_server.yml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-#
-# Setup postgresql server. 
-#
-- name: install postgresql server packages
-  yum: name=$item state=installed
-  with_items:
-  - postgresql-server
-  - postgresql-contrib
-  - postgresql-plpython
-  tags:
-  - packages
-
-- name: initialize postgresql
-  command: service postgresql initdb
-           creates=/var/lib/pgsql/data/postgresql.conf
-  ignore_errors: true
-  tags:
-  - service
-
-- name: Set postgresql-server to run on boot
-  service: name=postgresql enabled=yes
-  ignore_errors: true
-  notify:
-  - restart postgresql
-  tags:
-  - service
-- 
1.8.3.1

_______________________________________________
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