Commit 7cddbc7f authored by Louis VINCHON's avatar Louis VINCHON
Browse files

Role postgresql, task systemd: factorize tasks.

This is an improvement to the systemd.yml file which had a lot
of tasks doing the same thing, with slighty different names for the
unit files.

I factorized the 'start postgresql.service' tasks so that we only need
one task with a dynamic unit file name.

Remarks: This means that we no longer have system-specific tasks.
It doesn't matter in the current state as there was nothing system-specific
in our tasks.
parent a5d16129
......@@ -26,36 +26,11 @@
- path_to_icat != None
- path_to_icat | length > 0
- name: Start postgresql service on CentOS 7
- name: "Start {{ postgres_unit_file_name }}"
systemd:
name: postgresql
name: "{{ postgres_unit_file_name }}"
state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and use_distribution_postgresql)
- name: Start postgresql-{{ external_postgresql_version }} service on CentOS 7
systemd:
name: postgresql-{{ external_postgresql_version }}
state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7" and not use_distribution_postgresql)
- name: Start postgresql service on CentOS 8
systemd:
name: postgresql
state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and use_distribution_postgresql)
- name: Start postgresql-{{ external_postgresql_version }} service on CentOS 8
systemd:
name: postgresql-{{ external_postgresql_version }}
state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8" and not use_distribution_postgresql)
...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment