Compare commits

...

8 commits

Author SHA1 Message Date
Klaas Demter
f9750d8974
Merge 889ca91b48 into b96fad5e5b 2025-08-15 20:34:44 +03:00
softwarefactory-project-zuul[bot]
b96fad5e5b
Merge pull request #673 from saito-hideki/pr/ci_update_20250805
[AZP] Update CI matrix

SUMMARY
Update AZP CI matrix:

Addresses #672
Bump test container version 7.0.0
Removes Ansible Core 2.15 tests. Python 3.11 is no longer supported in Container 7.0.0.

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-08-05 23:44:46 +00:00
saito-hideki
2d350e6073
AZP update CI matrix
* Addresses #672
* Bump test container version 7.0.0
* Removes Ansible Core 2.15 tests. Python 3.11 is no longer supported in Container 7.0.0.

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-08-05 14:30:30 +09:00
softwarefactory-project-zuul[bot]
ea6ef5c775
Merge pull request #665 from saito-hideki/pr/readme_20250728
Update README for release of Ansible Core 2.19

SUMMARY
README updated with the release of Ansible Core 2.19

https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_19.html

ISSUE TYPE

Docs Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
N/A
2025-07-28 08:38:22 +00:00
saito-hideki
9007e20b2f
README updated with the release of Ansible Core 2.19
* https://docs.ansible.com/ansible/devel/roadmap/ROADMAP_2_19.html

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-07-28 17:12:02 +09:00
softwarefactory-project-zuul[bot]
508e3d920f
Merge pull request #666 from saito-hideki/pr/azp_update_matrix_20250728
[AZP][CI] Update AZP matrix to follow ansible-test changes

SUMMARY
Update AZP matrix to follow ansible-test changes

ansible/ansible/pull/85558
ansible/ansible/pull/85561
ansible/ansible/pull/85562

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-28 06:32:06 +00:00
saito-hideki
18e023dd77
Update AZP matrix to follow ansible-test changes
* https://github.com/ansible/ansible/pull/85558
* https://github.com/ansible/ansible/pull/85561
* https://github.com/ansible/ansible/pull/85562

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-07-28 14:59:14 +09:00
Klaas Demter
889ca91b48 Fixes #462 notice permission denied on authorized_key module 2025-05-20 12:36:42 +02:00
9 changed files with 45 additions and 79 deletions

View file

@ -37,7 +37,7 @@ variables:
resources:
containers:
- 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
@ -115,19 +115,6 @@ stages:
test: sanity
- name: 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
- stage: Docker_devel
displayName: Docker devel
@ -137,8 +124,8 @@ stages:
parameters:
testFormat: devel/linux/{0}/1
targets:
- name: Fedora 41
test: fedora41
- name: Fedora 42
test: fedora42
- name: Ubuntu 22.04
test: ubuntu2204
- name: Ubuntu 24.04
@ -149,7 +136,7 @@ stages:
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/linux/{0}/1
testFormat: 2.19/linux/{0}/1
targets:
- name: Fedora 41
test: fedora41
@ -198,23 +185,6 @@ stages:
- name: Ubuntu 22.04
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
- stage: Remote_devel
displayName: Remote devel
@ -226,10 +196,10 @@ stages:
targets:
- name: RHEL 10.0
test: rhel/10.0
- name: RHEL 9.5
test: rhel/9.5
- name: FreeBSD 14.2
test: freebsd/14.2
- name: RHEL 9.6
test: rhel/9.6
- name: FreeBSD 14.3
test: freebsd/14.3
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_19
@ -238,7 +208,7 @@ stages:
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/{0}/1
testFormat: 2.19/{0}/1
targets:
- name: RHEL 10.0
test: rhel/10.0
@ -258,8 +228,8 @@ stages:
targets:
- name: RHEL 9.4
test: rhel/9.4
- name: FreeBSD 13.3
test: freebsd/13.3
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_17
displayName: Remote 2.17
dependsOn: []
@ -270,8 +240,8 @@ stages:
targets:
- name: RHEL 9.3
test: rhel/9.3
- name: FreeBSD 13.3
test: freebsd/13.3
- name: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_16
displayName: Remote 2.16
dependsOn: []
@ -285,29 +255,11 @@ stages:
- name: 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
- stage: Summary
condition: succeededOrFailed()
dependsOn:
- Sanity_2_15
- Remote_2_15
- Docker_2_15
- Sanity_2_16
- Remote_2_16
- Docker_2_16

View file

@ -21,7 +21,7 @@ An Ansible Collection of modules and plugins that target POSIX UNIX/Linux and de
* Python:
* The Python interpreter version must meet Ansible Core's requirements.
* Ansible Core:
- ansible-core 2.15 or later
- ansible-core 2.16 or later
## 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
```
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
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.
@ -78,11 +78,10 @@ ansible-doc -t callback ansible.posix.profile_tasks
The following ansible-core versions have been tested with this collection:
- ansible-core 2.19 (devel)
- ansible-core 2.18 (stable) *
- ansible-core 2.20 (devel)
- ansible-core 2.19 (stable) *
- ansible-core 2.18 (stable)
- ansible-core 2.17 (stable)
- ansible-core 2.16 (stable)
- ansible-core 2.15 (stable)
## Contributing

View 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).

View file

@ -0,0 +1,3 @@
---
trivial:
- README - Update README to reflect Ansible Core 2.19 release.

View file

@ -0,0 +1,3 @@
---
trivial:
- AZP - Update AZP matrix to follow ansible-test changes.

View file

@ -0,0 +1,2 @@
trivial:
- Update AZP CI matrix (https://github.com/ansible-collections/ansible.posix/issues/673).

View file

@ -1,2 +1,2 @@
---
requires_ansible: ">=2.15.0"
requires_ansible: ">=2.16.0"

View file

@ -225,6 +225,7 @@ import os.path
import tempfile
import re
import shlex
import errno
from operator import itemgetter
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)
def readfile(filename):
if not os.path.isfile(filename):
return ''
f = open(filename)
def readfile(module, filename):
try:
with open(filename, 'r') as f:
return f.read()
finally:
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):
@ -597,7 +599,7 @@ def enforce_state(module, params):
# check current state -- just get the filename, don't create file
do_write = False
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)
# Add a place holder for keys that should exist in the state=present and

View file

@ -1,3 +1,5 @@
needs/privileged
needs/root
destructive
shippable/posix/group1
skip/aix