2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: install the postgresql packages
|
2016-03-01 18:43:30 +01:00
|
|
|
apt: pkg={{ item }} state={{ psql_pkg_state }}
|
2016-03-01 18:01:41 +01:00
|
|
|
with_items: '{{ postgresql_pkgs }}'
|
|
|
|
notify: Restart postgresql
|
|
|
|
tags: [ 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Install the packages that ansible needs to manage the postgresql users and databases
|
2016-03-01 18:43:30 +01:00
|
|
|
apt: pkg={{ item }} state={{ psql_pkg_state }}
|
2016-03-07 17:43:37 +01:00
|
|
|
with_items: '{{ psql_ansible_needed_pkgs }}'
|
2016-03-01 18:01:41 +01:00
|
|
|
tags: [ 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|
|
|
|
- name: Ensure that the postgresql server is started
|
|
|
|
service: name=postgresql state=started enabled=yes
|
2016-03-01 18:01:41 +01:00
|
|
|
when: postgresql_enabled
|
|
|
|
tags: [ 'postgresql', 'postgres' ]
|
|
|
|
|
|
|
|
- name: Ensure that the postgresql server is stopped and disabled
|
|
|
|
service: name=postgresql state=stopped enabled=no
|
|
|
|
when: not postgresql_enabled
|
|
|
|
tags: [ 'postgresql', 'postgres' ]
|
2015-05-28 11:32:57 +02:00
|
|
|
|