Compare commits

...

9 commits

Author SHA1 Message Date
Klaas Demter
6d195a4a1d
Merge 889ca91b48 into d3204df536 2025-07-22 18:25:52 +03:00
softwarefactory-project-zuul[bot]
d3204df536
Merge pull request #660 from saito-hideki/pr_azp_syntax
[AZP] Fixed syntax error in AZP settings

SUMMARY
Fixed syntax error in AZP settings
ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-17 03:39:40 +00:00
Hideki SAITO
162e72182f Fixed syntax error in azurepileline settings
Signed-off-by: Hideki SAITO <hsaito@macallan.home.fgrep.org>
2025-07-17 12:16:09 +09:00
softwarefactory-project-zuul[bot]
1c1dd005c8
Merge pull request #654 from saito-hideki/pr/bump_core_version_220
[CI] bump ansible-core version to 2.20 for devel branch

SUMMARY
Bump ansible-core version to 2.20 for devel branch.

Bump devel test to ansible-core 2.19
Add ansible-core 2.18 to the stable list

ISSUE TYPE

CI Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2025-07-10 01:00:47 +00:00
saito-hideki
40c27e2bee
CI - bump ansible-core version
* bump devel to ansible-core 2.20
* add ansible-core 2.19 to stable list

Signed-off-by: saito-hideki <saito@fgrep.org>
2025-07-10 09:35:28 +09:00
softwarefactory-project-zuul[bot]
c273ac2a01
Merge pull request #650 from felixfontein/callback
profile_* callbacks: avoid deprecated/deleted functions

SUMMARY
The profile_roles and profile_tasks callbacks define methods playbook_on_setup and playbook_on_stats which have been deleted/deprecated:

playbook_on_stats has been deprecated, v2_playbook_on_stats should be used instead (that one has already been there for many years: ansible/ansible@ba0e532 was added in 2015).
playbook_on_setup has been deleted (ansible/ansible@eec57ec), and its v2 variant was already deleted in 2017: ansible/ansible@59d5481

Ref: #635
ISSUE TYPE

Bugfix Pull Request
Feature Pull Request

COMPONENT NAME
profile_roles
profile_tasks

Reviewed-by: Abhijeet Kasurde
Reviewed-by: Hideki Saito <saito@fgrep.org>
2025-07-08 05:47:53 +00:00
Felix Fontein
f978998521 Add changelog fragment. 2025-06-28 16:34:47 +02:00
Felix Fontein
c319c856ed Avoid deprecated/deleted callback functions. 2025-06-28 16:29:29 +02: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 77 additions and 22 deletions

View file

@ -57,8 +57,23 @@ stages:
test: units test: units
- name: Lint - name: Lint
test: lint test: lint
- stage: Sanity_2_19
displayName: Ansible 2.19 sanitay & Units & Lint
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
nameFormat: "{0}"
testFormat: 2.19/{0}
targets:
- name: Sanity
test: sanity
- name: Units
test: units
- name: Lint
test: lint
- stage: Sanity_2_18 - stage: Sanity_2_18
displayName: Ansible 2.18 sanity displayName: Ansible 2.18 sanity & Units & Lint
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml - template: templates/matrix.yml
@ -73,7 +88,7 @@ stages:
- name: Lint - name: Lint
test: lint test: lint
- stage: Sanity_2_17 - stage: Sanity_2_17
displayName: Ansible 2.17 sanity displayName: Ansible 2.17 sanity & Units & Lint
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml - template: templates/matrix.yml
@ -88,7 +103,7 @@ stages:
- name: Lint - name: Lint
test: lint test: lint
- stage: Sanity_2_16 - stage: Sanity_2_16
displayName: Ansible 2.16 sanity displayName: Ansible 2.16 sanity & Units & Lint
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml - template: templates/matrix.yml
@ -101,7 +116,7 @@ stages:
- name: Units - name: Units
test: units test: units
- stage: Sanity_2_15 - stage: Sanity_2_15
displayName: Ansible 2.15 sanity displayName: Ansible 2.15 sanity & Units & Lint
dependsOn: [] dependsOn: []
jobs: jobs:
- template: templates/matrix.yml - template: templates/matrix.yml
@ -128,6 +143,20 @@ stages:
test: ubuntu2204 test: ubuntu2204
- name: Ubuntu 24.04 - name: Ubuntu 24.04
test: ubuntu2404 test: ubuntu2404
- stage: Docker_2_19
displayName: Docker 2.19
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/linux/{0}/1
targets:
- name: Fedora 41
test: fedora41
- name: Ubuntu 22.04
test: ubuntu2204
- name: Ubuntu 24.04
test: ubuntu2404
- stage: Docker_2_18 - stage: Docker_2_18
displayName: Docker 2.18 displayName: Docker 2.18
dependsOn: [] dependsOn: []
@ -203,6 +232,22 @@ stages:
test: freebsd/14.2 test: freebsd/14.2
- name: FreeBSD 13.5 - name: FreeBSD 13.5
test: freebsd/13.5 test: freebsd/13.5
- stage: Remote_2_19
displayName: Remote 2.19
dependsOn: []
jobs:
- template: templates/matrix.yml
parameters:
testFormat: devel/{0}/1
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: FreeBSD 13.5
test: freebsd/13.5
- stage: Remote_2_18 - stage: Remote_2_18
displayName: Remote 2.18 displayName: Remote 2.18
dependsOn: [] dependsOn: []
@ -272,6 +317,9 @@ stages:
- Sanity_2_18 - Sanity_2_18
- Remote_2_18 - Remote_2_18
- Docker_2_18 - Docker_2_18
- Sanity_2_19
- Remote_2_19
- Docker_2_19
- Sanity_devel - Sanity_devel
- Remote_devel - Remote_devel
- Docker_devel - Docker_devel

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,2 @@
minor_changes:
- "profile_tasks and profile_roles callback plugins - avoid deleted/deprecated callback functions, instead use modern interface that was introduced a longer time ago (https://github.com/ansible-collections/ansible.posix/issues/650)."

View file

@ -0,0 +1,3 @@
---
trivial:
- Bump ansible-core version to 2.20 of devel branch and add 2.19 to CI

View file

@ -0,0 +1,2 @@
trivial:
- AZP - fixed syntax error in CI test.

View file

@ -124,10 +124,7 @@ class CallbackModule(CallbackBase):
def v2_playbook_on_handler_task_start(self, task): def v2_playbook_on_handler_task_start(self, task):
self._record_task(task) self._record_task(task)
def playbook_on_setup(self): def v2_playbook_on_stats(self, stats):
self._display_tasktime()
def playbook_on_stats(self, stats):
# Align summary report header with other callback plugin summary # Align summary report header with other callback plugin summary
self._display.banner("ROLES RECAP") self._display.banner("ROLES RECAP")

View file

@ -209,10 +209,7 @@ class CallbackModule(CallbackBase):
def v2_playbook_on_handler_task_start(self, task): def v2_playbook_on_handler_task_start(self, task):
self._record_task(task) self._record_task(task)
def playbook_on_setup(self): def v2_playbook_on_stats(self, stats):
self._display_tasktime()
def playbook_on_stats(self, stats):
# Align summary report header with other callback plugin summary # Align summary report header with other callback plugin summary
self._display.banner("TASKS RECAP") self._display.banner("TASKS RECAP")

View file

@ -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

View file

@ -0,0 +1 @@
tests/utils/shippable/timing.py shebang