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

30 lines
994 B
YAML

---
- name: Ensure that the postgresql server is started
service: name=postgresql state=started enabled=yes
when:
- postgresql_enabled
- ansible_distribution_file_variety == "Debian"
tags: [ 'postgresql', 'postgres' ]
- name: Ensure that the postgresql server is stopped and disabled
service: name=postgresql state=stopped enabled=no
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"
tags: [ 'postgresql', 'postgres' ]