|
1 | 1 | ---
|
2 | 2 | - name: (CentOS/RHEL) Install dependencies
|
3 |
| - block: |
4 |
| - - name: (CentOS/RHEL 6/7) Install dependencies |
5 |
| - ansible.builtin.yum: |
6 |
| - name: |
7 |
| - - policycoreutils-python |
8 |
| - - setools |
9 |
| - when: ansible_facts['distribution_major_version'] is version('8', '!=') |
10 |
| - |
11 |
| - - name: (CentOS/RHEL 8) Install dependencies |
12 |
| - ansible.builtin.yum: |
13 |
| - name: |
14 |
| - - libselinux-utils |
15 |
| - - policycoreutils |
16 |
| - - selinux-policy-targeted |
17 |
| - when: ansible_facts['distribution_major_version'] is version('8', '==') |
| 3 | + ansible.builtin.yum: |
| 4 | + name: |
| 5 | + - libselinux-utils |
| 6 | + - policycoreutils |
| 7 | + - selinux-policy-targeted |
18 | 8 | when: ansible_facts['os_family'] == "RedHat"
|
19 | 9 |
|
20 | 10 | - name: Set SELinux mode to permissive
|
|
25 | 15 |
|
26 | 16 | - name: Allow SELinux HTTP network connections
|
27 | 17 | ansible.posix.seboolean:
|
28 |
| - name: httpd_can_network_connect |
29 |
| - state: true |
30 |
| - persistent: true |
31 |
| - |
32 |
| -- name: Allow SELinux HTTP network connections |
33 |
| - ansible.posix.seboolean: |
34 |
| - name: httpd_can_network_relay |
| 18 | + name: "{{ item }}" |
35 | 19 | state: true
|
36 | 20 | persistent: true
|
| 21 | + loop: |
| 22 | + - httpd_can_network_connect |
| 23 | + - httpd_can_network_relay |
37 | 24 |
|
38 | 25 | - name: Allow SELinux TCP connections on status ports
|
39 |
| - community.general.selinux: |
| 26 | + community.general.seport: |
40 | 27 | ports: "{{ nginx_config_status_port }}"
|
41 | 28 | proto: tcp
|
42 | 29 | setype: http_port_t
|
43 | 30 | state: present
|
44 | 31 | when: nginx_config_status_port is defined
|
45 | 32 |
|
46 | 33 | - name: Allow SELinux TCP connections on Rest API ports
|
47 |
| - community.general.selinux: |
| 34 | + community.general.seport: |
48 | 35 | ports: "{{ nginx_config_rest_api_port }}"
|
49 | 36 | proto: tcp
|
50 | 37 | setype: http_port_t
|
51 | 38 | state: present
|
52 | 39 | when: nginx_config_rest_api_port is defined
|
53 | 40 |
|
54 | 41 | - name: Allow SELinux TCP connections on specific ports
|
55 |
| - community.general.selinux: |
| 42 | + community.general.seport: |
56 | 43 | ports: "{{ nginx_config_selinux_tcp_ports }}"
|
57 | 44 | proto: tcp
|
58 | 45 | setype: http_port_t
|
59 | 46 | state: present
|
60 | 47 | when: nginx_config_selinux_tcp_ports is defined
|
61 | 48 |
|
62 | 49 | - name: Allow SELinux UDP connections on specific ports
|
63 |
| - community.general.selinux: |
| 50 | + community.general.seport: |
64 | 51 | ports: "{{ nginx_config_selinux_udp_ports }}"
|
65 | 52 | proto: udp
|
66 | 53 | setype: http_port_t
|
|
0 commit comments