1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00
Commit graph

2362 commits

Author SHA1 Message Date
Alexei Znamensky
ebf45260ce
remove conditional code for old snakes (#11048)
* remove conditional code for old snakes

* remove conditional code for old snakes

* reformat

* add changelog frag
2025-11-08 17:21:46 +01:00
Felix Fontein
3478863ef0
Address issues reported by ruff check (#11043)
* Resolve E713 and E714 (not in/is tests).

* Address UP018 (unnecessary str call).

* UP045 requires Python 3.10+.

* Address UP007 (X | Y for type annotations).

* Address UP035 (import Callable from collections.abc).

* Address UP006 (t.Dict -> dict).

* Address UP009 (UTF-8 encoding comment).

* Address UP034 (extraneous parantheses).

* Address SIM910 (dict.get() with None default).

* Address F401 (unused import).

* Address UP020 (use builtin open).

* Address B009 and B010 (getattr/setattr with constant name).

* Address SIM300 (Yoda conditions).

* UP029 isn't in use anyway.

* Address FLY002 (static join).

* Address B034 (re.sub positional args).

* Address B020 (loop variable overrides input).

* Address B017 (assert raise Exception).

* Address SIM211 (if expression with false/true).

* Address SIM113 (enumerate for loop).

* Address UP036 (sys.version_info checks).

* Remove unnecessary UP039.

* Address SIM201 (not ==).

* Address SIM212 (if expr with twisted arms).

* Add changelog fragment.

* Reformat.
2025-11-08 17:05:21 +13:00
jnaab
f5943201b9
filesystem: xfs resize: minimal required increment (#11033)
Internally XFS uses allocation groups. Allocation groups have a maximum
size of 1 TiB - 1 block. For devices >= 4 TiB XFS uses max size
allocation groups. If a filesystem is extended and the last allocation
group is already at max size, a new allocation group is added. An
allocation group seems to require at least 64 4 KiB blocks.

For devices with integer TiB size (>4), this creates a filesystem that
has initially has 1 unused block per TiB size. The `resize` option
detects this unused space, and tries to resize the filesystem.  The
xfs_growfs call is successful (exit 0), but does not increase the file
system size. This is detected as repeated change in the task.

Test case:
```
- hosts: localhost
  tasks:
    - ansible.builtin.command:
        cmd: truncate -s 4T /media/xfs.img
        creates: /media/xfs.img
      notify: loopdev xfs

    - ansible.builtin.meta: flush_handlers

    - name: pickup xfs.img resize
      ansible.builtin.command:
        cmd: losetup -c /dev/loop0
      changed_when: false

    - community.general.filesystem:
        dev: "/dev/loop0"
        fstype: "xfs"

    - ansible.posix.mount:
        src: "/dev/loop0"
        fstype: "xfs"
        path: "/media/xfs"
        state: "mounted"

    # always shows a diff even for newly created filesystems
    - community.general.filesystem:
        dev: "/dev/loop0"
        fstype: "xfs"
        resizefs: true

  handlers:
    - name: loopdev xfs
      ansible.builtin.command:
        cmd: losetup /dev/loop0 /media/xfs.img
```

NB: If the last allocation group is not yet at max size, the filesystem
can be resized. Detecting this requires considering the XFS topology.
Other filesystems (at least ext4) also seem to require a minimum
increment after the initial device size, but seem to use the entire
device after initial creation.

Fun observation: creating a 64(+) TiB filesystem leaves a 64(+) block
gap at the end, that is allocated in a subsequent xfs_growfs call.

Co-authored-by: Johannes Naab <johannes.naab@hetzner-cloud.de>
2025-11-07 21:27:50 +01:00
Alexei Znamensky
c984b89667
docs style adjustments (#11037)
docs adjustments
2025-11-07 10:29:44 +13:00
Alexei Znamensky
3c42ec730d
remove extraneous whitespaces (#11029)
* remove extraneous whitespaces

* ruff format

* add changelog frag
2025-11-05 22:27:33 +01:00
mirabilos
f5203aa135
kea_command: new module to access an ISC KEA server (#10709)
kea_command: new module to access an ISC KEA server

This module can be used to access the JSON API of a
KEA DHCP4, DHCP6, DDNS or other services in a generic
way, without having to manually format the JSON, with
response error code checking.

It directly accesses the Unix Domain Socket API so it
needs to execute on the system the server is running,
with superuser privilegues, but without the hassle of
wrapping it into HTTPS and password auth (or client
certificates).

The integration test uses a predefined setup for
convenience, which runs on Debian trixie as well as,
on the CI, Ubuntu noble. It makes assumptions about
the default package configuration and paths and is
therefore tricky to run on other distros/OSes. This
only affects running the KEA server as part of the
tests, not the module.
2025-11-03 17:58:49 +01:00
A
e8c482d78e
Keycloak_realm: Add admin permissions enabled bool (#11002)
* Keycloak_realm: add admin permissions enabled bool

* Update plugins/modules/keycloak_realm.py

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

* Update plugins/modules/keycloak_realm.py

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

* Add Keycloak-add-admin-permissions fragment

* Update changelogs/fragments/11002-keycloak-add-admin-permissions-enabled.yaml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-03 06:12:27 +01:00
Pär Karlsson
6635bd7742
Add "changed_deps" to portage parameters (#11023)
* Add option for '--changed-deps'

* Add changelog fragment

* Re-add the changed_deps option

* Include link to PR

* Rename fragment properly, and include PR number in name

* Add version string and improve doc description

* Update changelogs/fragments/11023-portage_changed_deps.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Refine documentation string further

* Reformat with ruff

* Add a correct changely fragment

* Update plugins/modules/portage.py

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

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-11-03 06:12:09 +01:00
Alexei Znamensky
b28ac655fc
xfconf: fix existing empty array case (#11026)
* xfconf: fix existing empty array case

* fix xfconf_info as well

* add changelog frag
2025-11-02 20:20:31 +01:00
Felix Fontein
340ff8586d Reformat everything. 2025-11-01 13:46:53 +01:00
Felix Fontein
3f2213791a
Cleanup: use f-strings instead of str.format() (#11017)
Address UP032: use f-strings instead of str.format().
2025-11-01 12:04:33 +01:00
Marius Bertram
5d5392786c
Add Keycloak module to send execute-actions email to users (#10950)
* Add Keycloak module to send execute-actions email to users

Signed-off-by: Marius Bertram <marius@brtrm.de>

* Fix Example Typo

Signed-off-by: Marius Bertram <marius@brtrm.de>

* Break if argument_speck() is broken

Signed-off-by: Marius Bertram <marius@brtrm.de>

* Adjust to new tests in main.

* Remove unnecessary version_added.

---------

Signed-off-by: Marius Bertram <marius@brtrm.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-30 20:55:31 +01:00
mirabilos
eb6337c0c9
omapi_host: fix bytes vs. str confusion (#11001)
* omapi_host: fix bytes vs. str confusion

After an update of the control node from Debian
bookworm to trixie, the omapi_host module fails to
work with the error message:

Key of type 'bytes' is not JSON serializable by the
'module_legacy_m2c' profile.

https://github.com/ansible/ansible/issues/85937 had the
same error, but the fix is a bit more intricate here
because the result dict is dynamically generated from
an API response object.

This also fixes unpacking the MAC and IP address and
hardware type, which were broken for Python3.

* Merge suggestion for changelog fragment

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

* do not unpack_ip twice

Noticed by Felix Fontein <felix@fontein.de>

* mention py3k in changelog fragment, too

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-30 20:19:06 +01:00
Felix Fontein
74c2c804e5
Cleanup: use super() instead of super(__class__, self) (#11016)
* Address UP008: Use super() instead of super(__class__, self).

* Linting.
2025-10-30 20:17:26 +01:00
Felix Fontein
0c5466de47
Cleanup: remove unicode prefix, remove explicit inheritance from object (#11015)
* Address UP025: remove unicode literals from strings.

* Address UP004: class inherits from 'object'.
2025-10-30 20:17:10 +01:00
Felix Fontein
6088b0cff5
CI: add type checking (#10997)
* Set up type checking with mypy.

* Make mypy pass.

* Use list() instead of sorted().
2025-10-29 17:13:38 +00:00
David Jenkins
e84f59a62d
fix(pritunl_user): improve resilience to null or missing user parameters (#10955)
* fix(pritunl_user): improve resilience to null or missing user parameters

* added changelog fragment - 10955

* standardize 10955 changelog fragment content

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

* simplify user params comparison

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

* simplify list fetch

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

* simplify remote value retrieval

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

---------

Co-authored-by: djenkins <djenkins@twosix.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-29 17:45:29 +01:00
Alexei Znamensky
7e8e8948a3
npm: improve parameter validation (#10983)
* npm: improve parameter validation

* add changelog frag

* add required_if clause

* fix required_if, add required_one_of, add docs

* Update plugins/modules/npm.py

* Update plugins/modules/npm.py

* Update plugins/modules/npm.py

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

* Update plugins/modules/npm.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-29 17:42:51 +01:00
Felix Fontein
54af64ad36
keycloak_user: mark credentials[].value as no_log=True (#11005)
Mark credentials[].value as no_log=True.
2025-10-29 17:42:29 +01:00
nbragin4
af8c4fb95e
terraform: Fix bug when None values aren't processed correctly (#10961)
* terraform: Fix bug when None values aren't processed correctly

Just found that i can't pass null values as complex variables into terraform using this module, while i can do that with terraform itself. Fixed undesired behavior.

* chore: changelog fragment 10961-terraform-complexvars-null-bugfix.yaml

* Update changelogs/fragments/10961-terraform-complexvars-null-bugfix.yaml

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

* Update plugins/modules/terraform.py

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

* Update plugins/modules/terraform.py

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

* Fix condition to check for None type in terraform.py

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-28 20:41:04 +01:00
Alexei Znamensky
c889a4cb6d
deprecate oneandone modules (#10994)
* deprecate oneandone modules

* add mod util to runtime.yml

* add changelog frag

* change deprecation version to 13.0.0

* change deprecation version to 13.0.0 in readme.yml as well

* Update changelogs/fragments/10994-oneandone-deprecation.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-29 08:13:55 +13:00
Alexei Znamensky
6829a064a5
dimensiondata: deprecation (#10986)
* dimensiondata: deprecation

* add changelog frag

* typo

* Update changelogs/fragments/10986-deprecation-dimensiondata.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-28 10:50:56 +13:00
Alexei Znamensky
adcc683da7
modules [t-z]*: use f-strings (#10978)
* modules [t-z]*: use f-strings

* add changelog frag

* remove extraneous file
2025-10-26 22:36:03 +13:00
Alexei Znamensky
af246f8de3
modules s[f-z]*: use f-strings (#10977)
* modules s[f-z]*: use f-strings

* add changelog frag
2025-10-26 22:35:30 +13:00
Alexei Znamensky
73452acf84
modules s[a-e]*: use f-strings (#10976)
* modules s[a-e]*: use f-strings

* add changelog frag
2025-10-26 22:34:24 +13:00
Alexei Znamensky
cf663c6e95
dnf_versionlock: docs and comments for Python < 3.6 (#10984) 2025-10-26 21:23:58 +13:00
Alexei Znamensky
39291d3c60
keyring & keyring_info: import shlex directly (#10981)
* keyring & keyring_info: import shlex directly

* add changelog frag
2025-10-26 08:02:03 +01:00
Alexei Znamensky
fa662c0f1a
mqtt: remove code for unsupported Python versions (#10980)
* mqtt: remove code for unsupported Python versions

* add changelog frag
2025-10-26 08:01:52 +01:00
Alexei Znamensky
b527e80307
modules [lm]*: use f-strings (#10971)
* modules [lm]*: use f-strings

* add changelog frag
2025-10-26 07:57:24 +01:00
Alexei Znamensky
4a6a449fbd
modules [jk]*: use f-strings (#10970)
* modules [jk]*: use f-strings

* add changelog frag

* Apply suggestions from code review

* typing insanity
2025-10-26 07:54:15 +01:00
Alexei Znamensky
8120e9347e
modules p*: use f-strings (#10974)
* modules p*: use f-strings

* add changelog frag
2025-10-26 07:48:51 +01:00
Alexei Znamensky
d51e4c188b
modules r*: use f-strings (#10975)
* modules r*: use f-strings

* add changelog frag

* Apply suggestions from code review
2025-10-26 07:48:33 +01:00
Alexei Znamensky
749c06cd01
modules [no]*: use f-strings (#10973)
* modules [no]*: use f-strings

* add changelog frag
2025-10-26 07:48:10 +01:00
Alexei Znamensky
50846b7560
modules i[^p]*: use f-strings (#10969)
* remove extraneous to_native()

* add changelog frag

* Apply suggestions from code review
2025-10-25 13:41:49 +02:00
Alexei Znamensky
0b6e99b28b
modules ip*: use f-strings (#10968)
* modules ip*: use f-strings

* add changelog frag
2025-10-25 02:54:37 +02:00
Alexei Znamensky
0ef2235929
modules bc*: use f-strings (#10945)
* modules bc*: use f-strings

* no quotes or backticks inside f-strs

* add changelog frag

* rename chglof frag file

* rename chglof frag file

* copr: re-applied change maintain original logic
2025-10-25 01:45:40 +02:00
Alexei Znamensky
f9b4abf930
modules h*: use f-strings (#10959)
* modules h*: use f-strings

* add changelog frag
2025-10-25 00:59:12 +02:00
Alexei Znamensky
b67e7c83cf
modules g*: use f-strings (#10958)
* modules g*: use f-strings

* add changelog frag

* remove extraneous to_native()
2025-10-25 00:54:38 +02:00
Alexei Znamensky
a3987c9844
modules def*: use f-strings (#10947)
* modules def*: use f-strings

* remove !s from f-strings

* add changelog frag
2025-10-23 22:12:10 +02:00
Stanislav Shamilov
258e65f5fc
keycloak_user_rolemapping: docs fixes and examples about mapping realm roles in keycloak_user_rolemapping (#10953)
* Fix docs and add examples about mapping realm roles for keycloak_user_rolemapping.py module (#7149)

* fix sanity tests
2025-10-23 21:25:26 +02:00
Alexei Znamensky
4c7be8f268
cloudflare_dns: rollback validation for CAA records (#10956)
* cloudflare_dns: rollback validation for CAA records

* add changelog frag
2025-10-23 06:52:34 +02:00
Alexei Znamensky
d86340b9d3
modules a*: use f-strings (#10942)
* modules a*: use f-strings

* add changelog frag

* add changelog frag

* rename chglof frag file
2025-10-23 06:50:32 +02:00
Christer Warén
66578d0b2c
ipa_host: add userclass and locality parameters (#10935)
* ipa_host: add userclass and locality parameters

* Changelog Fragment - 10935

* Update plugins/modules/ipa_host.py

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

* Update plugins/modules/ipa_host.py

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

* Update plugins/modules/ipa_host.py

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

* Update changelogs/fragments/10935-ipa-host-add-parameters.yml

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-22 23:14:55 +02:00
Alexei Znamensky
7572b46c7b
filesystem: docs adjustments (#10948) 2025-10-21 06:25:43 +02:00
Marius Bertram
c850e209ab
Add support for client auth in Keycloak cllient secrets module (#10933)
* keycloak: add client authentication support for client_secret

Signed-off-by: Marius Bertram <marius@brtrm.de>

* readd ['token', 'auth_realm']

Signed-off-by: Marius Bertram <marius@brtrm.de>

---------

Signed-off-by: Marius Bertram <marius@brtrm.de>
2025-10-19 21:12:41 +02:00
carlfriedrich
7e666a9c31
fix(modules/gitlab_runner): Fix exception in check mode on new runners (#10918)
* fix(modules/gitlab_runner): Fix exception in check mode on new runners

When a new runner is added in check mode, the role used to throw an
exception. Fix this by returning a valid runner object instead of a
boolean.

Fixes #8854

* docs: Add changelog fragment
2025-10-19 08:54:21 +02:00
Alexei Znamensky
2bd44584d3
cloudflare_dns: rollback validation for SRV records (#10937)
* cloudflare_dns: rollback validation for SRV records

* add changelog frag
2025-10-18 09:43:46 +02:00
Alexei Znamensky
3b83df3f79
modules: update code to python3 (#10904)
* modules: update code to python3

* pamd: rollback changes

* add changelog frag

* fix/improve assignments using generators

* Update plugins/modules/launchd.py

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

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-10-13 21:42:48 +02:00
Alexei Znamensky
056633efaa
launchd: remove conditional code for Python < 3.4 (#10909)
* launchd: remove conditional code for Python < 3.4

* add changelog frag
2025-10-12 08:56:05 +02:00
Alexei Znamensky
ce544f370c
archive: lzma is standard in Python 3.7+ (#10908)
* archive: lzma is standard in Python 3.7+

* add changelog frag
2025-10-11 13:42:01 +02:00