Commit Graph

4197 Commits (1b8bfd40abfaba139b9ffc76601551ec7720e1a5)

Author SHA1 Message Date
Sloane Hertel ff5deaf62f
fix module_defaults group incorrectly giving deprecation warnings (#83510)
don't display deprecation warnings for actions/modules as a result of using an action_group containing a deprecated plugin
4 months ago
Abhijeet Kasurde d23a2de5f2
Remove selinux import (#83674)
Remove selinux import which was kept for backward compatibility

Fixes: #83657

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Felix Fontein 3d4bd79574
validate-modules: detect names set mismatch between argument spec and documentation (#83599) 4 months ago
Lee Garrett 7e3916b767
Typo fixes and other bits and bobs (#83672)
Co-authored-by: Lee Garrett <lgarrett@rocketjump.eu>
4 months ago
Abhijeet Kasurde 8e74cdc7b2
Set LANGUAGE env variable is set to a non-English locale (#83671)
Fixes: #83608

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Jordan Borean a3a92bcc13
Remove explicit shell environment docs (#83649)
Removes the docs for the environment keyword in the shell base plugins
as they are a no-op in the plugins themselves. The environment value is
provided by the action base which gets it from the action base on the
task.environment value. This should avoid confusion around how its being
set and removes some code that is not used at all.
4 months ago
Abhijeet Kasurde fe1183f8ac
Replace random with secrets (#83668)
Use secrets library instead of random.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Abhijeet Kasurde 504f5b1230
apt: Report change when package is removed (#83547)
While upgrade process removes a package, module should
report changed=True instead of changed=False

Fixes: #46314

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Sloane Hertel 33565f3774
increase timeout downloading galaxy role URLs (#83562)
* Update the timeout to download role archive to 60 seconds to match collections
TODO: in future make a configurable 'artifact download timeout'
4 months ago
Abhijeet Kasurde cd105d479a
display: warn user about empty log path value (#83381)
Fixes: #79959

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Matt Clay 79f819dc54
ansible-test - Remove VyOS tests and support files (#83650)
The VyOS remote image required for running the tests is no longer functional.
4 months ago
Alexei Znamensky d36dc70afc
remove ignore clauses for module find (#83575)
add testcase for expanding home dir names
4 months ago
Peter A. Bigot c904bffc7d
debconf: handle boolean value representation consistently (#83601)
* lift code that normalizes value type for boolean vtype to cover both
  branches of conditional.
* remove obsolete and incomplete conversion of type in set_selection.

Fixes: #83594
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
4 months ago
Matt Clay 906c969b55
ansible-test - Improve unknown env error message (#83610) 4 months ago
Brian Coca 0eeb933238
module compression is now again settable via var (#83573)
Previous change overlooked 'uncommenting' the variable entry as a way to update this  to keep the functionality.


Co-authored-by: Glandos <bugs-github@antipoul.fr>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
rebtoor 7cf7dff3a6
Ensure that we are handling DownloadError properly in the dnf module (#83543)
Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
4 months ago
Matt Clay 9cdfcd9aed
ansible-test - Update nios-test-container to 4.0.0 (#83539) 5 months ago
Dhanesh R 9472005dee
update distro version to 1.9.0 (#83540) 5 months ago
flowerysong 4f6a4534a7
known_hosts: don't modify `AnsibleModule.params` (#83517)
Using this dictionary to store the return values results in
the return values showing up in the returned
`invocation['module_args']`, which is confusing. It also causes all
module arguments to be returned, which is preserved by this change but
should ideally be removed in the future.
5 months ago
Jan Christian Grünhage 83a0975611
Add dinit as a service_mgr (#83489) 5 months ago
Harshvardhan Sharma 43346f1fdc
Add SL-Micro to Suse family list (#83541) 5 months ago
MajesticMagikarpKing edce798713
Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
5 months ago
Felix Fontein e5309ba29f
validate-modules: reject option/alias names equal up to casing belonging to different options (#83530)
* Reject option/alias names equal up to casing belonging to different options.

* Update test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
5 months ago
flowerysong 63538f7779
package_facts: fix warning logic (#83520)
* package_facts: fix warning logic

* Refactor so that warnings can work
5 months ago
Martin Krizek 775bc1110e
linear: fix included handlers executing in lockstep (#83209)
Fixes #83019
5 months ago
Martin Krizek 571e2a9551
Fix incorrect rc when executing end_host in rescue (#83522)
Fixes #83447
5 months ago
Brian Coca 6c0f4c8a2d
hostvars templating fix, override serialization (#83509)
fixes #82872
nicer implementation courtesy of nitzmahone
5 months ago
Brian Coca 00ddc27d69
actually show plugin config warnings/deprecations (#82593)
previouslly we recorded but did not show to avoid spam
since we could not dedup from forks, that was already
fixed in another PR so now we can show/display them.

Also:
  * funcitonalize deprecation msg construct from docs
  * reuse formatting func in cli
  * normalize alternatives: most of the code used intended plural
    but some and most data/tests used the singular
  * update schemas and tests

Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
5 months ago
Martin Krizek a8e4106c47
Fix tb for when env var contains % (#83499)
Fixes #83498

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
5 months ago
Martin Krizek 665d2e15d7
dnf: remove legacy code (#83298) 5 months ago
Benoît Knecht 41ba6536cf
facts/hardware: Fix support_discard block device fact (#83480)
Previously, `support_discard` simply returned the value of
`/sys/block/{device}/queue/discard_granularity`. When its value is `0`, then
the block device doesn't support discards; _however_, it being greater than
zero doesn't necessarily mean that the block device _does_ support discards.

But another indication that a block device doesn't support discards is
`/sys/block/{device}/queue/discard_max_hw_bytes` being equal to `0` (with the
same caveat as above). So if either of those are `0`, set `support_discard` to
zero, otherwise set it to the value of `discard_granularity` for backwards
compatibility.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
5 months ago
Martin Krizek 2930a4664c
dnf - arches must be the same in the is_newer_installed check (#83417)
Fixes #83406
5 months ago
Martin Krizek 0ee6e39615
dnf, dnf5: fix installing via wildcard (#83481)
Fixes #83373
5 months ago
Matt Clay 8f1fddb161
Enable Ubuntu 24.04 group 6 in CI (#83466)
* Enable Ubuntu 24.04 group 6 in CI

* Disable rootfull Podman on Ubuntu

* Disable unix-chkpwd AppArmor profile on Ubuntu for Fedora 40 tests

* Document AppArmor and rootfull issues
5 months ago
Brian Coca 0d28705ce5
linear strategy, show templated task name on start (#83473)
we only templated in some cases but when queueing we could get an untemplated name for the 'on start' event.
5 months ago
Brian Coca 339452c105
Ensure the correct connection name is shown in results (#83354) 5 months ago
Matt Clay a121a169e3
ansible-test - Replace FreeBSD 14.0 with 14.1 (#83477) 5 months ago
Abhijeet Kasurde c93af4e148
unarchive: handle content and size differences (#83454)
Consider content differs and size differs while unarchiving
the same tar.gz file

Fixes: #29610

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Danilo Bargen c2c6005842
get_url: Verify checksum using tmpsrc, not dest (#64092)
Previously, if the checksum of the downloaded file did not match the
specified checksum, the *destination* file was removed. This possibly
leaves the system that is being provisioned in an invalid state.

Instead, the checksum should be calculated on the temporary file only.
If there's a mismatch, delete the *temporary* file, not the destination
file.

This requires checking the checksum before moving the file.
5 months ago
Matt Clay 96c04e9d1d
ansible-test - Update PyPI and utility container (#83475) 5 months ago
Felix Fontein 1b42af5004
ansible-test: update http-test-container to 3.2.0 (#83469) 5 months ago
MajesticMagikarpKing d62496fe41
human_to_bytes: strictly parse strings (#83403)
Fixes: #82075
5 months ago
Abhijeet Kasurde 224853b684
replace: update after/before example (#83453)
Fixes: #83390

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
shiftyphil dc31b6cf55
service_facts on OpenBSD: Don't crash on '=' in rcctl flags. (#83458)
Splitting on all '=' characters produced too many values.
5 months ago
Matt Clay dad6f07731
ansible-test - Update tested platforms (#83446)
* ansible-test - Update tested platforms

* Add work-around for Alpine tests

* Fix prepare_http_tests on Fedora

* Fix deb-src setup for Ubuntu 24.04+

* Set multiarch_test_pkg for Ubuntu 24.04

* Update AZP test matrix
5 months ago
Martin Krizek b2a289dcbb
Remove Python 3.10 support for the controller (#83221)
Fixes #83094
5 months ago
Abhijeet Kasurde 6382ea168a
vault: Handle directory value to vault password file (#83384)
When vault password file env variable is set to blank,
this value is converted to CWD and passed for further
processing.
Check if ANSIBLE_VAULT_PASSWORD_FILE is not a directory.

Fixes: #42960

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Gilson Guimarães e64c6c1ca5
unarchive: Better handling of files with an invalid timestamp in zip file (#81520)
Fixes: #81092

Signed-off-by: gilsongpfe <gilson.gpf@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Matt Clay 5af5b4b6c8
ansible-test - Update PyPI test container to 3.1.0 (#83432) 5 months ago
Jordan Borean a9b902f579
ansible-test action-plugin-docs sidecar (#83325)
Fix to have ansible-test sanity --test action-plugin-docs to check for
action plugin documentation inside a sidecar file rather than a Python
module.
5 months ago
Abhijeet Kasurde 6e8a7ed327
Revert warning message in setup/gather_facts (#83427)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 months ago
Matt Clay cf265eb14d
Add Python 3.13 support (#83416)
* Add Python 3.13 support

* Add temporary work-around for yamllint test
5 months ago
Matt Clay 14df8c2cf2
ansible-test - Prepare for Python 3.13 (#83414)
Includes an update to `coverage` and pinned Python requirements.
5 months ago
Martin Krizek cbbf06893e
Validate and process Handler.listen only once (#83400)
Fixes #83392
5 months ago
Sloane Hertel bdc1cdfa54
Revert "bool filter, add booleanization strategy option (#83362)" (#83391)
This reverts commit 655a8ff38f.
6 months ago
Matt Martz 93b8b86067
Properly quote all needed components of shell commands (#83365)
* Properly quote all needed components of shell commands

* Use self.quote, add new self.join
6 months ago
Brian Coca 655a8ff38f
bool filter, add booleanization strategy option (#83362)
also make the YAML booleanization the same as spec/JSON/module function
 previous 'aproximation' was missing several options.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Abhijeet Kasurde 16ebeb7d21
facts: add facts about x86_64 flags to detect microarchitecture (#83356)
Fixes: #83331

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Brian Coca c77ed376c4
timeout give extra info (#83206)
the new field shows the python code in execution when it timed out, 99% of the time it will be on a selector waiting for output from ssh to remote.
6 months ago
MajesticMagikarpKing e07b4edc54
Fix Test failure with cowsay installed/present (#83347) 6 months ago
Jordan Borean b8f1add983
powershell - Improve Add-Type tempdir handler (#83080)
Improves the Add-Type temporary directory handler to include a retry
mechanism and not fail on an error. Deleting a temporary file used in
compilation is not a critical error and should improve the reliability
of Ansible on Windows hosts.
6 months ago
Sloane Hertel f2435375a8
Fix task.resolved_action callbacks (#82003)
* Fix task.resolved_action for callbacks when playbooks use action or local_action

* Fix using module_defaults with 'action' and 'local_action' task FA and add a test case

Fixes #81905
6 months ago
odra 46168c8cc2
file module, follow symlink when doing hardlink (#34228)
Fixes: #33911
6 months ago
Abhijeet Kasurde 375d3889de
ansible-doc: make color configurable (#83311)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Abhijeet Kasurde 3af9d0f189
apt_*: add more info message while updating apt cache (#83230)
Fixes: #77941

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Matt Clay 560d3af097
ansible-test - Update http-test-container (#83272)
* Disable cipher suite integration tests

When the client and server both support TLS 1.3, cipher suite selection is effectively a no-op.

Python provides no way to disable TLS 1.3 cipher suites, and no way to prefer user-selected cipher suites.
Since TLS 1.3 includes a mandatory cipher suite, this makes it impossible to induce a cipher suite related error when using TLS 1.3.

* Update multipart form-data integration test

* Fix netrc integration tests

* Update HTTP test host substring

* ansible-test - Update http-test-container
6 months ago
Matt Clay b8483adb33
ansible-test - Update pypi-test-container (#83273) 6 months ago
Matt Clay 930f18ea65
ansible-test - Update ansible-test-utility-container (#83274) 6 months ago
Martin Krizek c5114e1819
Remove deprecated VariableManager._get_delegated_vars (#83259)
Fixes #82950
6 months ago
Brian Coca 7e0a476ba2
setup module, make missing sysctl minor issue (#81297)
Signed-off-by: Brian Coca <brian.coca+git@gmail.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Abhijeet Kasurde ac6200b597
Refactor dmidecode fact gathering code (#83211)
* Code now bails out early if dmidecode command is unavailable

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 months ago
Sloane Hertel 65638b4d01
remove old install info when installing collections (#83194)
* Fix cleaning up galaxy server info from previous installations

* changelog
6 months ago
Martin Krizek 8ad68f12ee
Refactor yum_repository, deprecate yum only options (#83116) 7 months ago
Martin Krizek 3c280e6c1b
dnf5: implement enable_plugin and disable_plugin options (#83105)
80cfea9c25
7 months ago
Abhijeet Kasurde 036d14f1e6
Darwin: add unit tests for hardware fact gathering (#83212)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Florian 45a30ab093
package_facts: apk fix when cache is empty (#83132) 7 months ago
Peter Whall 417db213c0
facts: Update RAID devices regex for FreeBSD (#82081)
Added support FreeBSD RAID devices and regex to match partitions as well as slices. 
RAID device list is taken from here: https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/bsdconfig/share/device.subr
7 months ago
flowerysong f5b945bf6a
ansible-doc: fix typo in output (#83205) 7 months ago
Jens Carl eb3ea3ce5c
Fix order of CLI arguments on FreeBSD (#81377)
When passing arguments on FreeBSD to service command the order is
important, otherwise the service command will ignore the arguments.
7 months ago
Abhijeet Kasurde f4bbd75a3c
git: Check if version is populated or not (#82173)
Before usage check if the git version is populated or not.

Fixes: #72321

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Brian Coca 2816922cd6
display: fix log verbosity (#83179)
* display, ensure we have a logger before we log
7 months ago
Matt Davis 889012e29e
clean up ansible-connection (#82992)
* clean up ansible-connection stuff

* eliminate unnecessary usage of pty/termios
* always use default pickle protocol
* remove unnecessary wire hashing

Co-authored-by: Kate Case <this.is@katherineca.se>
7 months ago
Brian Coca ad777cba5a
package_facts add alias support (#83149)
* package_facts add alias support

fixes #83143

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Abhijeet Kasurde 2b65166a29
uri: deprecate 'yes' or 'no' value in follow_redirects param (#83169)
* uri (module and lookup): deprecate 'yes' or 'no' value in follow_redirects param

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Matt Martz cd9c4eb5a6
Gather sysinfo facts on s390 (#83157) 7 months ago
Felix Fontein 585ef6c55e
Show examples in role entrypoint argument specs. (#82671) 7 months ago
Felix Fontein e3d4c20f6e
Correctly treat separate paragraphs in top-level descriptions as separate paragraphs. (#83155) 7 months ago
Jordan Borean 2ed6c30929
Add version ceiling for pypsrp (#83122)
* Add version ceiling for pypsrp

Add a version ceiling for the pypsrp requirements. This ensures that the
future v1.0.0 release won't impact existing users who install the
library using the version range specified.

* Use constraints file

* Add changelog for this change
7 months ago
Abhijeet Kasurde 628ce5a62e assemble: update argument_spec with 'decrypt' option
* decrypt option is used by assemble action plugin.
  Add this parameter to remove failure raised by
  validate-modules:nonexistent-parameter-documented

Fixes: #80840

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Sloane Hertel e84240db84
Fix installing roles containing symlinks (#82911)
* Fix installing roles containing symlinks

Fix sanitizing tarfile symlinks relative to the link directory instead of the archive

For example:

role
├── handlers
│   └── utils.yml -> ../tasks/utils/suite.yml

The link ../tasks/utils/suite.yml will resolve to a path outside of the link's directory, but within the role

role/handlers/../tasks/utils/suite.yml

the resolved path relative to the role is tasks/utils/suite.yml, but if the symlink is set to that value, tarfile would extract it from role/handlers/tasks/utils/suite.yml

* Replace overly forgiving test case with tests for a symlink in a subdirectory of the archive and a symlink in the archive dir when these are not equivalent.

* Build test case from role files to make it easier to add test cases

Fixes #82702
Fixes #81965
Fixes #82051
7 months ago
Brian Coca 124d03145c
inspect components, ansible_managed templatable (#83053)
* inspect components, ansible_managed templatable

fixes #82322
7 months ago
Thomas Sjögren 7f93f6171d
add systemd version and features fact (#83083)
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
7 months ago
Abhijeet Kasurde 5dac5d365a
systemd_service: handle failure when mask operation fails (#83079)
* Handle the mask operation failure instead of just
  marking state changed.

Fixes: #81649

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Thomas Sjögren ae2234f185
add countme option to yum_repository (#82831)
* add countme option to yum_repository

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>

* add changelog fragment

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* add version_added

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>

* Update lib/ansible/modules/yum_repository.py

* Update lib/ansible/modules/yum_repository.py

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

* Update lib/ansible/modules/yum_repository.py

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
7 months ago
Abhijeet Kasurde 6b3bab6476
plugin: fixed examples of csv lookup plugin (#83068)
Fixes: #83031

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago
Brian Coca 0c51a30d93
ansible-config: add 'validate' option (#83007)
We can now validate both ansible.cfg and 'ANSIBLE_' env vars
match either core (-t base), installed plugin(s) (-t <plugin_type>) or both (-t all)
7 months ago
Martin Krizek a3cdd831b3
handlers: fix executing in lockstep using linear (#83030)
Fixes #82307
7 months ago
Martin Krizek 3a6f825a8e
dnf - honor installroot and substitutes in paths (#83011)
In #80094 support for var substitution for cachedir was added but there
are more options that should be supported. Using an API for
prepend_installroot which should be done anyway provide that feature
so use that. In addition, perform the operation once all substitutes
are in place (releasever as well).
7 months ago
Martin Krizek 4e57249d59
dnf5: replace removed API calls (#83020)
* dnf5: replace removed API calls

bfb6f32e15
96c9188f9c

* call set_group_with_name instead of setting group_with_name

c7b88428f3

---------

Co-authored-by: Matt Martz <matt@sivel.net>
7 months ago
Abhijeet Kasurde cb81801124
facts: Add a generic detection for VMware product name (#83012)
* Use startswith instead of hardcoded values in VMWare product
  detction

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 months ago