179 Commits
Author SHA1 Message Date
Luca MarsellaandGitHub 4daa61d294 synchronize: fix changed status with link_dest (#812)
* synchronize: fix changed status with link_dest

With link_dest the module runs rsync with -vv, which also itemizes
unchanged files as '.f' followed by spaces. Any such line made the
module report no change, even when other files in the same run were
transferred, deleted or had their permissions updated.

Treat a line as unchanged only when it starts with a period and has no
attribute changes, which is how rsync lists files it did not touch.

Signed-off-by: Luca Marsella <marsluca7@gmail.com>
Assisted-by: Claude Opus 5.5

* synchronize: don't make link_dest test files world-readable

SonarCloud flags the new test tasks for granting access to others.
The test does not need it, so use 0750 and 0640 instead.

Signed-off-by: Luca Marsella <marsluca7@gmail.com>

* synchronize: read rsync markers only at the start of a line

The link_dest check split the whole output on the marker, so a file
name that contains the marker made a no-op sync report a change.

Signed-off-by: Luca Marsella <marsluca7@gmail.com>

---------

Signed-off-by: Luca Marsella <marsluca7@gmail.com>
2026-11-16 16:16:54 +09:00
dddd6c9b35 firewalld_info: fail cleanly when D-Bus is unavailable (#805)
python-firewall wraps a missing D-Bus socket in FirewallError, which the module did not catch, so Ansible reported a module crash instead of a normal failure.

Fixes #678


Assisted-by: Grok 4.7

Signed-off-by: Nikhil Jain <nikhjain@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-19 17:05:46 +09:00
Michael SprottandGitHub 20699d7184 mount: Create a state like absent but keeps the mountpoint (#774)
* Create a new state, with an example and integration test

* Now that I have my PR, add in my changelog

* Fix linter issues

* Another attempt at getting the sanity tests to pass

* Fix FreeBSD integration test

* Try to get sonarcloud code analysis happy

* Change state option name
2026-08-31 12:51:24 +09:00
Abhijeet KasurdeandGitHub 035d4ad0a3 mount: restore fstab file if umount fails (#742)
* mount: restore fstab file if umount fails

* Refactored code

Fixes: #605

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

* Make CI green

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-08-26 10:39:24 +09:00
Hideki SaitoandGitHub 18f2f69c53 Fixes the symlink handling issue in the authorized_key module (#760)
- Addresses CVE-2026-11837
- Fixes #759

Signed-off-by: Hideki Saito <saito@fgrep.org>
2026-06-30 08:45:30 +09:00
Abhijeet KasurdeandGitHub f265682c99 sysctl: Doc update (#745)
* Make documentation more generic

Fixes: #411

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-27 08:42:16 +09:00
Abhijeet KasurdeandGitHub af933670cc authorized_key: Use loop instead of with_file in example (#740)
Fixes: #607

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-24 16:22:50 +09:00
Vladimir BotkaandGitHub 3c232a2429 In FreeBSD, fail if loader.conf shall be reloaded. (#664)
Fix #663
2026-05-20 08:43:23 -07:00
9cd0a1f0ef docs: added attributes metadata for check_mode support (fixes #643) (#741)
Co-authored-by: jkhall81 <jason.kei.hall@gmail.com>
2026-05-21 00:24:37 +09:00
Abhijeet KasurdeandGitHub dbeb4a861d firewalld_info: Use PY2 compatible syntax (#719)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-15 12:07:12 -07:00
Abhijeet KasurdeandGitHub 7cbef04377 Removed ANSIBLE_METADATA from remaining plugins (#717)
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-14 07:28:14 +09:00
Abhijeet KasurdeandGitHub d88a3c833c firewalld_info: Use module.warn (#715)
* Use module.warn to display warnings instead of module.exit_json

Fixes: #710

Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
2026-05-11 17:47:10 -07:00
SilejonuandAbhijeet Kasurde afa6471b73 refactor(acl): improve execution speed 2026-05-07 09:55:28 -04:00
SilejonuandAbhijeet Kasurde 871b4daeeb fix(acl): correctly assert needed changes when recursive is true 2026-05-07 09:55:28 -04:00
Pavel BarandCursor AI 17dd3b2e01 Fix deprecated imports in plugins/modules/sysctl.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.string_types -> basestring/str (Python 2/3 compatible)

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 35bcea6ec9 Fix deprecated imports in plugins/modules/seboolean.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 065af18c26 Fix deprecated imports in plugins/modules/rpm_ostree_upgrade.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI a2fa110036 Fix deprecated imports in plugins/modules/rhel_rpm_ostree.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 935a644f3c Fix deprecated imports in plugins/modules/patch.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 37e46324f5 Fix deprecated imports in plugins/modules/firewalld_info.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 1aa2f974e9 Fix deprecated imports in plugins/modules/authorized_key.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.moves.urllib.parse -> urllib.parse

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 7c9c261faf Fix deprecated imports in plugins/modules/acl.py
Replace deprecated module_utils import:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI f31b7a380b Fix deprecated imports in plugins/modules/mount.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.iteritems -> dict.items()

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Pavel BarandCursor AI 1f0844bf98 Fix deprecated imports in plugins/modules/synchronize.py
Replace deprecated module_utils imports:
- ansible.module_utils._text -> ansible.module_utils.common.text.converters
- ansible.module_utils.six.moves.shlex_quote -> shlex.quote

Fixes #686

Co-authored-by: Cursor AI
Signed-off-by: Pavel Bar <pbar@redhat.com>
2026-05-06 18:58:14 +03:00
Klaas Demter 413ab782a8 Fixes #462 notice permission denied on authorized_key module 2025-10-21 10:00:12 +02:00
Felix Fontein ab8dfefd90 Use module.warn() instead of returning warnings. 2025-08-06 06:49:32 +02:00
Pavel KnoblokhandGitHub 1b8aeb03cb sysctl: Add custom sysctl file example (#606) 2025-03-26 19:21:08 -07:00
softwarefactory-project-zuul[bot]andGitHub f632fad9d4 Merge pull request #598 from saito-hideki/issue/586
[Breaking Change] [firewalld] Change type of icmp_block_inversion option from str to bool

SUMMARY
Changed the type of icmp_block_inversion option from str to bool

Fixes #586

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ansible.posix.firewalld

ADDITIONAL INFORMATION
Related  #582 and #584

Reviewed-by: Adam Miller <admiller@redhat.com>
Reviewed-by: Andrew Klychkov <aklychko@redhat.com>
2024-12-02 23:50:26 +00:00
Hideki Saito 6175a5028b Change type of icmp_block_inversion option from str to bool
* Fixes #586

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-11-28 14:19:20 +09:00
Vladimir Botka 8e34860d6c Fix #595. Remove comment from fstab entry on updating. 2024-11-21 20:54:27 +01:00
Hideki Saito 8b611775d6 Changed the type of forward and masquerade options from str to bool
* Breaking Change
* Fixes #582

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-10-31 16:06:10 +09:00
copyrightsandHideki Saito 2041e7f918 mount: remove boot exception if defaults in opts 2024-10-04 14:39:04 +09:00
softwarefactory-project-zuul[bot]andGitHub 0821768bcb Merge pull request #568 from abakanovskii/feature/add_path_option_authorized_key
authorized_key: Allow local path to a key

SUMMARY

Add option to specify an absolute path to file with SSH key(s) for authorized_key

ISSUE TYPE

Feature Pull Request

COMPONENT NAME

authorized_key

ADDITIONAL INFORMATION


Before this change you would need to get key using ansible.builtin.slurp or something like ansible.builtin.command: cat <file> with register
I tried to keep it as simple as possible

# Now this is possible
- name: Set authorized keys taken from path
  ansible.posix.authorized_key:
    user: charlie
    state: present
    key: /home/charlie/.ssh/id_rsa.pub

Reviewed-by: Hideki Saito <saito@fgrep.org>
Reviewed-by: alexander
2024-09-30 07:07:25 +00:00
Александр Бакановский 5f3f8514eb Allow remote path for authorized_key 2024-09-30 09:40:03 +03:00
Hideki Saito c353e43a90 Fixed to set ACLs on paths mounted with NFSv4 correctly
* Fixed #240

Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-09-20 10:10:15 +09:00
Hideki Saito e05b8507a4 Remove wrong version_added section from mount module
Signed-off-by: Hideki Saito <saito@fgrep.org>
2024-09-13 15:15:04 +09:00
softwarefactory-project-zuul[bot]andGitHub d968ac441e Merge pull request #563 from dtvillafana/main
(feat) add no_log option for 'opts' parameter

SUMMARY

Allows you to set no_log on just the opts parameter.
This is useful for CIFS/SMB mounts that would otherwise leak secrets.

Adds feature from issue: . #497
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

mount

Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-09-11 02:27:00 +00:00
dvillafanaandHideki Saito e00a4299c1 (feat) add no_log options for 'opts' parameter
* Fixed #497
2024-09-11 11:04:16 +09:00
softwarefactory-project-zuul[bot]andGitHub 52d140895b Merge pull request #548 from gfokkema/main
Firewalld: Add functionality to set forwarding

SUMMARY

Adds firewalld functionality to do the equivalent of firewall-cmd --add-forwarding --zone={zone}.
Functionality is exactly analogous to the firewall-cmd --add-masquerade --zone={zone} already present.
Fixes #529

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

firewalld
ADDITIONAL INFORMATION


Usage:

- ansible.posix.firewalld:
    forward: true
    state: enabled
    permanent: true
    zone: internal

Reviewed-by: Abhijeet Kasurde
Reviewed-by: Hideki Saito <saito@fgrep.org>
2024-09-09 08:11:26 +00:00
Gerlof FokkemaandHideki Saito 257392f33d Firewalld: Add functionality to set forwarding. Fixes #529. 2024-09-09 15:13:12 +09:00
ef07eb8a06 Apply suggestions from code review
Thanks felixfontein for the thorough review. :-)

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-06-15 17:00:54 +12:00
Alexei Znamensky 0c9ab06a55 review modules docs 2024-06-15 17:00:54 +12:00
satken2andJill Rouleau a88f5f8ae0 sysctl: Fixed sysctl to work on symlinks(#111) 2024-05-07 16:53:57 -07:00
SergeyandHideki Saito 60c8d23c7f Docs/authorized_key: clarify that the path key should probably NOT be set 2024-04-02 17:08:28 +09:00
Adam MillerandGitHub a18d180246 Merge branch 'main' into fix/doc/mount_absent_description 2024-02-06 09:29:55 -06:00
Petr LautrbachandGitHub 0a07bdb358 seboolean: make it work with disabled SELinux (#496)
Sometimes it's necessary to configure SELinux before it's enabled on the
system. There's `ignore_selinux_state` which should allow it. Before
this change `seboolean` module failed on SELinux disabled system even
with `ignore_selinux_state: true` and SELinux policy installed while
`semanage boolean` worked as expected:

    $ ansible -i 192.168.121.153, -m seboolean -a "name=ssh_sysadm_login state=on ignore_selinux_state=true" all
    192.168.121.153 | FAILED! => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "msg": "Failed to get list of boolean names"
    }

    $ ssh root@192.168.121.153 semanage boolean -l | grep ssh_sysadm_login
    ssh_sysadm_login               (off  ,  off)  Allow ssh to sysadm login

It's caused by `selinux.security_get_boolean_names()` and
`selinux.security_get_boolean_active(name)` which required SELinux
enabled system.

This change adds a fallback to semanage API which works in SELinux
disabled system when SELinux targeted policy is installed:

    ANSIBLE_LIBRARY=plugins/modules ansible -i 192.168.121.153, -m seboolean -a "name=ssh_sysadm_login state=on persistent=true ignore_selinux_state=true" all
    192.168.121.153 | CHANGED => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "name": "ssh_sysadm_login",
        "persistent": true,
        "state": true
    }

    $ ssh root@192.168.121.153 semanage boolean -l | grep ssh_sysadm_login
    ssh_sysadm_login               (on   ,   on)  Allow ssh to sysadm login

Note that without `persistent=true` this module is effectively NO-OP now.

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
2024-02-06 09:21:27 -06:00
MichaelandGitHub 0847977d12 Warn only when zones were ignored in firewalld_info (#504)
* warn only when zones were ignored

* add changelog 504-firewalld_info-warning
2024-01-09 16:07:58 -06:00
Christer WarénandGitHub 2a1fb334ee mount: edit boot parameters warning condition (#523)
the CI failures are unrelated and shouldn't even be showing up ... I'm going to sort that out separately but that doesn't need to prevent this merge, all relevant CI tests passed
2024-01-09 16:06:26 -06:00
softwarefactory-project-zuul[bot]andGitHub 2c52f969e1 Merge pull request #484 from flowerysong/firewalld_offline
firewalld: make offline do something

SUMMARY

ansible.posix.firewalld has an offline flag, but it currently does not do anything. What most people expect it to do is allow the task to proceed even when firewalld is offline, so it makes the most sense for it to override the immediate flag and prevent the module from throwing an error in that case.
Fixes #81.
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

firewalld
ADDITIONAL INFORMATION

Reviewed-by: Adam Miller <admiller@redhat.com>
2023-12-07 21:18:29 +00:00
Adam Miller a85f736f6a refactor to comply with current ansible-lint and sanity guidelines
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-12-06 17:22:59 -06:00