mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-13 08:05:19 +01:00
Compare commits
7 commits
c19573d79e
...
793002b98c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
793002b98c | ||
|
|
5321a9ecb5 | ||
|
|
7194b6bb13 | ||
|
|
7e1b76c46e | ||
|
|
505a4aaa09 | ||
|
|
d70d2aaaa7 | ||
|
|
806ff5c1a3 |
5 changed files with 83 additions and 11 deletions
|
|
@ -57,6 +57,21 @@ stages:
|
||||||
test: units
|
test: units
|
||||||
- name: Lint
|
- name: Lint
|
||||||
test: lint
|
test: lint
|
||||||
|
- stage: Sanity_2_18
|
||||||
|
displayName: Ansible 2.18 sanity
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
nameFormat: "{0}"
|
||||||
|
testFormat: 2.18/{0}
|
||||||
|
targets:
|
||||||
|
- name: Sanity
|
||||||
|
test: sanity
|
||||||
|
- name: Units
|
||||||
|
test: units
|
||||||
|
- name: Lint
|
||||||
|
test: lint
|
||||||
- stage: Sanity_2_17
|
- stage: Sanity_2_17
|
||||||
displayName: Ansible 2.17 sanity
|
displayName: Ansible 2.17 sanity
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -113,6 +128,20 @@ stages:
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
- name: Ubuntu 24.04
|
- name: Ubuntu 24.04
|
||||||
test: ubuntu2404
|
test: ubuntu2404
|
||||||
|
- stage: Docker_2_18
|
||||||
|
displayName: Docker devel
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.18/linux/{0}/1
|
||||||
|
targets:
|
||||||
|
- name: Fedora 40
|
||||||
|
test: fedora40
|
||||||
|
- name: Ubuntu 22.04
|
||||||
|
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: []
|
||||||
|
|
@ -176,6 +205,18 @@ stages:
|
||||||
test: rhel/9.4
|
test: rhel/9.4
|
||||||
- name: FreeBSD 13.3
|
- name: FreeBSD 13.3
|
||||||
test: freebsd/13.3
|
test: freebsd/13.3
|
||||||
|
- stage: Remote_2_18
|
||||||
|
displayName: Remote devel
|
||||||
|
dependsOn: []
|
||||||
|
jobs:
|
||||||
|
- template: templates/matrix.yml
|
||||||
|
parameters:
|
||||||
|
testFormat: 2.18/{0}/1
|
||||||
|
targets:
|
||||||
|
- name: RHEL 9.4
|
||||||
|
test: rhel/9.4
|
||||||
|
- name: FreeBSD 13.3
|
||||||
|
test: freebsd/13.3
|
||||||
- stage: Remote_2_17
|
- stage: Remote_2_17
|
||||||
displayName: Remote 2.17
|
displayName: Remote 2.17
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -234,8 +275,11 @@ stages:
|
||||||
- Sanity_2_17
|
- Sanity_2_17
|
||||||
- Remote_2_17
|
- Remote_2_17
|
||||||
- Docker_2_17
|
- Docker_2_17
|
||||||
|
- Sanity_2_18
|
||||||
|
- Remote_2_18
|
||||||
|
- Docker_2_18
|
||||||
- Sanity_devel
|
- Sanity_devel
|
||||||
- Remote_devel
|
# - Remote_devel # Wait for test environment release
|
||||||
- Docker_devel
|
# - Docker_devel # Wait for test environment release
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/coverage.yml
|
- template: templates/coverage.yml
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,14 @@ None
|
||||||
|
|
||||||
<!-- List the versions of Ansible the collection has been tested with. Must match what is in galaxy.yml. -->
|
<!-- List the versions of Ansible the collection has been tested with. Must match what is in galaxy.yml. -->
|
||||||
|
|
||||||
- ansible-core 2.18 (devel)
|
- ansible-core 2.19 (devel)
|
||||||
|
- ansible-core 2.18 (stable) *
|
||||||
- ansible-core 2.17 (stable)
|
- ansible-core 2.17 (stable)
|
||||||
- ansible-core 2.16 (stable)
|
- ansible-core 2.16 (stable)
|
||||||
- ansible-core 2.15 (stable)
|
- ansible-core 2.15 (stable)
|
||||||
|
|
||||||
|
*Note: For ansible-core 2.18, CI only covers sanity tests and no integration tests will be run until the test environment is released.*
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
<!-- Optional. Include the roadmap for this collection, and the proposed release/versioning strategy so users can anticipate the upgrade/update cycle. -->
|
<!-- Optional. Include the roadmap for this collection, and the proposed release/versioning strategy so users can anticipate the upgrade/update cycle. -->
|
||||||
|
|
|
||||||
3
changelogs/fragments/571_ci_bump_core_version.yml
Normal file
3
changelogs/fragments/571_ci_bump_core_version.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
trivial:
|
||||||
|
- Bump ansible-core version to 2.19 of devel branch and add 2.18 to CI.
|
||||||
|
|
@ -101,6 +101,7 @@ import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import glob
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.six import string_types
|
from ansible.module_utils.six import string_types
|
||||||
|
|
@ -114,12 +115,24 @@ class SysctlModule(object):
|
||||||
# success or failure.
|
# success or failure.
|
||||||
LANG_ENV = {'LANG': 'C', 'LC_ALL': 'C', 'LC_MESSAGES': 'C'}
|
LANG_ENV = {'LANG': 'C', 'LC_ALL': 'C', 'LC_MESSAGES': 'C'}
|
||||||
|
|
||||||
|
# We define a variable to keep all the directories to be read, equivalent to
|
||||||
|
# (/sbin/sysctl --system) option
|
||||||
|
SYSCTL_DIRS = [
|
||||||
|
'/etc/sysctl.d/*.conf',
|
||||||
|
'/run/sysctl.d/*.conf',
|
||||||
|
'/usr/local/lib/sysctl.d/*.conf',
|
||||||
|
'/usr/lib/sysctl.d/*.conf',
|
||||||
|
'/lib/sysctl.d/*.conf',
|
||||||
|
'/etc/sysctl.conf'
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self, module):
|
def __init__(self, module):
|
||||||
self.module = module
|
self.module = module
|
||||||
self.args = self.module.params
|
self.args = self.module.params
|
||||||
|
|
||||||
self.sysctl_cmd = self.module.get_bin_path('sysctl', required=True)
|
self.sysctl_cmd = self.module.get_bin_path('sysctl', required=True)
|
||||||
self.sysctl_file = self.args['sysctl_file']
|
self.sysctl_file = self.args['sysctl_file']
|
||||||
|
self.system_Wide = self.args['system_Wide']
|
||||||
|
|
||||||
self.proc_value = None # current token value in proc fs
|
self.proc_value = None # current token value in proc fs
|
||||||
self.file_value = None # current token value in file
|
self.file_value = None # current token value in file
|
||||||
|
|
@ -299,15 +312,22 @@ class SysctlModule(object):
|
||||||
# https://github.com/ansible/ansible/issues/58158
|
# https://github.com/ansible/ansible/issues/58158
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# system supports reloading via the -p flag to sysctl, so we'll use that
|
if self.system_Wide:
|
||||||
sysctl_args = [self.sysctl_cmd, '-p', self.sysctl_file]
|
for sysctl_file in self.SYSCTL_DIRS:
|
||||||
if self.args['ignoreerrors']:
|
for conf_file in glob.glob(sysctl_file):
|
||||||
sysctl_args.insert(1, '-e')
|
rc, out, err = self.module.run_command([self.sysctl_cmd, '-p', conf_file], environ_update=self.LANG_ENV)
|
||||||
|
if rc != 0 or self._stderr_failed(err):
|
||||||
|
self.module.fail_json(msg="Failed to reload sysctl: %s" % to_native(out) + to_native(err))
|
||||||
|
else:
|
||||||
|
# system supports reloading via the -p flag to sysctl, so we'll use that
|
||||||
|
sysctl_args = [self.sysctl_cmd, '-p', self.sysctl_file]
|
||||||
|
if self.args['ignoreerrors']:
|
||||||
|
sysctl_args.insert(1, '-e')
|
||||||
|
|
||||||
rc, out, err = self.module.run_command(sysctl_args, environ_update=self.LANG_ENV)
|
rc, out, err = self.module.run_command(sysctl_args, environ_update=self.LANG_ENV)
|
||||||
|
|
||||||
if rc != 0 or self._stderr_failed(err):
|
if rc != 0 or self._stderr_failed(err):
|
||||||
self.module.fail_json(msg="Failed to reload sysctl: %s" % to_native(out) + to_native(err))
|
self.module.fail_json(msg="Failed to reload sysctl: %s" % to_native(out) + to_native(err))
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# SYSCTL FILE MANAGEMENT
|
# SYSCTL FILE MANAGEMENT
|
||||||
|
|
@ -394,7 +414,8 @@ def main():
|
||||||
reload=dict(default=True, type='bool'),
|
reload=dict(default=True, type='bool'),
|
||||||
sysctl_set=dict(default=False, type='bool'),
|
sysctl_set=dict(default=False, type='bool'),
|
||||||
ignoreerrors=dict(default=False, type='bool'),
|
ignoreerrors=dict(default=False, type='bool'),
|
||||||
sysctl_file=dict(default='/etc/sysctl.conf', type='path')
|
sysctl_file=dict(default='/etc/sysctl.conf', type='path'),
|
||||||
|
system_wide=dict(default=False, type='bool'), # system_wide parameter
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
required_if=[('state', 'present', ['value'])],
|
required_if=[('state', 'present', ['value'])],
|
||||||
|
|
|
||||||
1
tests/sanity/ignore-2.19.txt
Normal file
1
tests/sanity/ignore-2.19.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
tests/utils/shippable/timing.py shebang
|
||||||
Loading…
Reference in a new issue