Commit Graph

3432 Commits (dc2a79f1c3e45ac9b3c44f8d03b966903ca66de0)

Author SHA1 Message Date
Brian Coca af9f628ab5
Add python path to version output (#77631)
To further disambiguate 'which' python is the correct python
2 years ago
Martin Krizek 3980eb8c09
Prevent losing unsafe from lookups (#77609)
* Prevent losing unsafe from lookups

This patch fixes a bug which under certain conditions results in data
returned from lookups not being marked as unsafe.

Each time Templar.do_template is invoked a new AnsibleContext is
created and stored effectively at two places:
1) as an instance variable in templar_obj.cur_context
2) as a local variable called new_context in do_template method of Templar

Due to custom functionality in Ansible's Context that allows for nested
templating it is possible that during resolving variable's value
template/do_template method is called recursively again, again creating
a new context. At that point the problem manifests itself because as
mentioned in 1) above the context is overwriten on the templar object
which means that any subsequent calls to _lookup will use the new
context to mark it as unsafe which is now different to the local
new_context which is used for testing for unsafe property.

The solution to the problem appears to be to restore the original
context inside do_template and also to eliminate the local variable
new_context to prevent problems in the future.

It appears that we don't have a better way of storing the context other
than as some form of global variable and so this appears to be the
"best" solution possible at this point. Hopefully data tagging will be
the solution here.

For more examples see unit and integration tests included in this patch.

Fixes #77535
2 years ago
Matt Clay 6fdec4a6ab Revert "Require blocking IO for ansible CLI. (#77639)"
This reverts commit e2d54d3594.
2 years ago
Matt Clay 26fd5a8c3a Revert "ansible-test - Fix subprocess management. (#77638)"
This reverts commit 62d03c8e75.
2 years ago
Matt Clay e2d54d3594
Require blocking IO for ansible CLI. (#77639) 2 years ago
Matt Clay 62d03c8e75
ansible-test - Fix subprocess management. (#77638)
* Run code-smell sanity tests in UTF-8 Mode.
* Update subprocess use in sanity test programs.
* Use raw_command instead of run_command with always=True set.
* Add more capture=True usage.
* Don't expose stdin to subprocesses.
* Capture more output. Warn on retry.
* Add more captures.
* Capture coverage cli output.
* Capture windows and network host checks.
* Be explicit about interactive usage.
* Use a shell for non-captured, non-interactive subprocesses.
* Add integration test to assert no TTY.
* Add unit test to assert no TTY.
* Require blocking stdin/stdout/stderr.
* Use subprocess.run in ansible-core sanity tests.
* Remove unused arg.
* Be explicit with subprocess.run check=False.
* Add changelog.
2 years ago
Sandra McCann 1802684c7b
add link to deprecation warning (#77599)
* add link to deprecation warning

(cherry picked from commit f991470dd0)
2 years ago
Brian Coca d06d99cbb6
git fix docs and wrapper script (#77588)
* git fix docs and wrapper script

 fixes #77582

 now env var is set to wrapper or full command depending on version
 as was the intent of previous PR
 added ref to git commit from git for why/how we used the env vars

* handle key_file
2 years ago
Sam Doran 1b947eaf92
arg_spec - Return aliases in validation result and update aliases (#77576)
When looking up the `no_log` setting for a parameter that is an alias in
`AnsibleModule._log_invocation()`, the alias value will always be an
empty dictionary since `self.aliases` on the `AnsibleModule` instance is
never updated after initialization. Since the `no_log` setting is on the
canonical parameter not the alias, an incorrect warning is issued if the
parameter matches `PASSWORD_MATCH`.

This PR returns the aliases dictionary as an attribute of the
`ValidationResult` and updates the `aliases` attribute on the
`AnsibleModule` instance.
2 years ago
Sloane Hertel 494f932773
Deprecate PlayContext.verbosity (#77507)
display.verbosity should be used instead
2 years ago
Brian Coca 2c2a204dc6
varaiblemanager, more efficienet vars file reads (#77570) 2 years ago
Matt Clay b960641759 ansible-test - Support multiple coverage versions.
ci_complete
ci_coverage
2 years ago
Jack 4d69c09695
ansible-galaxy collection - ensure dependencies are a dict (#77561)
* fix traceback when installing collection with dependencies set to None
2 years ago
Sloane Hertel 4faa576ee9
Add a test and changelog for non-string host names in yaml inventory files (#77569) 2 years ago
Brian Coca abdd237de7
Yolo (#77554)
* Revert "Revert "Config, ensure templating happens at functions (#77483)""

This reverts commit 94c9106153.

* removed update configdata, which is unused
* removed test for action we don't perform anymore
* removed unused configdata
2 years ago
Matt Clay 191d9a771a ansible-test - Remove more Python 2.7 support. 2 years ago
Matt Clay 94c9106153 Revert "Config, ensure templating happens at functions (#77483)"
This reverts commit 6e5f1d781d.
2 years ago
Martin Krizek cbe42bff7f
Allow for lazy evaluation of Jinja2 expressions (#56116) 2 years ago
Brian Coca f2ab920822
Better info sourcing (#77511)
Task is  authoritative
   also includes latest per loop info
   and fix tests
2 years ago
Brian Coca 793bb200ec
CLI now issues clearer error when 0 hosts selected (#77517)
fixes #77512
2 years ago
Brian Coca 6e5f1d781d
Config, ensure templating happens at functions (#77483)
move away from special templating in constants.py
 simplified main get, unified paths to get info

* Let native jinja deal with eval for type
* make constants available for templating defaults
* ensure we use config file
2 years ago
Will Thames c3a3bc1d0d
Allow strftime to display time in UTC (#70351) 2 years ago
Brian Coca a0dede5458
ansible-connection verboistery (#77509)
* ansible-connection verboistery

  for cli, just use normal parser creation
 this also adds --help, but that seems fine
 also some error cleanup

Co-authored-by: Nathaniel Case <this.is@nathanielca.se>
2 years ago
Brian Coca 3b9592fcaf
Move to display as single source of verbosity (#77498)
* Move to display as single source of verbosity

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Matt Clay 32d67ce998 Exclude Python 2.6 from interpreter discovery. 2 years ago
Corubba 94138cf608
template override colon bugfixes (#77495)
* Proper error on missing jinja2 override separator

Properly catch the case when no (or a wrong) separator is used in a
jinja2 override, and return a useful error message to the user.

* Support colons in jinja2 override value

By limiting the split to 1, any colons in the value are preserved and
passed on.
2 years ago
Martin Krizek 94eff70030
PlayIterator - remove deprecated states (#77444) 2 years ago
Sloane Hertel 477c55b0d2
Get git executable for collections in git repos (#77493)
* Fix traceback installing collections from git repos if git is not installed
2 years ago
Martin Krizek c7e198b907
Ensure correct environment_class is set on Template (#77485) 2 years ago
Matt Martz 66c5844978
ansible-test - Don't fail if network cannot be disconnected (#77472)
* Don't fail if network cannot be disconnected

* add clog frag
2 years ago
h4rr21 1d9c68d27e
honor use_proxy parameter (#77312)
* honor use_proxy parameter
* fix uri test with "use_proxy: no"
* fix urls.py module

Co-authored-by: Carlos <Juan.Carlos.Cardenas.Viera@ibm.com>
2 years ago
Jon "The Nice Guy" Spriggs 5b44035983
Hide "[WARNING]: No inventory was parsed" message (#65499)
* Add config option INVENTORY_UNPARSED_WARNING to hide the warning "No inventory was parsed, only implicit localhost is available"
2 years ago
Felix Fontein 6216c9fc93 Fix sanity test crash. 2 years ago
Martin Krizek dce30e2577
Remove deprecated Load-CommandUtils and Import-PrivilegeUtil (#77457) 2 years ago
Martin Krizek f41636b9b8
Remove deprecated UnsafeProxy (#77455) 2 years ago
Martin Krizek 9f82fc204b
apt_key: remove deprecated key module param (#77409) 2 years ago
Martin Krizek f933f9a178
get_url: remove deprecated sha256sum module param (#77408) 2 years ago
Martin Krizek 26149c45df
import_playbook: remove deprecated free form params (#77431) 2 years ago
Martin Krizek d4dd4a82c0
Remove deprecated default.plugin_filters_cfg config option (#77429)
* Remove deprecated default.plugin_filters_cfg config option

Fixes #77398

* Fix tests
2 years ago
Martin Krizek a421a38e10
Remove deprecated NETWORK_GROUP_MODULES env var (#77428)
Fixes #77397
2 years ago
Martin Krizek f2387537b6
Remove deprecated DISPLAY_SKIPPED_HOSTS env var (#77427)
Fixes #77396
2 years ago
Martin Krizek ff8a854e57
Remove deprecated LIBVIRT_LXC_NOSECLABEL env var (#77426)
Fixes #77395
2 years ago
Sloane Hertel 87a8fedd94
Fix type for ansible-galaxy server config definitions (#77424)
* Fix type for ansible-galaxy server config definitions

* changelog

* check attr without api call

* pep8
2 years ago
Matt Clay 4b51e61645 ansible-test - Fix origin host target filtering. 2 years ago
Martin Krizek 6d260ad967
Remove COMMAND_WARNINGS and warn (#77411)
* Remove COMMAND_WARNINGS and warn

Fixes #77394
2 years ago
Martin Krizek e080bae766
Remove deprecated ALLOW_WORLD_READABLE_TMPFILES config option (#77410)
Fixes #77393
2 years ago
Jordan Borean 60b4200bc6
winrm - ensure callers PATH for kinit is set (#77401)
* winrm - ensure callers PATH for kinit is set

* Fix unit test expectations

* Fix type annotation
2 years ago
Sloane Hertel f8ec660e62
[ansible-galaxy] Fix listing collections with null namespace/name/version metadata (#77014)
* Fall back to implicit namespace.name from the path if the metadata is invalid

* Test listing a collection with null namespace/name/version fields in its galaxy.yml
2 years ago
Matt Clay 50d4cf931c
Start of 2.14 development cycle. (#77378)
* Delete old changelog fragments.
* Add 2.14 changelog stub.
* Add porting guide.
* Update version and codename.
* Add temporary deprecated version ignores.
2 years ago
Matt Clay 708e4c206a ansible-test - Update default test containers. 2 years ago
Matt Martz 4723eb9caa
Add family fallback for RHEL to register as RedHat (#77371)
* Add family fallback for RHEL to register as RedHat

* Update tests to properly assert RHEL behavior
2 years ago
Felix Fontein babc26adc1
Handle errors during ansible-doc --metadata-dump more gracefully (#77035)
* Add option --no-fail-on-errors to return errors for ansible-doc --metadata-dump in JSON result instead of failing.

* Adjust changelog fragment.

* Add basic tests.
2 years ago
Matt Clay 55f90ba31f ansible-test - Remove RHEL 9.0b support.
Support can be restored once RHEL 9 has been released.
2 years ago
Matt Martz afecc6400e
Action Plugin argspec validation (#77013) 2 years ago
Brian Coca 4635c75ef7
log results for get_best_parsable_locale (#77319)
* log locale outcomes from function
* also included variant forms of same prefs
2 years ago
Jordan Borean ff184b0815
SID - Use literal UPN value when attempting a user to SID lookup (#77334) 2 years ago
James Milligan ea7f24a1d5
Support ignoring of certificates for ansible-galaxy during SCM cloning (#67616)
* Support ignoring of certificates for ansible-galaxy during SCM cloning

* Add integration tests installing a role from an untrusted repository

Test installing the role without --ignore-certs fails
Test installing the role with --ignore-certs is successful
2 years ago
Sloane Hertel f96a661ada
ansible-galaxy - add configuration options for more flexible collection signature verification (#77026)
* Add a toggle to control the number of signatures required to verify the authenticity of a collection

* Make the default number of required valid signatures 1

* Add option to make signature verification strict and fail if there are no valid signatures (e.g. "+1")

* Use a regex to validate --required-valid-signature-count

* Add a toggle to limit the gpg status codes that are considered a failure

* Update documentation and changelog

* Add unit and integration tests for the new options

* Fixes #77146

Fix using user-provided signatures when running 'ansible-galaxy collection verify ns.coll --offline'

Add a test for a user-provided signature when running ansible-galaxy collection verify with --offline

Fix displaying overall gpg failure without extra verbosity

Add a test for displaying gpg failure without verbosity

Improve documentation to be more clear that signature verification only currently applies to collections directly sourced from Galaxy servers
2 years ago
Till Maas bf00a14f91
linux networking facts: Provide IPv4 prefix (#77193)
For IPv6 addresses, Ansible already provides the prefix length for IP
addresses in the `prefix` fact. This patch adjusts the facts for IPv4
addresses to also contain the prefix length in the prefix fact. This
makes it easier to use the facts consistently when the CIDR notation is
needed.

Signed-off-by: Till Maas <opensource@till.name>
2 years ago
Felix Fontein 4baf18c573
Remove more Python 2.x compatibility code from controller. (#77320) 2 years ago
Matt Martz c1a34d5a63
Update systemd strategy to not confuse NetworkManager (#77243)
* Update systemd strategy to not confuse NetworkManager. Fixes #76958

* Add tests
2 years ago
Abhijeet Kasurde 1100289a45
docker_util: Handle error in JSON parsing (#77298)
While getting hostname from container, podman command
fails to return JSON so wrap exception and return
hostname as 'None'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
ChanthMiao 34e60c0a7a
ansible_distribution: Add support for Uos/Deepin (#77275)
* ansible_distribution: Add support for Uos/Deepin

* Add changelog fragment.
2 years ago
Felix Fontein 4d984613f5
validate-modules for plugins: do some more schema validations so that some issues that are currently reported for modules are also reported for plugins (#77268)
* Add more sanity tests on schema level (so they also work for plugins).

* Fix various issues the sanity test reported.

* Add changelog fragment.

* Fix function name.
2 years ago
Felix Fontein e3c72230cd
unarchive: fix io_buffer_size option, remove ignore.txt entry (#77271)
* Fix io_buffer_size option.

* Remove ignore.txt entry by adding action plugin only options to module's argument spec.

* Add changelog fragment.

* Adjust unit tests.
2 years ago
Brian Coca 94b73d66d5
inventory manager respect --flush-cache (#77083) 2 years ago
Martin Krizek c9db73f04e
Add a YAML representer for NativeJinjaText (#77282)
Fixes #77280
2 years ago
Matt Clay e8afdac06e ansible-test - Fix delegation inventory path. 2 years ago
Matt Martz 7cb581ed2c
Support podman-remote in ansible-test (#75753) 2 years ago
Matt Clay 0c514bcf54 ansible-test - Fix PS coverage `--all` generation. 2 years ago
Matt Clay 822fddd627 Fix yaml loader and compat. 2 years ago
Matt Clay f43c54d890 ansible-test - Update default containers to 5.7.0. 2 years ago
Sloane Hertel 8063643b4c
Fix collection redirects for filter and test plugins (#77210)
* Fix collection redirects for jinja2 filters/tests

* Handle recursive redirects

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Philip Douglass e6f63be7a4
Honor `--quiet` parameter properly in fish shell (#77180)
* The `^` stderr redirection is deprecated
* Setting `-q` for `setup.py` in `gen_egg_info` is redundant
2 years ago
Felix Fontein 0990c4ca7c
Extend validate-modules to also validate plugins (#71734)
* Let validate-modules also validate plugins.

* Support 'option' in 'cli'.

* Use DOCUMENTABLE_PLUGINS instead of UNDOCUMENTED_PLUGIN_TYPES.

* Support 'keyword', clean up error codes.

* Call settings.process_errors only once; remove __version__.

* Add changelog fragment.
2 years ago
Pierre Blanc ea66cf189b
Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK (#77182)
* Fix ansible console to respect ANSIBLE_STDOUT_CALLBACK

This makes the ansible-console able to customize the stdout callback.
Ansible console currently uses statically minimal callback.

* Add changelog

* Move the fragment changelog in the right directory
2 years ago
Matt Clay e314f4e666
Add typing to module_utils.compat. (#77197) 2 years ago
Martin Krizek 74a204e6f1
first_found: allow spaces in names (#77141)
* first_found: allow spaces in names

Fixes #77136
2 years ago
Sloane Hertel 7657caa072
Fix 'ansible-galaxy collection verify' to display new files/dirs (#76690)
* Fix 'ansible-galaxy collection verify' to report files/directories not listed in the FILES.json

* changelog

* Fix bug in 2.13+
2 years ago
Matt Clay dc6b0d4857 ansible-test - Remove obsolete display of MAXFD.
Use of ``subprocess.MAXFD`` only worked on Python 2.x, which is no longer supported.
2 years ago
Elijah DeLee 3f924b59f2
use same timeout for galaxy api interactions (#77088)
Also, bump the default. A number of people have reported problems with
this 20 second timeout for a couple of years on
https://github.com/ansible/galaxy/issues/2302

It is mentioned in the issue that resolving dns can sometimes take up to
30 seconds, and that this timeout includes dns resolution.

Includes a changelog message
2 years ago
Abhijeet Kasurde 4f48f375a0
parameters: handle blank values when argument is a list (#77119)
Fixes: #77108

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Emmanuel Benoît d60efd9768
hostname module - fix TypeError in FileStrategy (#77025) (#77074)
* Use file_get_content() to read the file containing the host name
2 years ago
Günter Grodotzki 0bb70b6b9f
AL2022 package-manager detection support (Amazon Linux) (#77050)
* AL2022 package-manager detection support (Amazon Linux)

* try/except

* use major_version

* check if dnf exists + add changelog fragment

* analogue logic
2 years ago
Matt Martz bdf37336c8
Update pylint deprecated plugin to use ansible-invalid* symbols (#77086) 2 years ago
Brian Coca 143904f49b
More informative playbook attribute errors (#77082)
* More informative playbook attribute errors

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Matt Martz 8cbe1435c2
Use full python package for ansiballz cache filenames (#77090)
* Use full python package for ansiballz cache filenames

* Be a little more explicit about test goals
2 years ago
Matt Clay d3d5244912 ansible-test - Fail sanity test on distutils use. 2 years ago
Matt Clay d286c2e8b3 ansible-test - Fix CParser import in yamllint. 2 years ago
Matt Clay c27fd777f4 ansible-test - Use quay.io containers in plugins. 2 years ago
Pablo Escobar Lopez f2612ce169
apply owner/group permissions to top folder with unarchive module (#73024)
* apply owner/group permissions to top folder
* remove unused var unarchive30
* fix permissions for top folders if the tarball include multiple top folders
* added test for top folder ownership
2 years ago
Matt Clay 13d5381e56
ansible-test - Update base and default containers. (#77033) 2 years ago
Matt Clay 68fb3bf90e
ansible-test - Fix consistency of managed venvs. (#77028) 2 years ago
Martin Krizek 18251f3685
dnf: ensure releasever is passed into libdnf as str (#77024)
Fixes #77010
2 years ago
Matt Martz 3779c1f278
restore inadvertently deleted default for convert_data. Fixes #77004 (#77016) 2 years ago
Brian Coca c9d3518d2f
Fix final fact delegation (#77008)
* fix facts delegation loop overwrite

 partial revert of change to allow facts to be present in each loop iteration
 was not needed in final results as result processing alreayd had the disctiontion
 and ended up breaking the assumptions in the calling code.

 fixes #76676
2 years ago
Brian Coca 56edbd2bbb
Handle connection dissonance (#77005)
* play_context, compensate for existing plugins

 some connection plugins are not fully using the correct configuration,
 but this was previously hidden from them as play_context was providing
 the info instead, now play_context provides the 'correct' info, but hitting
 these bad configurations.
2 years ago
Matt Clay ef4c5cd61b ansible-test - Use newer pip to bootstrap FreeBSD. 2 years ago
Sloane Hertel 43e55db208
ansible-galaxy - add signature verification of the MANIFEST.json (#76681)
* ansible-galaxy collection install|verify:

  - Support verifying the origin of the MANIFEST.json when the Galaxy server has provided signatures.
  - Allow supplemental signatures to use during verification on the CLI/requirements file.

* ansible-galaxy collection install:

  - Support disabling signature verification. This silences the warning provided by ansible-galaxy if the Galaxy server provided signatures it cannot use because no keyring is configured.
  - Store Galaxy server metadata alongside installed collections for provenance. This is used by 'ansible-galaxy collection verify --offline'.

* Add unit tests for method that gets signatures from a Galaxy server

* Add integration tests for user-provided signature sources

- Test CLI option combinations
- Test installing collections with valid/invalid signature sources
- Test disabling GPG verification when installing collections
- Test verifying collections with valid/invalid signature sources

* Make signature verification advisory-by-default if signatures are provided by the Galaxy server

- Make the default keyring None
- Warn if the keyring is None but the Galaxy server provided signatures
- Error if the keyring is None but the user supplied signatures
- Error if the keyring is not None but is invalid

* changelog

* add ansible-galaxy user documentation for new options

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
Co-authored-by: Andy Mott <amott@redhat.com>
Co-authored-by: John R Barker <john@johnrbarker.com>
2 years ago
Jack Scheible d35bef68f5
replace - always return rc (#71963)
* Return rc=0 on success.

Error handling in playbooks generally expects `rc` to be set to 0 when a module has not failed.  Playbook authors should not have to check for the existence of `rc` first.

* Use single definition and added changelog

* Fix up tests with new return value

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2 years ago
Thomas Sjögren b145732973
Resubmit: Use SystemdStrategy for Debian in the hostname module (#76929)
* add DebianStrategy tests
* ensure hostname can be changed by using become
* use Systemd strat for debian and Base for generic.
* add test to ensure all strategies are available

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
2 years ago
Stephen Ryan 522f9d1050
Make builtin.file modification times support check_mode (#76973)
* Make builtin.file modification times support check_mode
* Add integration test
2 years ago
Matt Clay 0d40423f1c
ansible-test - Fix collection loader import. (#76986)
* ansible-test - Fix collection loader import.

Resolves https://github.com/ansible/ansible/issues/76960
2 years ago
Brian Coca 699ecb8308
improve warnings from service_facts (#76921)
be more permissive, allow query more statuses
might create a slew of warnings though, but can depend on
how individual services are permissioned
2 years ago
Brian Coca 47faa6e206
clean_facts only show variable name (#76974) 2 years ago
Matt Clay 00a2b7788e ansible-test - Remove cap on cryptography version. 2 years ago
Matt Clay e27b94c467 ansible-test - Update alpine3 container to 3.3.0.
This updates the base image from 3.14.2 to 3.15.0, which includes support for installing binary wheels using pip.
2 years ago
Brian Coca d4c9c103e2
ansible-pull handlle empty node/hostname return (#76965) 2 years ago
Brian Coca b493c590bc
Bypass fragile git ssh wrapper (#73404)
git module now uses env vars exclusively

  - updated docs to clarify usage
  - now env vars append instead of overwrite to allow existing custom setups to keep working
    fixes #38104, #64673, #64674
  - added note for hostkeychecking more securely
    fixes #69846
  - keep script cause old versions still choke on env
  - env var cannot hold more than 'command' for older versions
  - all ssh_opts in one place
2 years ago
Brian Coca be19863e44
ssh connection: use 'correct' host in all cases (#76017)
ssh plugin, use 'correct' information source in all cases
  * still fallback to pc
  * added inventory to new test
  * undef var can still show as parser error on pc
    now task_exectuer has a  more accurate error handling
2 years ago
Brian Coca 5bddecb048
gather_facts sees collection networking connection (#76954)
needed to properly propagate some arguments by convention: subset, filter

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Martin Krizek 394d216922
add_host/group_by: fix using changed_when in a loop (#71719)
Fixes #71627
Fixes #75971
2 years ago
Matt Clay 17dd9ff924 ansible-test - Update default containers to 5.5.0. 2 years ago
Abhijeet Kasurde a1af1d94cd
vmware: Migrate VMware Scenario Guides (#76640)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Matt Clay b568e0db6f ansible-test - Remove outdated remote support. 2 years ago
Matt Clay 7e64c4fe55 ansible-test - Update bootstrap URL to not use S3. 2 years ago
Brian Scholer cbb994f174
make Ansible.Basic work on non-Windows (#76924) 2 years ago
Matt Clay 41db6d8d35 Fix task path unicode error in junit callback. 2 years ago
neikei 3c8861d1ba
Fixed handling of sleep arguments during service restarts on AIX (#76878)
Fixes #76877
2 years ago
Matt Clay 995d7e4db3 ansible-test - Limit installed pyopenssl version. 2 years ago
Matt Clay fbb5d56bd2
ansible-test - Use relative paths in junit output. (#76871)
* ansible-test - Use relative paths in junit output.

Also fix a traceback in the junit callback during automatic fact gathering.

* ansible-test - Handle out-of-tree JUnit paths.
2 years ago
Brian Coca b1d6750e8b
fix block var inheritance (#75287)
* updated tests to conform to new block inheritance

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2 years ago
Martin Krizek 3816815db0
Track failures in the includes results to avoid special handling of include errors (#53688)
* Make include_role/include_tasks work with any_errors_fatal v2

Fixes #50897

Co-authored-by: Matt Martz <matt@sivel.net>

* Add failed to results in free strategy too

* Fix

* Avoid duplicating results

* ci_complete

Co-authored-by: Matt Martz <matt@sivel.net>
2 years ago
Martin Krizek f501b579e5
ansible-vault encrypt_string: fix --output to write into file (#76856)
Fixes #75101
Fixes #59590
2 years ago
Matt Clay 18ed2c64e5 ansible-test - Add default for Windows remotes. 2 years ago
Matt Clay 26b43f425f ansible-test - Validate collection ns and name.
Resolves https://github.com/ansible/ansible/issues/62079
2 years ago
Matt Clay de5f60e374
ansible-test - Improve help for unsupported cwd. (#76866)
* ansible-test - Improve help for unsupported cwd.

* The `--help` option is now available when an unsupported cwd is in use.
* The `--help` output now shows the same instructions about cwd as would be shown in error messages if the cwd is unsupported.
* Add `--version` support to show the ansible-core version.
* The explanation about cwd usage has been improved to explain more clearly what is required.

Resolves https://github.com/ansible/ansible/issues/64523
Resolves https://github.com/ansible/ansible/issues/67551
2 years ago
Martin Krizek 29de2cccba
Fix task debugger to work with run_once using linear strategy (#76814)
* Fix task debugger to work with run_once using linear strategy

Fixes #76049

* Fix clog

* Add integration test
2 years ago
neikei 73dd2c3607
Added restart to the argument condition for AIX (#76841)
* Added restart to the argument condition for AIX

This should fix the issue https://github.com/ansible/ansible/issues/76840
2 years ago
Matt Clay e9ffcf3c85
ansible-test - Defer loading of completion entries. (#76852)
* ansible-test - Defer loading of completion entries.

This avoids a traceback when running ansible-test outside of a supported directory.
2 years ago
Daniel Goldman dbde2c2ae3
user module password expiration fixes (#75390)
* allow inputting 0 for password_expire_{min|max}
   0 is meaningful for min days (any time)   
   0 is technically valid for max_days
* add test for setting both min and max expiry
* [0] return result of execute_command from set_password_expire*
* [1] better return for set_password_expire
* [2] handle returns from set_password_expire*
* only set password expiry if user exists
* collect return-handling code
* combine password min and max into one execution
* handle case where spwd is not present like on macOS and FreeBSD

Co-authored-by: Sam Doran <sdoran@redhat.com>
2 years ago
Éloi Rivard 3889ddeb4b
iptables - added a ``chain_management`` parameter to control chain (#76378)
creation and deletion

fixes #25099
closes #32158
2 years ago
Matt Martz 96ce4804ee
Resolve perf issue with async callback events (#76783)
* Don't send full task with async callback events. Fixes #76729

* Use args for async_status task, instead of k=v

* Make sure we send back the async task attrs for polling

* Add clog frag

* load is a staticmethod
2 years ago
Matt Martz d7d1bd6269
Fallback to os family for interpreter discovery distro map. Fixes #75560 (#76815) 2 years ago
Abhinav Tripathy 8c06aada10
Module Logging with WSL2 (#76375)
* adding systemd daemon import

* adding coments and AttributeError exception

* adding minor fix to repeated syntax

* adding changelog
2 years ago
Martin Krizek 8febd37f32
Attach concat func to an environment class (#76282)
* Attach concat func to an environment class

ci_complete

* clog and docstrings
2 years ago
Matt Martz 9f46f6eb30
Attempt 2: Catch errors getting filters and tests (#76806) 2 years ago
Matt Martz 374720fc97
Do not require SystemdStrategy subclasses for every distro (#76800) 2 years ago
Mark Mercado 36519ff95e
Parameterize disable_lookups (#76770)
Allow inventory plugins to enable/disable lookups in the compose templating
2 years ago
Matt Martz 29bdb8bf1e
Compare FQCN also in lockstep logic. Fixes #76782 (#76787) 2 years ago
Dimitri Savineau a0f6747f07
ansible-test: fix typo in validate-modules (#76765)
The correct error strategy for the to_text method is surrogate_or_strict

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
2 years ago
Brian Coca 89c884e2a2
include_vars initialize failed (#76754)
* include_vars initialize failed

  if source dir is given, but not present and traversal is empty you
  can end up trying to access failed w/o it ever being defined.

  also future proof for more corner cases in decision tree
2 years ago
Brian Coca 4676c08f18
prevent fact gathering from breaking on bad caps (#76691)
* prevent fact gathering from breaking on bad caps

 fxies #75832
2 years ago
Brian Coca 2246ed9678
ansible-config avoid _terms and _input in --only-changed (#76597)
dont display _terms or _intput on only changed
 those always change and it expected for the plugins that support them


Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2 years ago
Brian Coca 0ff80a15ba
ssh connection avoid parsiing own debug (#76732)
- Avoids false positives on become strings being echoed back 
   by ssh cli itself
  - added test for debug lines
  - also simplified some of existing test code
3 years ago
Brian Coca 9142be2f6c
Allow specifying specific python via shebang (#76677)
modules with python were always normalized to /usr/bin/python,
  while other interpreters could have specific versions.

* now shebang is always constructed by get_shebang and args are preserved
* only update shebang if interpreter changed
* updated test expectation
* added python shebang test
3 years ago
Matt Clay 7fff408652 ansible-test - Remove azure support for Sherlock. 3 years ago
jkahrs c8dd96b076
fact gathering, prevent "UnboundLocalError: local variable 'datafile' referenced before assignment" when open(path) fails. (#76751)
Co-authored-by: jean kahrs <j.kahrs@hosting.de>
3 years ago
Matt Clay 3a891827b7
ansible-test - Remove AIX provisioning support. (#76747)
* ansible-test - Remove AIX provisioning support.
* Remove `skip/aix` integration test aliases.
* Remove build for AIX binary module.
3 years ago
Matt Clay bab315b780
ansible-test - Add support for FreeBSD 12.3. (#76745)
* ansible-test - Add support for FreeBSD 12.3.
* Use OS package for yaml if available with CLoader.
* Make sure libyaml is available.
3 years ago
Adrian Likins 20cc87f059
Expect upper case message 'levels' for galaxy publish results (#63530) 3 years ago
Amir.M 71f3996778
Added AIX CA certs search paths (#69776) 3 years ago
Matt Clay b1ebc192b5 ansible-test - Update default containers. 3 years ago
Matt Clay d6588293fb ansible-test - Limit paramiko to < 2.9.0 3 years ago
Sloane Hertel 76220c4a7b
ansible-galaxy - fix the --ignore-certs flag for the implicit galaxy server (#76735)
* ansible-galaxy - fix the --ignore-certs flag for the implicit galaxy server

* changelog

* Add a test without the server config

* Fix respecting --ignore-certs for individual --server URLs also

* Update changelogs/fragments/76735-ansible-galaxy-fix-ignore-certs.yaml
3 years ago
Martin Krizek f78deccec2
end_play: end the current play only (#76674)
Fixes #76672
3 years ago
Patrick Hemmer 4a62c4e3e4
apt: add support for package version >= (#75002)
This adds the ability to specify a package version using >=. This will ensure the package is at the specified version or above.

* If the package is not installed, the latest version will be installed.
* If the package is installed and less than the specified version, it will be upgraded.
* If the package is installed and greater than or equal to the specified version, it will be left alone.

The version selection is handled by Apt itself, so things like the system policy, pinning, etc, are considered.
3 years ago
Brian Coca 0b6d3312dd
enable module defaults for implicit gather_facts (#76053)
* deprecated default fact path setting
* subset and timeout on same boat
* avoid pushing module args when none

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
3 years ago
Brian Coca aa022dba2d
ssh connection, handle 'fun' control paths (#76424)
* handle 'fun' control paths by quoting the option when passed to ssh cli

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay b30b8fb79c ansible-test - Set pytest rootdir option. 3 years ago
Matt Clay eaeec8a65c ansible-test - Use `--forked` instead of `--boxed`
The `--boxed` option is deprecated.
3 years ago
Sloane Hertel b17557ae8e
Add check_mode tests for shell/command/script and make skipped=True/changed=True mutually exclusive (#76429)
* Add additional tests for check_mode with shell/command/script
* update check_mode documentation: if a module/action is not skipped in check mode and accurately reflects whether a change is made to the remote support should be 'full'
* Make reporting skipped in check mode mutually exclusive with 'changed: True'
* Add missing documented attributes
* Fix tests to expect skipped=True and changed=True do not occur together
* Fix script check_mode support documentation
* Fix earlier changelog
* document platforms attribute
* Use tasks's check mode since the value from PlayContext does not reflect loop items

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
3 years ago
Emyll Almonte a08bcca934
Update local_mods in git.py to show destination of conflict (#72405)
Git module, specify that the local modification is in the destination directory so that some of the users clearly understand this..
3 years ago
Martin Krizek 094a0746b3
ansible_concat: return strings only unless eval (#76634)
Fixes #76610
3 years ago
Romain Goncalves b984dd9c59
package_facts: Support pkg_info OpenBSD, FreeBSD and NetBSD (#76580) 3 years ago
gongnan 0502a03579
hostname: add support for openEuler distro (#76619) 3 years ago
Matt Clay aa67ff2cf2
Remove shebangs from core Python modules. (#76664)
* Remove module shebangs.
* Relax shebang check in validate-modules.
* Add changelog fragment.
3 years ago
James Livulpi ffd0343670
add systemd alias check (#76608)
* add systemd alias check

* add .yml

* Delete 75538-systemd-alias-check

* Update lib/ansible/modules/systemd.py

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
3 years ago
Brian Coca 4d380dcbaa
More auto info (#76598)
* make auto invenory plugin a bit more informative

* clog
3 years ago
Abhijeet Kasurde 66e392d4e2
user: Update logic to check if user exists in macOS (#76592)
'dscl -list' returns 0 even if the user does not exists. This
leads to errorenous condition in user module.
Using 'dscl -read UniqueID' can return if user exists or not.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
3 years ago
Sloane Hertel 15ace5a854
ansible-galaxy - validate version for directories and collections in git repos (#76579)
* Ensure the version is valid for directories and collections in git repos before installing

Fix the error message for invalid semantic versions

* Make requested changes

* Add a test case for unhandled ValueError exception

* Add changelog

* Update lib/ansible/galaxy/collection/galaxy_api_proxy.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Reword error message

Include link to learn how to compose a semver version

* Move version validation into the caller, find_matches

* Add tests for more invalid version types

* Remove unused import

Fix raising unexpected error

* Update lib/ansible/galaxy/collection/__init__.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Update lib/ansible/galaxy/dependency_resolution/providers.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Update lib/ansible/galaxy/dependency_resolution/providers.py

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
3 years ago
Matt Clay 6e57c8c084 Add missing typing import for _distro.py.
See: 116cdad222/distro.py (L42-L72)
3 years ago
Matt Clay 7e814dd4db ansible-test - Fix plugin loading.
This fixes a traceback when loading plugins that use dataclasses.
3 years ago
Matt Clay d2daa67b00 ansible-test - Fix type hints. 3 years ago
Jaromaz 16def8050a
facts - Set correct OS family for EuroLinux (#76624)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
3 years ago
Jean Raby 594b11dc0c
unarchive: Keep stderr when pick_handler fails (#76365)
* fixes #28977

* Include the original error message when pick_handler fails

* Add a test to unarchive a tar file with an invalid extra option

* add a changelog
3 years ago
James Livulpi eedf2e476c
check for indirect service in systemd (#76462)
* check if service is indirect status / add integration test

* Update changelogs/fragments/76453-indirect-systemd-status.yml

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

* simplify indirect check / remove integration test restriction on rhel9

* add dummy indirect service for integration tests
3 years ago
Abhijeet Kasurde 601d66c7e5
k8s: Migrated scenario guides to collection (#75249)
Kubernetes scenario guides are moved to
``kubernetes.core`` collection.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
3 years ago
bluikko f9c24c2899
Document get_url module check_mode support right (#76433) 3 years ago
Jonathan Neuhauser 49e1cb9f42
unarchive: fix non-english locales (#76542)
* unarchive: fix non-english locales

For GNU Gettext, the LANGUAGE environment variable takes precedence over LANG or LC_ALL. On systems where LANGUAGE was set to a non-english locale, the output of the tar command therefore not understood and the module failed silently ("changed": false, but the archive was not extracted).

* add tests

* changelog
3 years ago
Martin Krizek ac2bdd6834
Fix AttributeError when providing file via --conn-password-file (#76534)
Fixes #76530
3 years ago
Martin Krizek 461f30c160
yum: avoid storing unnecessary cache data (#76345)
Fixes #76336
3 years ago
Matt Clay 4e70156d7e
ansible-test - Code cleanup. (#76540)
* Add missing typing imports.
* Remove unnecessary non-capturing group.
* Whitespace.
* Add type hints.
* Ignore PyCharm false positives.
* Remove Python 2.x plugin loading logic.
* Remove Python 2.x exception handling.
* Remove Python 2.x display logic.
* Add changelog.
3 years ago
Matt Clay 470c89518c ansible-test - Fix delegation from install. 3 years ago
Philippe Kueck aaa10cd506
plugins/dnf, plugins/yum: implement sslverify option (#76356) 3 years ago
Martin Krizek 2058ea5991
Clarify unroll in _finalize (#76436)
Clarifies that unrolling in _finalize is actually necessary. Also using
decorator directly.
3 years ago
Clement Martin bc753c0518
Add openrc support to service_facts (#76373)
* Add openrc support to service_facts

Co-authored-by: Clément Martin <clement.martin@onespan.com>
3 years ago
Matt Clay 16cdac66fe ansible-test - Use ansible-core for docs links. 3 years ago
Matt Clay e56e47faa7 ansible-test - Fix import test for collections. 3 years ago
Matt Clay 82f59d4843
ansible-test - Hide ansible._vendor in import test (#76503) 3 years ago
Matt Clay c45989c76f ansible-test - Remove RHEL 8.4 support. 3 years ago
Matt Clay 97ef1d031c Revert "ansible-test - Fix import test when vendoring."
This reverts commit 33a8d06332.
3 years ago
Jordan Borean 8482ee4e9a
galaxy build - ignore existing MANIFEST and FILES (#76479) 3 years ago
James Livulpi 7830e5308e
add tencentos fact distro (#76459)
Fixes #76459

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
3 years ago
Brian Coca 472028c869
catch the case that cowsay is broken (#76326)
* catch the case that cowsay is broken

fixes https://github.com/ansible/ansible/issues/72582

  add changelog
  raise Exception for broken cowsay
  add test for broken cowsay

Co-authored-by: Matthias Bernt <m.bernt@ufz.de>
3 years ago
Matt Clay 41ee4a5b12 ansible-test - Fix traceback in validate-modules test. 3 years ago
Matt Clay 33a8d06332 ansible-test - Fix import test when vendoring. 3 years ago
Brian Coca 47448f1458
Add 'default' to 'env' lookup (#76327)
* Add 'default' to 'env' lookup

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
3 years ago
Martin Krizek 3fe42e106c
Remove finalize from globals (#76439) 3 years ago
Martin Krizek 4e7be293a5
Properly set finalize for the new environment (#76435)
* Properly set finalize for the new environment

Fixes #76379

* Fix sanity
3 years ago