Commit graph

244 commits

Author SHA1 Message Date
Hideki Saito
bd9aa64a2b
Merge branch 'main' into ephemeral_state 2022-12-15 15:04:28 +09:00
softwarefactory-project-zuul[bot]
6b7dc6ee0a
Merge pull request #166 from dkjii-g/main
ansible.posix.mount: add absent_from_fstab option

SUMMARY
Add absent_from_fstab option to remove the entry from fstab, but not unmount or delete the folder. Ideally this would have been the behavior of absent (as to mirror the behavior of present), but for backward compatibility I added a new verbose state
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
mount
ADDITIONAL INFORMATION
Sometimes you may not want to delete the mountpoint (e.g. if it is not currently mounted and data is in the directory, the current behavior will simply error).

Reviewed-by: Amin Vakil <None>
Reviewed-by: None <None>
2022-12-15 03:00:24 +00:00
softwarefactory-project-zuul[bot]
a831f22b83
Merge pull request #391 from juanvalino/main
Fixes #390. Hosts involved must have same password

SUMMARY
Fixes #390
The change takes the password from destination hostvars ansible_ssh_pass or ansible_password when dest is remote.
In other case, previous behavior is maintained and password is taken form task vars ansible_ssh_pass or ansible_password.
Also, both user and password are templated to allow jinja expressions in them.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.synchronize
ADDITIONAL INFORMATION
n/a

Reviewed-by: Adam Miller <admiller@redhat.com>
2022-12-15 02:21:06 +00:00
Vladislav Sharapov
c4742cfa81 Add changelog fragment 2022-12-14 20:44:50 +04:00
Gregory Furlong
cc93ee8232 Add a changelog fragment in preparation for the pull request. 2022-12-14 11:14:35 -05:00
Gregory Furlong
9575b9be64 Add changelog fragment documenting PR #402 2022-12-13 18:02:56 -05:00
Gregory Furlong
bf0ad4aad2 Document pr #401 as a changelog fragment. 2022-12-13 12:46:39 -05:00
Adam Miller
7df358d74f add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-21 12:26:48 -06:00
Adam Miller
a3b8fdbf25 add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2022-11-08 16:23:08 -06:00
Juan Antonio Valino Garcia
4512e7b1e9 add changelog fragment 2022-10-07 18:10:45 +02:00
Hideki Saito
6c9616291e Add stable-2.14 branch to AZP
* Fixes #388

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-09-27 21:15:50 +09: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
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
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
NdFeB
04089e80fb Add ephemeral state to mount fs without altering fstab 2022-06-03 08:46:21 +02: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
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
Hideki Saito
ab3bf45c6c Release 1.4.0 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-05-23 16:37:36 +09:00
Felix Fontein
2ee9cc533a Add PSF-license.txt file. 2022-05-16 07:27:10 +02:00
Hideki Saito
c520b68276 Added check_mode attr to synchronize plugin test
* Added check_mode attribute to TaskMock class in the unit test for
  synchronize plugin
* Fixes #352

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-04-22 14:07:37 +09:00
Hideki Saito
0e71c0e530 Fixed documentation and options to address new sanity tests
- https://docs.ansible.com/ansible/latest/dev_guide/testing_validate-modules.html

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-04-01 13:23:45 +09:00
Hideki Saito
def5d2bae0 Add testing against ansible-core 2.13
- Relates to ansible-collections/news-for-maintainers#14

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-03-31 13:38:37 +09:00
Hideki Saito
373250a0ce Copy ignore-2.13.txt to ignore-2.14.txt
- Relates to ansible-collections/news-for-maintainers#13

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-03-31 12:13:36 +09:00
NdFeB
fa4dd35d66 Add changelog fragment for PR 333 2022-03-12 15:37:13 +01:00
ansible-zuul[bot]
3acced944b
Merge pull request #304 from saito-hideki/issue/303
Replace distutils with included module in ansible-core 2.12 to address PEP 632

SUMMARY
Replace distutils.* with included module in ansible-core 2.12 to addresss PEP 632 if available.
It does not change the behavior of ansible-core 2.11 or earlier.

Fixes #303
Addresses PEP 632(https://www.python.org/dev/peps/pep-0632/)

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

plugins/module_utils/firewalld.py


plugins/modules/firewalld_info.py



ADDITIONAL INFORMATION
None

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: None <None>
2022-01-07 07:52:48 +00:00
Abhijeet Kasurde
44a23e363b
Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-06 20:50:07 +05:30
Hideki Saito
a45448bb26 Replace distutils with included module in ansible-core 2.12
- Fixes #303
- Addresses PEP 632(https://www.python.org/dev/peps/pep-0632/)

Signed-off-by: Hideki Saito <saito@fgrep.org>
2022-01-06 13:53:36 +05:30
Luca Berton
43ead73934 Add RHEL8 library python3-libsemanage
In modern systems (RHEL8+) with python3 default the library requirement is `python3-libsemanage`.
Updated `libsemanage-python` to `python3-libsemanage`.
2021-12-23 23:57:15 +01:00
Hideki Saito
cd04f5a092 Fix exit code in CI entrypoint to address shellckeck issue
- Fixes #301

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-12-20 08:40:36 +09:00
Hideki Saito
667ebef95c Refine the handling of exclusive options using mutually_exclusive
- Fixes #255

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-29 18:46:28 +09:00
ansible-zuul[bot]
90385b97d8
Merge pull request #288 from nerrehmit/main
Remove deprecated option from nfs mount example

SUMMARY
This removes the intr option from the documentation example for nfs mounts.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
mount.py
ADDITIONAL INFORMATION
According to the nfs manpage the intr/ nointr option has been deprecated with Kernel 2.6.25 which was released in April 2008 wiki
Even RHEL 6.10 which is already on Extended life cycle support is using a newer 2.6 Kernel. https://access.redhat.com/articles/3078
This does not change any module functionality. It simply removes the option from the nfs mount example.

Reviewed-by: None <None>
2021-11-12 18:28:25 +00:00
Tim Herren
a42d7f0420 added changelog fragment for documentation change 2021-11-11 21:38:24 +01:00
Hideki Saito
2768c58f90 Add python-firewall to requirements of firewalld
- Fixes #286

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-11-07 10:20:12 +09:00
ansible-zuul[bot]
e366b90f39
Merge pull request #278 from asnaedae/hotfix/escape_whitespace_in_paths
Whitespace in fully  path to playbook causes rsync to fail

Any whitespace in path to playbook directory causes rsync to incorrectly chdir fail to correctly run.
SUMMARY
Any whitespace in path to playbook directory causes rsync to incorrectly chdir fail to correctly run.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ansible.posix.synchronize
ADDITIONAL INFORMATION


Example :
cd "/home/a/ansible plays"

task:
  - synchronize:
      src: a
      dest: b

Results in the following error being thrown
fatal: [remote-host]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' /home/a/ansible plays/deployments// remote-user@remote-host:/b/", "msg": "rsync: [sender] link_stat \"/home/a/ansible\" failed: No such file or directory (2)\nrsync: [sender] change_dir \"/home/a/ansible plays/plays/a/\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]\n", "rc": 23}

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-11-03 04:47:48 +00:00
Mike Wallis
d1be5519e6 Whitespaces in paths or current working directory path of playbook causes rsync to incorrectly chdir to current source dir,
Example :

cd "/home/a/ansible plays"

task:
  - synchronize:
      src: a
      dest: b

Results in the following error being thrown

fatal: [remote-host]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --rsync-path='sudo -u root rsync' --out-format='<<CHANGED>>%i %n%L' /home/a/ansible plays/deployments// remote-user@remote-host:/data/", "msg": "rsync: [sender] link_stat \"/home/a/ansible\" failed: No such file or directory (2)\nrsync: [sender] change_dir \"/home/a/ansible plays/plays/a/\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]\n", "rc": 23}
2021-10-25 19:44:43 +01:00
Hideki Saito
399f5e2f09 Fix unit test for synchronize action plugin
- use yaml.safe_load() instead of load()

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-10-21 08:18:17 +09:00
Hideki Saito
8f58cbb41c Fix integration test error on ansible devel branch
- Remove centos6 platforms for integration tests on
  the ansible devel branch from the azure-pipelines.
- Add delegate_to to each task of integration test for
  synchronized module on devel branch
- Modify invalid parameter test to use key instead of name
  for sysctl module
- Replace lookup plugin to slurp module in integration tests
  for selinux module
- Add creating working directory task in integration tests
  for acl module

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-10-04 17:10:20 +09:00
Andrew Klychkov
6ca7a7c0a4 Add fragment 2021-09-28 13:09:10 +02:00
Hideki Saito
5a2b3662cb mount - add a newline at the end of line in fstab
* Fixes #210

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-27 12:19:06 +09:00
ansible-zuul[bot]
595ee76b69
Merge pull request #142 from WOnder93/selinux-disable-kernel
selinux: update kernel boot params when disabling/re-enabling SELinux

SUMMARY
The ability to disable SELinux from userspace based on the configuration
file is being deprecated in favor of the selinux=0 kernel boot
parameter. (Note that this affects only the "full" disable; switching
to/from permissive mode will work the same as before.)
Therefore, enhance the selinux module to try to set/unset the kernel
command-line parameter using grubby when enabling/disabling SELinux.
If the grubby package is not present on the system, the module will only
update the config file and report a warning. Note that even with the
runtime disable functionality removed, setting SELINUX=disabled in the
config file will lead to a system with no SELinux policy loaded, which
will behave in a very similar way as if SELinux was fully disabled, only
there could still be some minor performance impact, since the kernel
hooks will still be active.
More information:
https://lore.kernel.org/selinux/157836784986.560897.13893922675143903084.stgit@chester/
https://fedoraproject.org/wiki/Changes/Remove_Support_For_SELinux_Runtime_Disable
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
selinux module

Reviewed-by: Adam Miller <maxamillion@fedoraproject.org>
Reviewed-by: Ondrej Mosnáček <omosnacek@gmail.com>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: quidame <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-09-24 12:20:44 +00:00
ansible-zuul[bot]
96c342fd67
Merge pull request #263 from saito-hideki/issue/83
profile_tasks - Correctly calculate task execution time with serial execution

SUMMARY
Correctly calculate task execution time with serial execution

Fixes #83

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.profile_tasks

ADDITIONAL INFORMATION
After applying this PR, I can confirm that the task execution time with serial execution is correct:

Test playbook:

---
- hosts: issue_83
  gather_facts: false
  connection: local
  serial: 1

  tasks:
    - name: TASK_A
      shell: sleep 3
    - name: TASK_B
      shell: sleep 5
    - name: TASK_C
      shell: sleep 1

Results:

$ ansible-playbook -i inventory playbook/profile_tasks/issue_83.yml 
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing names 
to new standard, use callback_enabled instead. This feature will be removed 
from ansible-core in version 2.15. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:40:58 +0900 (0:00:00.008)       0:00:00.008 ****** 
changed: [server100]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:02 +0900 (0:00:03.210)       0:00:03.219 ****** 
changed: [server100]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:07 +0900 (0:00:05.173)       0:00:08.392 ****** 
changed: [server100]

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:41:08 +0900 (0:00:01.146)       0:00:09.539 ****** 
changed: [server101]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:11 +0900 (0:00:03.185)       0:00:12.724 ****** 
changed: [server101]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:16 +0900 (0:00:05.148)       0:00:17.873 ****** 
changed: [server101]

PLAY [issue_83] ****************************************************************

TASK [TASK_A] ******************************************************************
Friday 10 September 2021  12:41:17 +0900 (0:00:01.176)       0:00:19.050 ****** 
changed: [server102]

TASK [TASK_B] ******************************************************************
Friday 10 September 2021  12:41:21 +0900 (0:00:03.174)       0:00:22.224 ****** 
changed: [server102]

TASK [TASK_C] ******************************************************************
Friday 10 September 2021  12:41:26 +0900 (0:00:05.190)       0:00:27.415 ****** 
changed: [server102]

PLAY RECAP *********************************************************************
server100                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
server101                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
server102                  : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Friday 10 September 2021  12:41:27 +0900 (0:00:01.173)       0:00:28.588 ****** 
=============================================================================== 
TASK_B ----------------------------------------------------------------- 15.51s
TASK_A ------------------------------------------------------------------ 9.57s
TASK_C ------------------------------------------------------------------ 3.50s

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-09-21 01:07:49 +00:00
Ondrej Mosnacek
53d47e1763 selinux: update kernel boot params when disabling/re-enabling SELinux
The ability to disable SELinux from userspace based on the configuration
file is being deprecated in favor of the selinux=0 kernel boot
parameter. (Note that this affects only the "full" disable; switching
to/from permissive mode will work the same as before.)

Therefore, add an 'update_kernel_param' module parameter that will cause
it to set/unset the kernel command-line parameter using grubby when
enabling/disabling SELinux. (An explicit parameter was chosen for
backwards compatibility.)

More information:
https://lore.kernel.org/selinux/157836784986.560897.13893922675143903084.stgit@chester/
https://fedoraproject.org/wiki/Changes/Remove_Support_For_SELinux_Runtime_Disable

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-09-20 10:09:54 +05:30
Hideki Saito
3d57a17ed6 Correctly calculate task execution time with serial execution
- Fixes #83

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-10 13:21:37 +09:00
Abhijeet Kasurde
dc8f7d68df
Update changelogs 2021-09-08 11:39:17 +05:30
Simon Legner
1626c3d5e6 docs(authorized_key): add lookup.url example 2021-09-08 08:00:56 +02:00
Hideki Saito
4a67de7b08 Display warning message if wrong parameter set to masquerade or icmp-block-inversion
* This PR is a part of #249

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-09-06 09:14:34 +09:00
ansible-zuul[bot]
7f16f56c5b
Merge pull request #248 from Akasurde/i247
firewalld: Correct usage of queryForwardPort

SUMMARY

Correct queryForwardPort API usage
Enable port_foward_test_cases tests

Fixes: #247
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/firewalld.py
tests/integration/targets/firewalld/tasks/run_all_tests.yml

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-08-18 09:14:19 +00:00
Abhijeet Kasurde
249e64a64d sanity fixes for pylint test
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-16 16:04:29 +05:30
Abhijeet Kasurde
12941f6d9a firewalld: Correct usage of queryForwardPort
* Correct queryForwardPort API usage
* Enable port_foward_test_cases tests

Fixes: #247

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-16 14:12:22 +05:30
Hideki Saito
fad1d3a870 Release 1.3.0 commit
Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-11 15:51:13 +09:00
ansible-zuul[bot]
c21fb99f54
Merge pull request #244 from Akasurde/trivial
fix changelog entry

SUMMARY
Changed from bugfixes to trivial
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
changelogs/fragments/firewalld_integ_test.yml

Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-11 05:57:26 +00:00
Abhijeet Kasurde
a65807edc3
synchronize: Use SSH args from SSH connection plugins (#223)
SSH configuration migrated from Ansible configuration to
SSH connection configuration. Make ``synchronize`` understand
this.

Fixes: #222

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-11 10:45:52 +05:30
Abhijeet Kasurde
dad5379461 fix changelog entry
Changed from `bugfixes` to `trivial`

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-10 17:58:27 +05:30
ansible-zuul[bot]
bd594970a8
Merge pull request #243 from Akasurde/test
Fix integration test fedora 34 with firewalld

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/firewalld.py

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: None <None>
2021-08-10 12:22:33 +00:00
Abhijeet Kasurde
c244abd82f Fix integration test fedora 34 with firewalld
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-10 15:17:24 +05:30
ansible-zuul[bot]
42d2b9c65a
Merge pull request #233 from piotrtrojanowski-dev/patch-2
Fix requires firewalld version in comments for permanent parameter.

SUMMARY
Version of firewalled seems to be wrong. 3.0.9 version of that package does not exist.
The latest release of firewalled: https://github.com/firewalld/firewalld/releases
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
ansible.posix.firewalld

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Andrew Klychkov <aaklychkov@mail.ru>
Reviewed-by: None <None>
2021-08-10 06:42:37 +00:00
ansible-zuul[bot]
7a62e01af6
Merge pull request #241 from xlab-steampunk/shell-quoting
Properly quote Synchronize

SUMMARY
The synchronize action plugin and module were a bit sloppy when it came to the command-line parameter quoting and that caused failure on some systems (for example, on Fedora 34).
This commit makes sure any arguments with potentially problematic characters are quoted before being used.
Fixes #242
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
synchronize

Reviewed-by: Sergey <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
2021-08-09 13:08:23 +00:00
Hideki Saito
944f5416c9 Added changelog fragment file to PR #233
Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-08-07 13:28:08 +09:00
mandar242
244c9b2066 sysctl: Fix integration test virtualization type 2021-08-04 21:52:50 +05:30
Tadej Borovšak
db12a40a4c Synchronize: properly quote shell command components
The synchronize action plugin and module were a bit sloppy when it
came to the command-line parameter quoting and that caused failuer on
some systems (for example, on Fedora 34).

This commit makes sure any argumnts with potentially problematic
characters are quoted before being used.
2021-08-04 13:37:18 +02:00
ansible-zuul[bot]
5282ece77e
Merge pull request #230 from sshnaidm/podmanfix2
Complete adding podman connection to synchronize

SUMMARY


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

synchronize
ADDITIONAL INFORMATION





Continue of #229
For fixing ansible-community/molecule-podman#45

Reviewed-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
Reviewed-by: Tadej Borovšak <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Sergey <None>
Reviewed-by: None <None>
2021-08-04 11:32:28 +00:00
Sagi Shnaidman
133ffe51fb Complete adding podman connection to synchronize 2021-08-03 15:44:00 +03:00
ansible-zuul[bot]
b3e395a4a3
Merge pull request #239 from Akasurde/firewalld_test
Enable firewalld tests

SUMMARY
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/integration/targets/firewalld/aliases
tests/integration/targets/setup_pkg_mgr/tasks/main.yml

Reviewed-by: Adam Miller <maxamillion@fedoraproject.org>
Reviewed-by: None <None>
2021-08-02 22:36:00 +00:00
Abhijeet Kasurde
424004c4c0 Enable firewalld tests
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-08-02 20:26:42 +05:30
Sergey
ab5c1d9911
Update changelogs/fragments/229_add_podman_connection_plugin_to_synchronize.yml
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-07-23 14:56:34 +03:00
Sagi Shnaidman
4be66cfb34 Add changelog fragment 2021-07-23 14:44:26 +03:00
ansible-zuul[bot]
a03e652437
Merge pull request #214 from saito-hideki/pr/add_firewalld_info
Add new firewalld_info module to ansible.posix collection

SUMMARY
Add new firewalld_info module to ansible.posix collection.

Gathering information about firewalld zone settings
fixes #98

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

ansible.posix.firewalld_info

ADDITIONAL INFORMATION
None

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-21 05:19:13 +00:00
ansible-zuul[bot]
e815909859
Merge pull request #215 from quasd/main
fix REJECT target name

SUMMARY
Fix setting default target to reject. The target name is %%REJECT%% not REJECT.
https://firewalld.org/documentation/zone/options.html
After this pull request to way to set REJECT would be
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: '%%REJECT%%'
      state: enabled
    become: true


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
firewalld
ADDITIONAL INFORMATION



This snippet would fail due to there not being target called REJECT and using %%REJECT%% is not in allowed values for target
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: 'REJECT'
      state: enabled
    become: true

Ansible error
{
    "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_TARGET: REJECT Permanent operation",
    "invocation": {
        "module_args": {
            "zone": "public",
            "permanent": true,
            "target": "REJECT",
            "state": "enabled",
            "immediate": false,
            "timeout": 0,
            "icmp_block": null,
            "icmp_block_inversion": null,
            "service": null,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "source": null,
            "interface": null,
            "masquerade": null,
            "offline": null
        }
    },
    "_ansible_no_log": false,
    "changed": false
}

syslog
Jun 29 09:49:39 <hostname retracted> ansible-ansible.posix.firewalld[9015]: Invoked with zone=public permanent=True state=enabled target=REJECT immediate=False timeout=0 icmp_[1850/7279] icmp_block_inversion=None service=None port=None port_forward=None rich_rule=None source=None interface=None masquerade=None offline=None                                                                 
Jun 29 09:49:39 <hostname retracted>  firewalld[915]: ERROR: INVALID_TARGET: REJECT

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
Reviewed-by: Amin Vakil <info@aminvakil.com>
Reviewed-by: quidame <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-14 17:05:30 +00:00
ansible-zuul[bot]
f2601b01da
Merge pull request #213 from ndgit/fix-24-and-190
synchronize: quotes around arguments

fix quoting for specific cmd arguments
Fixes:

#24
#190

ISSUE TYPE:

Bugfix Pull Request

COMPONENT NAME:
module: synchronize

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Robert Rettig <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: Mike Graves <mgraves@redhat.com>
2021-07-14 15:20:20 +00:00
Hideki Saito
27434455e5 Add new firewalld_info module to ansible.posix collection
* fixes #98

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-07-09 23:47:12 +09:00
ansible-zuul[bot]
f6fa00bfff
Merge pull request #187 from smemsh/fix-synchronize-become-user
synchronize: fix to honor become_user when become_method sudo

SUMMARY

When become_method is sudo, the synchronize module ignores become_user, always running as root.  This means one cannot create files as a target user, when they need to get in via a third user and can only sudo via that one.  In my case, I'm connecting via a special provisioning user that has sudo privs, but I need to create the files as the become_user.  I'm using it to deposit skeleton files, and there should be no reason to run another task with chown; after all, the documentation already describes the desired behavior:

The user and permissions for the synchronize dest are those of the remote_user on the destination host or the become_user if become=yes is active.

This patch takes the running become_user (if it's not None) and adds it to the sudo command with the -u command line option, so the file gets created correctly.  I have tested this and it works.
Other become_methods are ignored, but they already were anyways (the code already has a TODO to add other methods, which we don't attempt in this patch)
Fixes #186

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

synchronize
ADDITIONAL INFORMATION


See reproduction in #186.
This appears to have been in place since ansible/ansible@811a906

Reviewed-by: Amin Vakil <info@aminvakil.com>
Reviewed-by: Sumit Jaiswal <sjaiswal@redhat.com>
2021-07-08 14:16:12 +00:00
ansible-zuul[bot]
68263bfc29
Merge pull request #217 from saito-hideki/pr/restructure_test_for_authorized_key
Restructure integration tests for authorized_key module

SUMMARY
Split the large tasks/main.yml in integration tests to each function block and use import_tasks to import for them.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME

tests/integration/targets/authorized_key/

ADDITIONAL INFORMATION

None
2021-07-08 12:27:01 +00:00
Hideki Saito
69d17ed4b7 Restructure integration tests for authorized_key module
* Split tasks/main.yml in integration tests to each function block.

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-07-02 16:27:02 +09:00
Abhijeet Kasurde
c596feab78
Review comments
Co-authored-by: quidame <quidame@poivron.org>
2021-07-01 10:36:33 +05:30
Mandar Kulkarni
b740bdaf3a Merge https://github.com/ansible-collections/ansible.posix into issues/126/mount-return-backup-file 2021-06-30 04:11:28 -04:00
quasd
fcb2a466e0 add fragment 2021-06-29 11:31:04 +03:00
Robert Rettig
9f384c00a3 add changelog fragment 2021-06-24 23:58:28 +02:00
ansible-zuul[bot]
a994a58b23
Merge pull request #203 from saito-hideki/issue/28_bsd
Modify boot option handling on BSD systems

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-16 11:30:20 +00:00
ansible-zuul[bot]
23afcce8b8
Merge pull request #207 from Andersson007/mount_tests
mount integration tests: make them more human readable

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-11 15:16:12 +00:00
ansible-zuul[bot]
e2a316122a
Merge pull request #199 from Akasurde/i179
firewalld: Ensure idempotency

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-11 11:35:12 +00:00
Andrew Klychkov
1671173e99 Add changelog fragment 2021-06-11 11:40:55 +02:00
ansible-zuul[bot]
e068522325
Merge pull request #205 from Akasurde/i204
csh: Define ``ECHO`` and ``COMMAND_SEP``

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-09 17:28:12 +00:00
Abhijeet Kasurde
51d117285f csh: Define `ECHO and COMMAND_SEP`
Fixes: #204

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-09 17:46:09 +05:30
Hideki Saito
c29bbd265b Modify boot option handling on BSD systems
* Fixes #28 for BSD systems
* Porting PR #196 to BSD systems

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-06-08 20:44:42 +09:00
ansible-zuul[bot]
7417d857f1
Merge pull request #202 from Akasurde/i124
acl: Add new alias

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-07 07:57:33 +00:00
ansible-zuul[bot]
ceddb849b8
Merge pull request #201 from Akasurde/i175
synchronize: fix misc typo

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-04 15:49:36 +00:00
ansible-zuul[bot]
f5666924ab
Merge pull request #200 from Akasurde/i193
firewalld: Specify unit for timeout

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-04 13:36:59 +00:00
Abhijeet Kasurde
7d928e6e9d synchronize: fix misc typo
Docs should read ``--delete-after`` instead of ``--delete-excluded``.

Fixes: #175

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-04 18:38:01 +05:30
Abhijeet Kasurde
07fe3a91b6 firewalld: Ensure idempotency
Use APIs like ``query*`` instead of ``get*``.

Fixes: #179

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-04 16:55:19 +05:30
Abhijeet Kasurde
5cebc90623 firewalld: Specify unit for timeout
Timeout parameter takes value which is specified in seconds.

Fixes: #193

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-04 16:53:37 +05:30
Abhijeet Kasurde
6ba8445fb1 acl: Add new alias
Added new alias ``recurse`` for parameter ``recursive``.

Fixes: #124

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-04 16:51:15 +05:30
ansible-zuul[bot]
9d4ae8b7e4
Merge pull request #196 from saito-hideki/issue/28
Modify boot option handling on Linux systems

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-04 06:23:07 +00:00
Adam Miller
41e5b8428f mount return backup_file
Fixes https://github.com/ansible-collections/ansible.posix/issues/126

Signed-off-by: Adam Miller <admiller@redhat.com>
2021-06-04 10:52:38 +05:30
ansible-zuul[bot]
1793cd70c4
Merge pull request #172 from saito-hideki/issue/169
Append line-separator to the end of command line

Reviewed-by: https://github.com/apps/ansible-zuul
2021-06-03 12:02:30 +00:00
Abhijeet Kasurde
5d0c5ae3a6 synchronize: correct typo
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-02 12:58:56 +05:30
Hideki Saito
cfff8a3806 Modify boot option handling on Linux systems
* Address the issue #28
* Modified behavior to set noauto option if boot is 'no' on Linux system
* Modified integration test to use filesize module instead of dd

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-06-01 14:21:01 +09:00
ansible-zuul[bot]
7e6adc977f
Merge pull request #167 from aminvakil/rsync_hardcoded_options
synchronize: add delay_updates option

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-31 12:44:36 +00:00
ansible-zuul[bot]
5d0c8e40d8
Merge pull request #185 from saito-hideki/issue/184
[mount] Fix boot option handling on Solaris correctly

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-27 08:20:32 +00:00
ansible-zuul[bot]
eaf3d666cc
Merge pull request #189 from Akasurde/i134
authorized_key: Add support for additional key types

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-27 06:24:03 +00:00
Abhijeet Kasurde
c985096af5 authorized_key: Add support for additional key types
Fixes: #134

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-25 10:06:01 +05:30
ansible-zuul[bot]
92c6037900
Merge pull request #159 from quidame/fix/ansible_ssh_user
Fix ansible_ssh_user

Reviewed-by: https://github.com/apps/ansible-zuul
2021-05-24 15:22:50 +00:00
Hideki Saito
0bef7bb164 Fix boot option handling on Solaris correctly
* Fixes #184

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-05-13 15:12:50 +09:00
Scott Mcdermott
6e60b0d454 Add changelog fragment for synchronize become_user fix 2021-05-12 14:04:19 -07:00
quidame
052a2f6d94
Update changelogs/fragments/159-fix-60-deprecated-ansible_ssh_user.yml
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-09 02:01:20 +02:00
Hideki Saito
13e77fd7da Append line-separator to the end of command line
* Addresses issue #169 (https://github.com/ansible-collections/ansible.posix/issues/169)

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-05-05 09:35:39 +09:00
Andrew Klychkov
9173166223 Add fragment 2021-04-30 08:05:00 +02:00
ansible-zuul[bot]
8ae6651cff
Merge pull request #168 from Andersson007/add_211
Add 2.11 branch to test matrix, add ignore-2.12.txt

Reviewed-by: https://github.com/apps/ansible-zuul
2021-04-16 06:03:04 +00:00
Andrew Klychkov
86b32d8730 Add 2.11 branch to test matrix, add ignore-2.12.txt 2021-04-14 07:46:03 +02:00
Hideki Saito
8b1b4df54f Add ignore file for sanity test for 2.12
* Add ignore file to cover sanity test for the current devel version 2.12

Signed-off-by: Hideki Saito <saito@fgrep.org>
2021-04-12 23:01:30 +09:00
Amin Vakil
fc9fce718d
Add changelog 2021-04-03 16:24:53 +04:30
dkjii-g
553b0ea4f7
Update changelogs/fragments/166_mount_absent_fstab.yml
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-04-02 21:00:51 -04:00
dkjii
20e294e026 add changelog 2021-04-02 12:33:58 -04:00
quidame
d976add5da replace no more supported 'ansible_ssh_*' option names by the new ones
* Replace 'ansible_ssh_user' by 'ansible_user' everywhere.
* Replace 'ansible_ssh_port' by 'ansible_port' everywhere.
* Replace 'ansible_ssh_host' by 'ansible_host' everywhere.
2021-03-28 13:50:49 +02:00
quidame
c8b58875d9 add no_log=False to clear false-positives
Related modules: authorized_key, mount.
2021-03-19 09:07:14 +01:00
Andrew Klychkov
edec4d767d Release 1.2.0 commit 2021-03-08 13:45:10 +01:00
Andrew Klychkov
f3b6b5e690 fix a fragment 2021-03-08 10:54:51 +01:00
Andrew Klychkov
d65a36e9ea Add missed changelog fragments 2021-03-08 10:02:48 +01:00
Tadej Borovšak
98c86c54cd Inform synchronize module about community.docker collection
The synchronize action plugin has a built-in list of connection
plugins that it knows how to handle.

One of those connection plugins is the docker connection plugin. And
because the docker content has been moved around quite a lot, the
docker connection plugin has quite a few names:

 - docker in Ansible 2.9,
 - community.general.docker for community.general < 2.0.0, and
 - community.docker.docker since a few months ago.

And while the synchronize module already knew about the first two
names, the last one was still missing. This commit fixes that omission
and adds a third name into the mix.
2021-03-05 16:42:43 +01:00
Abhijeet Kasurde
ea8fc70373 Fix sanity test for modules
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-03-02 18:53:06 +05:30
Andrew Klychkov
2655a6ffc1 remove changelogs/fragments/.empty 2021-03-02 11:47:07 +01:00
Adam Miller
34a12eb3f9 firewalld: add zone target set (#526)
* firewalld: add zone target set

Fixes https://github.com/ansible/ansible/issues/49232

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix sanity tests, add example of zone target setting

Signed-off-by: Adam Miller <admiller@redhat.com>

* test different zone/target combination as we're not hitting default settings

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix enabled values for zone operations

Signed-off-by: Adam Miller <admiller@redhat.com>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-16 12:14:10 +01:00
Adam Miller
1268d4aa0a add changelog fragment for PR#101
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-10-23 15:08:26 -05:00
ansible-zuul[bot]
d1fff45191
Merge pull request #82 from bmv126/synchronize_private_key_issue
Fix for private_key overriding in synchronize module

Reviewed-by: Adam Miller <admiller@redhat.com>
             https://github.com/maxamillion
2020-09-18 05:24:11 +00:00
vishwas
4b0b50439d Fix for private_key overriding in synchronize module 2020-09-04 04:16:43 -04:00
jillr
e5e36d3c7b Prepare 1.1.1 release
Run add_docs.py
Run antsibull-changelog; backfill for prior releases
Bump release in galaxy.yml
Add .keep to changelogs/fragments so directory is not deleted if
`keep_fragments` is ever set to False.
2020-09-02 20:55:04 +00:00
Adam Miller
c390183337 fix skippy callback deprecation warning
Fixes https://github.com/ansible-collections/ansible.posix/issues/62

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-08-21 16:24:35 -05:00
Chris Church
53bb7312e4
Add changelog entry for #74. 2020-07-27 12:41:16 -04:00
Adam Miller
04441336fc add changelog fragment
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-07-15 22:57:38 -05:00
Adam Miller
711e5fefdd make sanity tests happy
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 17:14:38 -05:00
Adam Miller
492d5e3d05 use FQCN for module call in action plugins
Fixes https://github.com/ansible-collections/ansible.posix/issues/11

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 15:22:34 -05:00
ansible-zuul[bot]
e02e9d17d2
Merge pull request #57 from maxamillion/changelogs/fix-23-selinux-file-extension
fix 23-selinux-doesnt-create-missing-config-keys file extension

Reviewed-by: https://github.com/apps/ansible-zuul
2020-06-19 17:46:42 +00:00
ansible-zuul[bot]
916b96b4d9
Merge pull request #55 from maxamillion/issues/37/authorized_key-check_mode-inconsistent-return
authorized_keys - consistent behavior in check_mode

Reviewed-by: https://github.com/apps/ansible-zuul
2020-06-19 17:44:02 +00:00
Adam Miller
89118af1f3 fix 23-selinux-doesnt-create-missing-config-keys file extension
Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 10:48:29 -05:00
Adam Miller
86a5950efa authorized_keys - consistent behavior in check_mode
Previously check_mode would incorrectly return changed=False even when a
change would have taken place if ran without check_mode, with
integration tests that confirmed this incorrect behavior. Also the
module did not correctly populate the return values when run in
check_mode. Both of these issues are resolved in this PR.

Fixes https://github.com/ansible-collections/ansible.posix/issues/37

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 09:18:52 -05:00
Adam Miller
01d06f6be3 mount - fix module_util pathing issue for ansible 2.9
In Ansible 2.9 (pre 2.10 routing), the AnsiballZ creation of the payload
will add an extra directory to the module_util path because ismount.py
shares the same name as it's parent dir which creates an inconsistency
in the payload creation. This causes the Collection module
ansible.posix.mount to work in Ansible 2.10 but not 2.9, with this pull
request a simple renaming of the module_util which side steps this
inconsistency.

Fixes https://github.com/ansible-collections/ansible.posix/issues/21

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-19 09:18:32 -05:00
ansible-zuul[bot]
0d0f8217cf
Merge pull request #8 from sivel/ansible/pull/65973
Fix json callback for non-lockstep strategy plugins such as free

Reviewed-by: https://github.com/apps/ansible-zuul
2020-06-19 06:48:42 +00:00
ansible-zuul[bot]
691d4c77da
Merge pull request #30 from fbettag/patch-1
Updates authorized_key.py to be used with FIDO2 security keys.

Reviewed-by: https://github.com/apps/ansible-zuul
2020-06-19 06:20:43 +00:00
Franz Bettag
00f97908d7 Updates authorized_key.py with all current ssh key types 2020-06-19 07:09:28 +05:30
Adam Miller
cb54073f65 selinux - add missing config keys when needed
Previously the selinux module would only edit the state of found
configuration keys SELINUX and SELINUXTYPE in /etc/selinux/config but
would not add them with desired state if they were not found.

Fixes #23

https://github.com/ansible-collections/ansible.posix/issues/23

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-06-18 17:28:59 -05:00
Abhijeet Kasurde
5760726dd4 Update changelog generation configuration
* Added missing changelog entries
* Updated configuration for changelog generation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-06-17 15:57:15 +05:30
Matt Martz
23d3703a84 Fix json callback for non-lockstep strategy plugins such as free. Fixes #65931 2020-03-24 11:23:39 -05:00