Commit Graph

4172 Commits (4fa512406bf993a570759a0c5deed20d639e51c8)

Author SHA1 Message Date
Brian Coca 4fa512406b
loop_control "early exit" feature (#62151)
* add a loop_control break_when directive to break out of a loop after any item

* remove loop var as normal exit would

* example usage:

- name: generate a random password up to 10 times, until it matches the policy
  set_fact:
    password: "{{ lookup('password', '/dev/null', chars=character_set, length=length) }}"
  loop: "{{ range(0, 10) }}"
  loop_control:
    break_when:
      - password is match(password_policy)

Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
3 months ago
Jordan Borean 1a4644ff15
psrp - Remove extras lookups (#83760)
* psrp - Remove extras lookups

Removed the extras variable lookups for the psrp connection plugin. All
valid options are already documented and the extras functionality is
slated to be deprecated at a future point in time. This should have
affect on existing user's playbooks.

* Fix up sanity tests and add explicit boolean conversion test
3 months ago
Jordan Borean 1503805b70
Add location on include_tasks fail inside include (#83876)
Adds the datastore details to the parser error when attempting to
include tasks that contain include_tasks without a filename set. This
change will now display the exact location of the include_tasks that
failed like any normal syntax error.
3 months ago
Matt Clay 4346430003
ansible-test - Reduce scope of empty-init test (#83878) 3 months ago
Jordan Borean 9a5a9e48fc
Improve testing for Windows SSH and other connection plugins (#83834)
Expands the test matrix used for testing on Windows to cover the three
connection plugins we support for all the tasks. This change also
changes how raw commands are run over SSH to avoid starting a
`powershell.exe` process that was uneeded in the majority of cases used
in Ansible. This simplifies our code a bit more by removing extra
Windows specific actions in the ssh plugin and improves the efficiency
when running tasks.
3 months ago
Matt Clay db04499f58 ansible-test - Update nios-test-container to 5.0.0 3 months ago
Brian Coca 2a676ff897
copy, fix permissions and atime on diff partitions (#83824)
we just set time also, when on diff partitions
3 months ago
Felix Fontein faf446a895
runtime-metadata sanity test: do not fail deprecation version checks if galaxy.yml has empty `version` (#83831)
* Do not create invalid SemanticVersion objects.
* Fix SemanticVersion.parse().
* Add basic runtime-metadata tests.
3 months ago
jctanner bed9a9597a
galaxy-cli tasking polling interval from environment variable (#83803)
Added configuration options, including environment variables to control the polling 
No-Issue

---------
Signed-off-by: James Tanner <tanner.jc@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
3 months ago
Jordan Borean b5e0293645
powershell - Improve CLIXML parsing (#83847)
Improves the logic used when parsing CLIXML to support all escaped
character sequences and not just newlines.
3 months ago
Matt Martz 9b0d2decb2
Handle authentication errors and token expiration (#83695)
Fixes #70019
3 months ago
Martin Krizek 5ab5f23487
dnf: stop filtering exceptions by matching on text (#83297)
* Rely on dnf.base.remove, no special handling isn't needed,
  let the dnf internals figure out what is needed to be done.
  This is more in line with what dnf cli does.

* "already installed" in Exception (if it is even a thing) should be
  caught by special exceptions like MarkingError or CompsError. This
  appears to be a historic check that is no longer needed.

Supersedes: #83295
3 months ago
Brian Coca 718ce13673
connection plugins: extras fix (#83353)
Currently we match the load name, which can be an fqcn, but most users expect the 'naked' name
Now plugins can declare that name by setting _extras_prefix property or fallback to 'non fqcn' if no extras prefix
3 months ago
Brian Coca 90de03be50
Gather mount facts, fallback for when multiproc is not feasable (#83750)
* fallback to 'single threaded gathering' for when multiproc fails

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
3 months ago
Jordan Borean 520fa688ba
ssh and psrp - Support more complex characters in fetch_file (#83753)
* ssh and psrp - Support more complex chars in fetch_file

Fixes the psrp and ssh (with piped) fetch function to work with paths
that contains glob like characters in the path. For Windows this was
needed when using paths that contain `[]` in the path. For ssh this was
a problem with FreeBSD when using the piped transfer method with similar
characters.

Also tidies up the psrp logic to not inject the paths and buffer size
in the script but pass it as an object through an argument/parameter.

* Fix sanity check
3 months ago
Matt Clay 81e025b414 ansible-test - Add Windows remote connection option 3 months ago
Matt Clay ab624ad031
ansible-test - Remove generation of egg-info (#83786)
Also remove egg-info generation from hacking/env-setup scripts.
3 months ago
dkuji 26375e7f12
fix copy module update atime/mtime (#83235)
Ensure we force mtime/atime update when using copystat

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
3 months ago
Martin Krizek 89137cb5a0
Add end_role meta task (#83263)
ci_complete
3 months ago
Martin Krizek 9a54ba5a39
Ensure skipped loop iteration register var is available (#83756)
Fixes #83619
3 months ago
Martin Krizek 5c84220dbb
Fix meta tasks breaking host/fork affinity with host_pinned (#83438)
Fixes #83294
3 months ago
Martin Krizek a0f9bbf3f3
ini lookup: add new interpolation option (#83773)
Fixes #83755
3 months ago
Matt Clay b25afbb4e9
Suppress cryptography warnings for paramiko (#83772) 3 months ago
Sloane Hertel 2b91c57c85
atomic_move - fix creating file in directory with setgid bit (#83718)
* fix creating file in directory with setgid bit

* add a test using the copy module's content option to create a file in a directory with setgid bit

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
3 months ago
Kellin 0d6b034103
Enable validation of subkeys in rpm key module (#83716)
* Enable validation of subkeys in rpm key module

A gpg subkey may change while the primary key remains the same. Due to
this behavior, there are situations where validation of the primary gpg
key fingerprint is not sufficient because the desired target is actually
the gpg subkey. This change allows the user to validate against either
the fingerprint of the primary gpg key or its subkey.

Signed-off-by: Kellin <kellin@retromud.org>

* Improve tests, add multi-fingerprint

- Improve tests to cover all cases
- add multi fingerprint validation

Signed-off-by: Kellin <kellin@retromud.org>
3 months ago
akire0ne 7b74de069c
fix: `COLOR_INCLUDED` to colorize `included` output (#83711)
adds color included configuration and applies to include message

Co-authored-by: Achille Myette <amyette@drw.com>
4 months ago
Brian Coca 797e6bb220
Add vaulted_file test (#83717)
* Add vaulted_file test
* fix is_encrypted_file while we are here
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
4 months ago
Martin Krizek d9f1866249
Deprecate remaining safe evals (#83293) 4 months ago
Matt Clay 717f1092e3
ansible-test - Update venv management and sanity requirements (#83729)
* ansible-test - Update venv management
* Upgrade from pip 24.0 to 24.2
* Omit `wheel` and `setuptools` from ansible-test managed virtual environments
* Drop pre-release hacks
* Update mypy requirements
* Freeze sanity test requirements
* Update sanity test configuration
* Update sanity ignores
4 months ago
Sloane Hertel 0be66ed6dc
Fix task-adjacent search path in roles (#83621)
* Restore search path in the current task file’s directory for roles
4 months ago
Sloane Hertel 26c8a28d05
csvfile lookup - fix giving an error when no search term is provided (#83710)
Fixes #83689
4 months ago
Brian Coca 885e3766a8
core: raw params better error msg (#83726)
* less confusing error msg
* also remove 'removed' include
4 months ago
Brian Coca c5210ad3eb
Fix display to log severity mapping (#83712)
add caplevel to display to pass through
also reverse dict order as 'last update wins'
added tests ... and also log severity to log

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
4 months ago
Matt Clay 6019f3f425
ansible-test - Update coverage to 7.6.1 (#83723) 4 months ago
Abhijeet Kasurde 91f680a749
Remove extraneous get_bin_path call (#83675)
ip_path is already calculated before calling get_interfaces_info

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
4 months ago
Abhijeet Kasurde 245885177c
systemd facts: Handle AttributeError (#83684)
* Handle AttributeError raised while running systemd facts on
  non-systemd hosts

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
Abhijeet Kasurde 31ad786de1
ansible-doc: handle on_fail (#83676)
Handle errors raised when role doc has errors

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 months ago
skupfer 20465ba11a
Add UID and GID min/max keys (#81770)
Fixes: #72183
4 months ago
Karl G 6bf6844a1c
add error handling when parsing values in ini files (#82718)
Fixes: #82717

Co-authored-by: Karl A. Grindley <kgrindley@ll.mit.edu>
4 months ago
Jordan Borean bbf96c250f
winrm - quota retry handling (#83656)
* winrm - quota retry handling

Add a retry attempt when receiving ERROR_WSMAN_QUOTA_MAX_OPERATIONS when
starting a command. This can occur when running a loop with multiple
iterations or an action plugin that runs multiple commands.

* Update pywinrm constraint for test

* Add verbose hint and mark test as destructive
4 months ago
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