Fix SELinux facts (#337)

This commit is contained in:
Alessandro Fael Garcia 2020-10-08 12:48:56 +02:00 committed by GitHub
parent d2bbd05aa4
commit 2715baca1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -10,6 +10,7 @@ ENHANCEMENTS:
BUG FIXES: BUG FIXES:
* Prevent TravisCI from trying to build (and failing) NGINX Plus images on external PRs. * Prevent TravisCI from trying to build (and failing) NGINX Plus images on external PRs.
* Fix naming for SELinux facts dict.
## 0.17.2 (September 24, 2020) ## 0.17.2 (September 24, 2020)

View File

@ -11,8 +11,9 @@
- name: Configure SELinux - name: Configure SELinux
include_tasks: "{{ role_path }}/tasks/prerequisites/setup-selinux.yml" include_tasks: "{{ role_path }}/tasks/prerequisites/setup-selinux.yml"
when: ansible_facts['selinux.mode'] is defined when: ansible_facts['selinux']['mode'] is defined
when: when:
- nginx_selinux | bool - nginx_selinux | bool
- "'selinux' in ansible_facts"
- ansible_facts['os_family'] in ['RedHat', 'Suse'] - ansible_facts['os_family'] in ['RedHat', 'Suse']
- ansible_facts['distribution'] not in ['Amazon', 'OracleLinux'] - ansible_facts['distribution'] not in ['Amazon', 'OracleLinux']

View File

@ -22,7 +22,7 @@
state: permissive state: permissive
policy: targeted policy: targeted
changed_when: false changed_when: false
when: ansible_facts['selinux.mode'] == "enforcing" when: ansible_facts['selinux']['mode'] == "enforcing"
- name: Allow SELinux HTTP network connections - name: Allow SELinux HTTP network connections
seboolean: seboolean:
@ -99,4 +99,4 @@
changed_when: false changed_when: false
when: when:
- nginx_selinux_enforcing | bool - nginx_selinux_enforcing | bool
- ansible_facts['selinux.mode'] == "permissive" - ansible_facts['selinux']['mode'] == "permissive"