ansible-role-postgresql/tasks/postgresql-service-status.yml

30 lines
994 B
YAML
Raw Normal View History

2020-06-03 19:53:13 +02:00
---
- name: Ensure that the postgresql server is started
service: name=postgresql state=started enabled=yes
2020-07-30 14:14:39 +02:00
when:
- postgresql_enabled
- ansible_distribution_file_variety == "Debian"
2020-06-03 19:53:13 +02:00
tags: [ 'postgresql', 'postgres' ]
- name: Ensure that the postgresql server is stopped and disabled
service: name=postgresql state=stopped enabled=no
2020-07-30 14:14:39 +02:00
when:
- not postgresql_enabled
- ansible_distribution_file_variety == "Debian"
tags: [ 'postgresql', 'postgres' ]
- name: Ensure that the postgresql server is started
service: name='postgresql-{{ psql_version }}' state=started enabled=yes
when:
- postgresql_enabled
- ansible_distribution_file_variety == "RedHat"
tags: [ 'postgresql', 'postgres' ]
- name: Ensure that the postgresql server is stopped and disabled
service: name='postgresql-{{ psql_version }}' state=stopped enabled=no
when:
- not postgresql_enabled
- ansible_distribution_file_variety == "RedHat"
2020-06-03 19:53:13 +02:00
tags: [ 'postgresql', 'postgres' ]