mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-10 03:25:22 +01:00
Compare commits
17 commits
7fef3da78e
...
8eac2acd4f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eac2acd4f | ||
|
|
3351416302 | ||
|
|
f41f08e9e3 | ||
|
|
41fc0901d9 | ||
|
|
738a839ce5 | ||
|
|
c07ebc2f9c | ||
|
|
7bf56953cb | ||
|
|
7b9eb8d56e | ||
|
|
c29e8c213b | ||
|
|
39a9e79985 | ||
|
|
d80fde7ea0 | ||
|
|
271119d196 | ||
|
|
af6b90981a | ||
|
|
0ea18d208f | ||
|
|
d2f1cc063a | ||
|
|
55fb80cf5e | ||
|
|
3bff8d22a5 |
3 changed files with 15 additions and 60 deletions
|
|
@ -98,19 +98,6 @@ stages:
|
||||||
test: sanity
|
test: sanity
|
||||||
- name: Units
|
- name: Units
|
||||||
test: units
|
test: units
|
||||||
- stage: Sanity_2_14
|
|
||||||
displayName: Ansible 2.14 sanity
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
nameFormat: "{0}"
|
|
||||||
testFormat: 2.14/{0}
|
|
||||||
targets:
|
|
||||||
- name: Sanity
|
|
||||||
test: sanity
|
|
||||||
- name: Units
|
|
||||||
test: units
|
|
||||||
## Docker
|
## Docker
|
||||||
- stage: Docker_devel
|
- stage: Docker_devel
|
||||||
displayName: Docker devel
|
displayName: Docker devel
|
||||||
|
|
@ -120,12 +107,12 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}/1
|
testFormat: devel/linux/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: Fedora 39
|
- name: Fedora 40
|
||||||
test: fedora39
|
test: fedora40
|
||||||
- name: Ubuntu 20.04
|
|
||||||
test: ubuntu2004
|
|
||||||
- name: Ubuntu 22.04
|
- name: Ubuntu 22.04
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
|
- name: Ubuntu 24.04
|
||||||
|
test: ubuntu2404
|
||||||
- stage: Docker_2_17
|
- stage: Docker_2_17
|
||||||
displayName: Docker 2.17
|
displayName: Docker 2.17
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -175,24 +162,6 @@ stages:
|
||||||
test: ubuntu2004
|
test: ubuntu2004
|
||||||
- name: Ubuntu 22.04
|
- name: Ubuntu 22.04
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
- stage: Docker_2_14
|
|
||||||
displayName: Docker 2.14
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.14/linux/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: CentOS 7
|
|
||||||
test: centos7
|
|
||||||
- name: Fedora 36
|
|
||||||
test: fedora36
|
|
||||||
- name: openSUSE 15 py3
|
|
||||||
test: opensuse15
|
|
||||||
- name: Ubuntu 20.04
|
|
||||||
test: ubuntu2004
|
|
||||||
- name: Ubuntu 22.04
|
|
||||||
test: ubuntu2204
|
|
||||||
|
|
||||||
## Remote
|
## Remote
|
||||||
- stage: Remote_devel
|
- stage: Remote_devel
|
||||||
|
|
@ -203,8 +172,8 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/{0}/1
|
testFormat: devel/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 9.3
|
- name: RHEL 9.4
|
||||||
test: rhel/9.3
|
test: rhel/9.4
|
||||||
- name: FreeBSD 13.3
|
- name: FreeBSD 13.3
|
||||||
test: freebsd/13.3
|
test: freebsd/13.3
|
||||||
- stage: Remote_2_17
|
- stage: Remote_2_17
|
||||||
|
|
@ -250,29 +219,12 @@ stages:
|
||||||
test: rhel/9.1
|
test: rhel/9.1
|
||||||
- name: FreeBSD 13.2
|
- name: FreeBSD 13.2
|
||||||
test: freebsd/13.2
|
test: freebsd/13.2
|
||||||
- stage: Remote_2_14
|
|
||||||
displayName: Remote 2.14
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.14/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: RHEL 7.9
|
|
||||||
test: rhel/7.9
|
|
||||||
- name: RHEL 8.6
|
|
||||||
test: rhel/8.6
|
|
||||||
- name: FreeBSD 13.2
|
|
||||||
test: freebsd/13.2
|
|
||||||
|
|
||||||
## Finally
|
## Finally
|
||||||
|
|
||||||
- stage: Summary
|
- stage: Summary
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Sanity_2_14
|
|
||||||
- Remote_2_14
|
|
||||||
- Docker_2_14
|
|
||||||
- Sanity_2_15
|
- Sanity_2_15
|
||||||
- Remote_2_15
|
- Remote_2_15
|
||||||
- Docker_2_15
|
- Docker_2_15
|
||||||
|
|
|
||||||
3
changelogs/fragments/512.yml
Normal file
3
changelogs/fragments/512.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- selinux - use compat.selinux instead of selinux (https://github.com/ansible-collections/ansible.posix/issues/502).
|
||||||
|
|
@ -97,7 +97,7 @@ import traceback
|
||||||
|
|
||||||
SELINUX_IMP_ERR = None
|
SELINUX_IMP_ERR = None
|
||||||
try:
|
try:
|
||||||
import selinux
|
from ansible.module_utils.compat import selinux as selinux_compat
|
||||||
HAS_SELINUX = True
|
HAS_SELINUX = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
SELINUX_IMP_ERR = traceback.format_exc()
|
SELINUX_IMP_ERR = traceback.format_exc()
|
||||||
|
|
@ -181,9 +181,9 @@ def set_config_state(module, state, configfile):
|
||||||
|
|
||||||
def set_state(module, state):
|
def set_state(module, state):
|
||||||
if state == 'enforcing':
|
if state == 'enforcing':
|
||||||
selinux.security_setenforce(1)
|
selinux_compat.security_setenforce(1)
|
||||||
elif state == 'permissive':
|
elif state == 'permissive':
|
||||||
selinux.security_setenforce(0)
|
selinux_compat.security_setenforce(0)
|
||||||
elif state == 'disabled':
|
elif state == 'disabled':
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
@ -249,15 +249,15 @@ def main():
|
||||||
policy = module.params['policy']
|
policy = module.params['policy']
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
update_kernel_param = module.params['update_kernel_param']
|
update_kernel_param = module.params['update_kernel_param']
|
||||||
runtime_enabled = selinux.is_selinux_enabled()
|
runtime_enabled = selinux_compat.is_selinux_enabled()
|
||||||
runtime_policy = selinux.selinux_getpolicytype()[1]
|
runtime_policy = selinux_compat.selinux_getpolicytype()[1]
|
||||||
runtime_state = 'disabled'
|
runtime_state = 'disabled'
|
||||||
kernel_enabled = None
|
kernel_enabled = None
|
||||||
reboot_required = False
|
reboot_required = False
|
||||||
|
|
||||||
if runtime_enabled:
|
if runtime_enabled:
|
||||||
# enabled means 'enforcing' or 'permissive'
|
# enabled means 'enforcing' or 'permissive'
|
||||||
if selinux.security_getenforce():
|
if selinux_compat.security_getenforce():
|
||||||
runtime_state = 'enforcing'
|
runtime_state = 'enforcing'
|
||||||
else:
|
else:
|
||||||
runtime_state = 'permissive'
|
runtime_state = 'permissive'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue