Use the correct task to set the selinux context.
This commit is contained in:
parent
dcfbe46af5
commit
ac61ee1777
|
@ -87,8 +87,14 @@
|
||||||
creates: '{{ psql_el_data_dir }}/base'
|
creates: '{{ psql_el_data_dir }}/base'
|
||||||
when: postgresql_data_dir.stat.isdir is not defined
|
when: postgresql_data_dir.stat.isdir is not defined
|
||||||
|
|
||||||
- name: Fix the SELinux rules
|
- name: Fix the SELinux context for the new data directory
|
||||||
shell: semanage fcontext -a -a -t postgresql_db_t "{{ psql_el_base_dir }}(/.*)?" && restorecon -vR {{ psql_el_base_dir }}
|
sefcontext:
|
||||||
|
target: '{{ psql_el_base_dir }}(/.*)?'
|
||||||
|
setype: postgresql_db_t
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Restore the SELinux context
|
||||||
|
command: restorecon -vR {{ psql_el_base_dir }}
|
||||||
|
|
||||||
- name: Start the postgresql service that will use the new data directory
|
- name: Start the postgresql service that will use the new data directory
|
||||||
service: name='postgresql-{{ psql_version }}' state=started
|
service: name='postgresql-{{ psql_version }}' state=started
|
||||||
|
@ -105,8 +111,14 @@
|
||||||
- name: Create the postgresql log directory
|
- name: Create the postgresql log directory
|
||||||
file: dest={{ psql_log_dir }} state=directory owner=postgres group=postgres mode='0750'
|
file: dest={{ psql_log_dir }} state=directory owner=postgres group=postgres mode='0750'
|
||||||
|
|
||||||
- name: Fix the SELinux rules for the postgresql log directory
|
- name: Fix the SELinux context for the postgresql log directory
|
||||||
shell: semanage fcontext -a -a -t postgresql_db_t "{{ psql_log_dir }}(/.*)?" && restorecon -vR {{ psql_log_dir }}
|
sefcontext:
|
||||||
|
target: '{{ psql_log_dir }}(/.*)?'
|
||||||
|
setype: postgresql_db_t
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Fix the SELinux context for the postgresql log directory
|
||||||
|
command: restorecon -vR {{ psql_log_dir }}
|
||||||
|
|
||||||
- name: Set some postgresql configuration parameters that require a db restart
|
- name: Set some postgresql configuration parameters that require a db restart
|
||||||
become: True
|
become: True
|
||||||
|
|
Loading…
Reference in New Issue