mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
Compare commits
8 commits
6d195a4a1d
...
f9750d8974
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9750d8974 | ||
|
|
b96fad5e5b | ||
|
|
2d350e6073 | ||
|
|
ea6ef5c775 | ||
|
|
9007e20b2f | ||
|
|
508e3d920f | ||
|
|
18e023dd77 | ||
|
|
889ca91b48 |
9 changed files with 45 additions and 79 deletions
|
|
@ -37,7 +37,7 @@ variables:
|
||||||
resources:
|
resources:
|
||||||
containers:
|
containers:
|
||||||
- container: default
|
- container: default
|
||||||
image: quay.io/ansible/azure-pipelines-test-container:6.0.0
|
image: quay.io/ansible/azure-pipelines-test-container:7.0.0
|
||||||
|
|
||||||
pool: Standard
|
pool: Standard
|
||||||
|
|
||||||
|
|
@ -115,19 +115,6 @@ stages:
|
||||||
test: sanity
|
test: sanity
|
||||||
- name: Units
|
- name: Units
|
||||||
test: units
|
test: units
|
||||||
- stage: Sanity_2_15
|
|
||||||
displayName: Ansible 2.15 sanity & Units & Lint
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
nameFormat: "{0}"
|
|
||||||
testFormat: 2.15/{0}
|
|
||||||
targets:
|
|
||||||
- name: Sanity
|
|
||||||
test: sanity
|
|
||||||
- name: Units
|
|
||||||
test: units
|
|
||||||
## Docker
|
## Docker
|
||||||
- stage: Docker_devel
|
- stage: Docker_devel
|
||||||
displayName: Docker devel
|
displayName: Docker devel
|
||||||
|
|
@ -137,8 +124,8 @@ stages:
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}/1
|
testFormat: devel/linux/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: Fedora 41
|
- name: Fedora 42
|
||||||
test: fedora41
|
test: fedora42
|
||||||
- name: Ubuntu 22.04
|
- name: Ubuntu 22.04
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
- name: Ubuntu 24.04
|
- name: Ubuntu 24.04
|
||||||
|
|
@ -149,7 +136,7 @@ stages:
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/linux/{0}/1
|
testFormat: 2.19/linux/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: Fedora 41
|
- name: Fedora 41
|
||||||
test: fedora41
|
test: fedora41
|
||||||
|
|
@ -198,23 +185,6 @@ stages:
|
||||||
- name: Ubuntu 22.04
|
- name: Ubuntu 22.04
|
||||||
test: ubuntu2204
|
test: ubuntu2204
|
||||||
|
|
||||||
- stage: Docker_2_15
|
|
||||||
displayName: Docker 2.15
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.15/linux/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: CentOS 7
|
|
||||||
test: centos7
|
|
||||||
- name: Fedora 37
|
|
||||||
test: fedora37
|
|
||||||
- name: openSUSE 15 py3
|
|
||||||
test: opensuse15
|
|
||||||
- name: Ubuntu 22.04
|
|
||||||
test: ubuntu2204
|
|
||||||
|
|
||||||
## Remote
|
## Remote
|
||||||
- stage: Remote_devel
|
- stage: Remote_devel
|
||||||
displayName: Remote devel
|
displayName: Remote devel
|
||||||
|
|
@ -226,10 +196,10 @@ stages:
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 10.0
|
- name: RHEL 10.0
|
||||||
test: rhel/10.0
|
test: rhel/10.0
|
||||||
- name: RHEL 9.5
|
- name: RHEL 9.6
|
||||||
test: rhel/9.5
|
test: rhel/9.6
|
||||||
- name: FreeBSD 14.2
|
- name: FreeBSD 14.3
|
||||||
test: freebsd/14.2
|
test: freebsd/14.3
|
||||||
- name: FreeBSD 13.5
|
- name: FreeBSD 13.5
|
||||||
test: freebsd/13.5
|
test: freebsd/13.5
|
||||||
- stage: Remote_2_19
|
- stage: Remote_2_19
|
||||||
|
|
@ -238,7 +208,7 @@ stages:
|
||||||
jobs:
|
jobs:
|
||||||
- template: templates/matrix.yml
|
- template: templates/matrix.yml
|
||||||
parameters:
|
parameters:
|
||||||
testFormat: devel/{0}/1
|
testFormat: 2.19/{0}/1
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 10.0
|
- name: RHEL 10.0
|
||||||
test: rhel/10.0
|
test: rhel/10.0
|
||||||
|
|
@ -258,8 +228,8 @@ stages:
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 9.4
|
- name: RHEL 9.4
|
||||||
test: rhel/9.4
|
test: rhel/9.4
|
||||||
- name: FreeBSD 13.3
|
- name: FreeBSD 13.5
|
||||||
test: freebsd/13.3
|
test: freebsd/13.5
|
||||||
- stage: Remote_2_17
|
- stage: Remote_2_17
|
||||||
displayName: Remote 2.17
|
displayName: Remote 2.17
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -270,8 +240,8 @@ stages:
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 9.3
|
- name: RHEL 9.3
|
||||||
test: rhel/9.3
|
test: rhel/9.3
|
||||||
- name: FreeBSD 13.3
|
- name: FreeBSD 13.5
|
||||||
test: freebsd/13.3
|
test: freebsd/13.5
|
||||||
- stage: Remote_2_16
|
- stage: Remote_2_16
|
||||||
displayName: Remote 2.16
|
displayName: Remote 2.16
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
@ -285,29 +255,11 @@ stages:
|
||||||
- name: RHEL 9.2
|
- name: RHEL 9.2
|
||||||
test: rhel/9.2
|
test: rhel/9.2
|
||||||
|
|
||||||
- stage: Remote_2_15
|
|
||||||
displayName: Remote 2.15
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- template: templates/matrix.yml
|
|
||||||
parameters:
|
|
||||||
testFormat: 2.15/{0}/1
|
|
||||||
targets:
|
|
||||||
- name: RHEL 7.9
|
|
||||||
test: rhel/7.9
|
|
||||||
- name: RHEL 8.7
|
|
||||||
test: rhel/8.7
|
|
||||||
- name: RHEL 9.1
|
|
||||||
test: rhel/9.1
|
|
||||||
|
|
||||||
## Finally
|
## Finally
|
||||||
|
|
||||||
- stage: Summary
|
- stage: Summary
|
||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- Sanity_2_15
|
|
||||||
- Remote_2_15
|
|
||||||
- Docker_2_15
|
|
||||||
- Sanity_2_16
|
- Sanity_2_16
|
||||||
- Remote_2_16
|
- Remote_2_16
|
||||||
- Docker_2_16
|
- Docker_2_16
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -21,7 +21,7 @@ An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and de
|
||||||
* Python:
|
* Python:
|
||||||
* The Python interpreter version must meet Ansible Core's requirements.
|
* The Python interpreter version must meet Ansible Core's requirements.
|
||||||
* Ansible Core:
|
* Ansible Core:
|
||||||
- ansible-core 2.15 or later
|
- ansible-core 2.16 or later
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|
@ -46,10 +46,10 @@ To upgrade the collection to the latest available version, run the following com
|
||||||
ansible-galaxy collection install ansible.posix --upgrade
|
ansible-galaxy collection install ansible.posix --upgrade
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 1.0.0:
|
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version 2.0.0:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ansible-galaxy collection install ansible.posix:==1.0.0
|
ansible-galaxy collection install ansible.posix:==2.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
|
See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details.
|
||||||
|
|
@ -78,11 +78,10 @@ ansible-doc -t callback ansible.posix.profile_tasks
|
||||||
|
|
||||||
The following ansible-core versions have been tested with this collection:
|
The following ansible-core versions have been tested with this collection:
|
||||||
|
|
||||||
- ansible-core 2.19 (devel)
|
- ansible-core 2.20 (devel)
|
||||||
- ansible-core 2.18 (stable) *
|
- ansible-core 2.19 (stable) *
|
||||||
|
- ansible-core 2.18 (stable)
|
||||||
- ansible-core 2.17 (stable)
|
- ansible-core 2.17 (stable)
|
||||||
- ansible-core 2.16 (stable)
|
|
||||||
- ansible-core 2.15 (stable)
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
||||||
3
changelogs/fragments/639_fix_authorized_key.yml
Normal file
3
changelogs/fragments/639_fix_authorized_key.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- ansible.posix.authorized_key - fixes error on permission denied in authorized_key module (https://github.com/ansible-collections/ansible.posix/issues/462).
|
||||||
3
changelogs/fragments/665_update_readme_20250728.yml
Normal file
3
changelogs/fragments/665_update_readme_20250728.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
trivial:
|
||||||
|
- README - Update README to reflect Ansible Core 2.19 release.
|
||||||
3
changelogs/fragments/666_azp_update_20250728.yml
Normal file
3
changelogs/fragments/666_azp_update_20250728.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
trivial:
|
||||||
|
- AZP - Update AZP matrix to follow ansible-test changes.
|
||||||
2
changelogs/fragments/673_update_ci_20250805.yml
Normal file
2
changelogs/fragments/673_update_ci_20250805.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
trivial:
|
||||||
|
- Update AZP CI matrix (https://github.com/ansible-collections/ansible.posix/issues/673).
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
---
|
---
|
||||||
requires_ansible: ">=2.15.0"
|
requires_ansible: ">=2.16.0"
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ import os.path
|
||||||
import tempfile
|
import tempfile
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
import errno
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
from ansible.module_utils._text import to_native
|
from ansible.module_utils._text import to_native
|
||||||
|
|
@ -475,16 +476,17 @@ def parsekey(module, raw_key, rank=None):
|
||||||
return (key, key_type, options, comment, rank)
|
return (key, key_type, options, comment, rank)
|
||||||
|
|
||||||
|
|
||||||
def readfile(filename):
|
def readfile(module, filename):
|
||||||
|
|
||||||
if not os.path.isfile(filename):
|
|
||||||
return ''
|
|
||||||
|
|
||||||
f = open(filename)
|
|
||||||
try:
|
try:
|
||||||
return f.read()
|
with open(filename, 'r') as f:
|
||||||
finally:
|
return f.read()
|
||||||
f.close()
|
except IOError as e:
|
||||||
|
if e.errno == errno.EACCES:
|
||||||
|
module.fail_json(msg="Permission denied on file or path for authorized keys file: {}".format(filename))
|
||||||
|
elif e.errno == errno.ENOENT:
|
||||||
|
return ''
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def parsekeys(module, lines):
|
def parsekeys(module, lines):
|
||||||
|
|
@ -597,7 +599,7 @@ def enforce_state(module, params):
|
||||||
# check current state -- just get the filename, don't create file
|
# check current state -- just get the filename, don't create file
|
||||||
do_write = False
|
do_write = False
|
||||||
params["keyfile"] = keyfile(module, user, do_write, path, manage_dir)
|
params["keyfile"] = keyfile(module, user, do_write, path, manage_dir)
|
||||||
existing_content = readfile(params["keyfile"])
|
existing_content = readfile(module, params["keyfile"])
|
||||||
existing_keys = parsekeys(module, existing_content)
|
existing_keys = parsekeys(module, existing_content)
|
||||||
|
|
||||||
# Add a place holder for keys that should exist in the state=present and
|
# Add a place holder for keys that should exist in the state=present and
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
needs/privileged
|
||||||
|
needs/root
|
||||||
destructive
|
destructive
|
||||||
shippable/posix/group1
|
shippable/posix/group1
|
||||||
skip/aix
|
skip/aix
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue