20 Commits

Author SHA1 Message Date
John
3abd029b9f Fix missing-final-newline error 2022-09-21 08:38:09 -07:00
John
3d2681aea6 Improve callback output to align header with roles, tasks and play RECAP 2022-09-20 14:38:08 -07:00
softwarefactory-project-zuul[bot]
0224e4d415 Merge pull request #373 from bcoca/patch-1
More complete missing lib msg

adds 'exact' python used by module  and hostname to avoid confusion
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

firewalld

Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-09-16 08:13:45 +00:00
Hideki Saito
cc20deaad2 Add changelog fragment file to PR #373
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-16 16:37:23 +09:00
softwarefactory-project-zuul[bot]
5e0a6592ca Merge pull request #380 from IPvSean/patch-1
Update profile_tasks.py

SUMMARY
removing contentious terminology to match reference documentation https://docs.ansible.com/ansible/latest/reference_appendices/config.html
ISSUE TYPE


Docs Pull Request

COMPONENT NAME
profile_tasks_callback
ADDITIONAL INFORMATION
n/a

Reviewed-by: Hideki Saito <saito@fgrep.org>
2022-09-12 05:23:35 +00:00
Hideki Saito
acd5a2b17e Add changelog fragments to PR #380
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-12 13:47:55 +09:00
softwarefactory-project-zuul[bot]
e629ae2d7c Merge pull request #386 from saito-hideki/pr/ci_ansible-test-sanity-docker-devel
[CI] Address pylint check check error in ansible-test-sanity-docker-devel test

SUMMARY
Currently, ansible-test-sanity-docker-devel is set non voting, but we need to fix pylint check error in several modules.

https://ansible.softwarefactory-project.io/zuul/build/fbd5ac593fe44fa7b3d77e5557de1607

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

 ansible.posix.authorized_keys
 ansible.posix.mount

ADDITIONAL INFORMATION
None
2022-09-12 03:36:06 +00:00
Hideki Saito
abfe36c62f Fix to follow pylint check in ansible-test-sanity-docker-devel
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-12 10:30:01 +09:00
softwarefactory-project-zuul[bot]
6c0b91a3ee Merge pull request #384 from saito-hideki/pr/ci_remove_f35
[CI] Update AZP matrix to remove Fedora35 and FreeBSD12.3 tests from devel

SUMMARY
Removing Fedora35 and FreeBSD12.3 from CI tests for devel branch(docker and remote).
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION

Related to ansible-collections/news-for-maintainers/issues/21
2022-08-24 04:01:18 +00:00
Hideki Saito
f7fac90009 Removing Fedora 35 and FreeBSD 12.3 from CI tests
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-08-19 13:26:31 +09:00
Sean Cavanaugh
c4be75114b Update profile_tasks.py
removing contentious terminology to match reference documentation https://docs.ansible.com/ansible/latest/reference_appendices/config.html
2022-07-15 14:04:06 -04:00
softwarefactory-project-zuul[bot]
6da0cbb3d3 Merge pull request #375 from saito-hideki/pr/update_azp_container
[CI] Bump AZP container version

SUMMARY
Addresses the following requirements:

ansible-collections/news-for-maintainers#18

However, ansible.posix needs to support Ansible Engine 2.9, so we will keep 2.9, 2.10, and 2.11 in the CI tests for now.
ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-06-15 10:06:20 +00:00
Hideki Saito
17fc3bcce6 Bump AZP container version
- https://github.com/ansible-collections/news-for-maintainers/issues/18

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-06-15 18:26:15 +09:00
Brian Coca
d7c7d1d2c8 More complete missing lib msg
adds 'exact' python used by module  and hostname to avoid confusion
2022-06-03 18:39:01 -04:00
softwarefactory-project-zuul[bot]
55bd196e82 Merge pull request #371 from saito-hideki/pr/ci_refactoring_202206
[CI] Refactor AZP settings and CI script

SUMMARY
Refactored AZP settings and CI script to correct the following PR's side effects:

Addresses #369

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-06-02 03:00:47 +00:00
Hideki Saito
f451f2211b Refactor AZP settings and CI script
* Addresses https://github.com/ansible-collections/news-for-maintainers/issues/17
* Addresses https://github.com/ansible-collections/ansible.posix/pull/369

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-06-02 11:27:17 +09:00
softwarefactory-project-zuul[bot]
18c847a8a0 Merge pull request #366 from saito-hideki/pr/replace_version_with_1.5.0
Update version number in galaxy.yml to 1.5.0.

SUMMARY
Update version number in galaxy.yml to 1.5.0.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-05-30 13:44:30 +00:00
Hideki Saito
ee65205607 Update version number of galaxy.yml to 1.5.0.
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-30 22:01:35 +09:00
softwarefactory-project-zuul[bot]
2c9c3a0f54 Merge pull request #369 from saito-hideki/pr/ci_refactoring_azp_matrix
[CI] Refactoring AZP CI matrix

SUMMARY
Refactoring AZP CI matrix:

ansible-collections/news-for-maintainers#17
#368

ISSUE TYPE

CI tests Pull Request

COMPONENT NAME

ansible.posix

ADDITIONAL INFORMATION
None
2022-05-30 05:55:58 +00:00
Hideki Saito
c1f830f3df Refactoring AZP CI matrix
* https://github.com/ansible-collections/news-for-maintainers/issues/17

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-30 14:04:07 +09:00
16 changed files with 64 additions and 36 deletions

View File

@@ -36,7 +36,7 @@ variables:
resources: resources:
containers: containers:
- container: default - container: default
image: quay.io/ansible/azure-pipelines-test-container:1.9.0 image: quay.io/ansible/azure-pipelines-test-container:3.0.0
pool: Standard pool: Standard
@@ -53,16 +53,14 @@ stages:
targets: targets:
- name: CentOS 7 - name: CentOS 7
test: centos7 test: centos7
- name: Fedora 34 - name: Fedora 36
test: fedora34 test: fedora36
- name: Fedora 35
test: fedora35
- name: openSUSE 15 py3 - name: openSUSE 15 py3
test: opensuse15 test: opensuse15
- name: Ubuntu 18.04
test: ubuntu1804
- name: Ubuntu 20.04 - name: Ubuntu 20.04
test: ubuntu2004 test: ubuntu2004
- name: Ubuntu 22.04
test: ubuntu2204
- stage: Docker_2_13 - stage: Docker_2_13
displayName: Docker 2.13 displayName: Docker 2.13
dependsOn: [] dependsOn: []
@@ -193,12 +191,12 @@ stages:
test: macos/12.0 test: macos/12.0
- name: RHEL 7.9 - name: RHEL 7.9
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.5 - name: RHEL 8.6
test: rhel/8.5 test: rhel/8.6
- name: FreeBSD 12.3 - name: RHEL 9.0
test: freebsd/12.3 test: rhel/9.0
- name: FreeBSD 13.0 - name: FreeBSD 13.1
test: freebsd/13.0 test: freebsd/13.1
- stage: Remote_2_13 - stage: Remote_2_13
displayName: Remote 2.13 displayName: Remote 2.13
dependsOn: [] dependsOn: []
@@ -249,8 +247,6 @@ stages:
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.3 - name: RHEL 8.3
test: rhel/8.3 test: rhel/8.3
- name: FreeBSD 11.4
test: freebsd/11.4
- name: FreeBSD 12.2 - name: FreeBSD 12.2
test: freebsd/12.2 test: freebsd/12.2
- stage: Remote_2_10 - stage: Remote_2_10
@@ -267,11 +263,6 @@ stages:
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.2 - name: RHEL 8.2
test: rhel/8.2 test: rhel/8.2
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.1
test: freebsd/12.1
- stage: Remote_2_9 - stage: Remote_2_9
displayName: Remote 2.9 displayName: Remote 2.9
dependsOn: [] dependsOn: []
@@ -286,10 +277,7 @@ stages:
test: rhel/7.9 test: rhel/7.9
- name: RHEL 8.1 - name: RHEL 8.1
test: rhel/8.1 test: rhel/8.1
- name: FreeBSD 11.1
test: freebsd/11.1
- name: FreeBSD 12.0
test: freebsd/12.0
## Finally ## Finally
- stage: Summary - stage: Summary

View File

@@ -0,0 +1,3 @@
---
trivial:
- Update version number in galaxy.yml to 1.5.0.

View File

@@ -0,0 +1,3 @@
---
trivial:
- CI - Refactor AZP to address new test infrastructure (https://github.com/ansible-collections/news-for-maintainers/issues/17).

View File

@@ -0,0 +1,3 @@
---
bugfixes:
- firewall - Fixed to output a more complete missing library message.

View File

@@ -0,0 +1,3 @@
---
trivial:
- CI - AZP test container to 3.0.0 (https://github.com/ansible-collections/news-for-maintainers/issues/18).

View File

@@ -0,0 +1,3 @@
---
bugfixes:
- Removed contentious terminology to match reference documentation in profile_tasks.

View File

@@ -0,0 +1,3 @@
---
trivial:
- CI - following the new CI testing rule ansible-test-sanity-docker-devel.

View File

@@ -1,6 +1,6 @@
namespace: ansible namespace: ansible
name: posix name: posix
version: 1.4.0 version: 1.5.0
readme: README.md readme: README.md
authors: authors:
- Ansible (github.com/ansible) - Ansible (github.com/ansible)

View File

@@ -102,8 +102,8 @@ class CallbackModule(CallbackBase):
self._display.display(tasktime()) self._display.display(tasktime())
def playbook_on_stats(self, stats): def playbook_on_stats(self, stats):
self._display.display(tasktime()) # Align summary report header with other callback plugin summary
self._display.display(filled("", fchar="=")) self._display.banner("ROLE RECAP")
timestamp(self) timestamp(self)
total_time = sum(self.totals.values()) total_time = sum(self.totals.values())
@@ -116,3 +116,4 @@ class CallbackModule(CallbackBase):
msg_total = u"{0:-<70}{1:->9}".format(u'total ', u' {0:.02f}s'.format(total_time)) msg_total = u"{0:-<70}{1:->9}".format(u'total ', u' {0:.02f}s'.format(total_time))
self._display.display(filled("", fchar="~")) self._display.display(filled("", fchar="~"))
self._display.display(msg_total) self._display.display(msg_total)

View File

@@ -21,7 +21,7 @@ DOCUMENTATION = '''
- It also lists the top/bottom time consuming tasks in the summary (configurable) - It also lists the top/bottom time consuming tasks in the summary (configurable)
- Before 2.4 only the environment variables were available for configuration. - Before 2.4 only the environment variables were available for configuration.
requirements: requirements:
- whitelisting in configuration - see examples section below for details. - enable in configuration - see examples section below for details.
options: options:
output_limit: output_limit:
description: Number of tasks to display in the summary description: Number of tasks to display in the summary
@@ -46,7 +46,7 @@ EXAMPLES = '''
example: > example: >
To enable, add this to your ansible.cfg file in the defaults block To enable, add this to your ansible.cfg file in the defaults block
[defaults] [defaults]
callback_whitelist = ansible.posix.profile_tasks callbacks_enabled=ansible.posix.profile_tasks
sample output: > sample output: >
# #
# TASK: [ensure messaging security group exists] ******************************** # TASK: [ensure messaging security group exists] ********************************
@@ -174,8 +174,8 @@ class CallbackModule(CallbackBase):
self._display.display(tasktime()) self._display.display(tasktime())
def playbook_on_stats(self, stats): def playbook_on_stats(self, stats):
self._display.display(tasktime()) # Align summary report header with other callback plugin summary
self._display.display(filled("", fchar="=")) self._display.banner("TASKS RECAP")
timestamp(self) timestamp(self)
self.current = None self.current = None
@@ -199,3 +199,4 @@ class CallbackModule(CallbackBase):
if 'path' in result: if 'path' in result:
msg += u"\n{0:-<{1}}".format(result['path'] + u' ', self._display.columns) msg += u"\n{0:-<{1}}".format(result['path'] + u' ', self._display.columns)
self._display.display(msg) self._display.display(msg)

View File

@@ -46,4 +46,6 @@ class CallbackModule(CallbackBase):
def v2_playbook_on_stats(self, stats): def v2_playbook_on_stats(self, stats):
end_time = datetime.utcnow() end_time = datetime.utcnow()
runtime = end_time - self.start_time runtime = end_time - self.start_time
self._display.display("Playbook run took %s days, %s hours, %s minutes, %s seconds" % (self.days_hours_minutes_seconds(runtime))) # Align summary report header with other callback plugin summary
self._display.banner("PLAYBOOK RECAP")
self._display.display("Playbook run took %s days, %s hours, %s minutes, %s seconds\n\r" % (self.days_hours_minutes_seconds(runtime)))

View File

@@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
from ansible_collections.ansible.posix.plugins.module_utils.version import LooseVersion from ansible_collections.ansible.posix.plugins.module_utils.version import LooseVersion
from ansible.module_utils.basic import missing_required_lib
__metaclass__ = type __metaclass__ = type
@@ -314,6 +315,5 @@ class FirewallTransaction(object):
if import_failure: if import_failure:
module.fail_json( module.fail_json(
msg='Python Module not found: firewalld and its python module are required for this module, \ msg=missing_required_lib('firewall') + '. Version 0.2.11 or newer required (0.3.9 or newer for offline operations)'
version 0.2.11 or newer required (0.3.9 or newer for offline operations)'
) )

View File

@@ -347,6 +347,8 @@ def keyfile(module, user, write=False, path=None, manage_dir=True, follow=False)
basedir = os.path.dirname(keysfile) basedir = os.path.dirname(keysfile)
if not os.path.exists(basedir): if not os.path.exists(basedir):
os.makedirs(basedir) os.makedirs(basedir)
f = None
try: try:
f = open(keysfile, "w") # touches file so we can set ownership and perms f = open(keysfile, "w") # touches file so we can set ownership and perms
finally: finally:

View File

@@ -226,7 +226,7 @@ def _escape_fstab(v):
if isinstance(v, int): if isinstance(v, int):
return v return v
else: else:
return( return (
v. v.
replace('\\', '\\134'). replace('\\', '\\134').
replace(' ', '\\040'). replace(' ', '\\040').

View File

@@ -1,5 +1,14 @@
# ------------------------------------------------------------- # -------------------------------------------------------------
# Setup steps # Setup steps
- name: Clean up the working directory and files
file:
path: '{{ output_dir }}'
state: absent
- name: Create the working directory
file:
path: '{{ output_dir }}'
state: directory
- name: copy an existing file in place with comments - name: copy an existing file in place with comments
copy: copy:

View File

@@ -74,7 +74,14 @@ else
fi fi
# START: HACK install dependencies # START: HACK install dependencies
retry ansible-galaxy collection install community.general if [ "${ansible_version}" == "2.9" ] || [ "${ansible_version}" == "2.10" ]; then
# Note: Since community.general 5.x, Ansible Core versions prior to 2.11 are not supported.
# So we need to use 4.8.1 for Ansible 2.9 and Ansible Engine 2.10.
retry git clone --depth=1 --single-branch -b 4.8.1 https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/general"
else
retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.general.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/general"
fi
# Note: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
# END: HACK # END: HACK
export PYTHONIOENCODING='utf-8' export PYTHONIOENCODING='utf-8'