Commit 30219b3b authored by viscapi's avatar viscapi
Browse files

Simplified systemd.yml

parent 8fc73879
--- ---
- name: Activate postgresql-9.6 service for CentOS 7
systemd:
enabled: yes
name: postgresql-9.6
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
- name: Activate postgresql service for CentOS 8
systemd:
enabled: yes
name: postgresql
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8")
- name: Set PGDATA environment variable on CentOS 7 - name: Set PGDATA environment variable on CentOS 7
lineinfile: lineinfile:
path: /usr/lib/systemd/system/postgresql-9.6.service path: /usr/lib/systemd/system/postgresql-9.6.service
...@@ -26,20 +14,20 @@ ...@@ -26,20 +14,20 @@
line: 'Environment=PGDATA={{path_to_icat}}' line: 'Environment=PGDATA={{path_to_icat}}'
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8") when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8")
- name: Reload systemd daemon
systemd:
daemon_reload: yes
- name: Start postgresql-9.6 service on CentOS 7 - name: Start postgresql-9.6 service on CentOS 7
systemd: systemd:
name: postgresql-9.6 name: postgresql-9.6
state: started state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7") when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "7")
- name: Start postgresql service on CentOS 8 - name: Start postgresql service on CentOS 8
systemd: systemd:
name: postgresql name: postgresql
state: started state: started
daemon_reload: yes
enabled: yes
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8") when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "8")
... ...
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