Commit Graph

31849 Commits (bf00a14f91eddbe26c27fd48edf727087f9be3c4)

Author SHA1 Message Date
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>
4 years ago
Felix Fontein 4baf18c573
Remove more Python 2.x compatibility code from controller. (#77320) 4 years ago
Matt Martz c1a34d5a63
Update systemd strategy to not confuse NetworkManager (#77243)
* Update systemd strategy to not confuse NetworkManager. Fixes #76958

* Add tests
4 years ago
ChanthMiao 34e60c0a7a
ansible_distribution: Add support for Uos/Deepin (#77275)
* ansible_distribution: Add support for Uos/Deepin

* Add changelog fragment.
4 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.
4 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.
4 years ago
Brian Coca 94b73d66d5
inventory manager respect --flush-cache (#77083) 4 years ago
Martin Krizek c9db73f04e
Add a YAML representer for NativeJinjaText (#77282)
Fixes #77280
4 years ago
bluikko 496f51ceac
get_url fix word emphasis on documentation (#77247) 4 years ago
Matt Clay 6f445ca6e5 Remove obsolete Python 2.x controller code. 4 years ago
Matt Clay f68c66a3ef Remove collections compat from controller code. 4 years ago
Matt Clay 822fddd627 Fix yaml loader and compat. 4 years ago
Matt Clay 27923aad7e Add inline type hint ignores. 4 years ago
Matt Clay 2a2b7dc42a Update include role to match the base class.
Use frozenset instead of tuple.
4 years ago
Matt Clay 4867ac217b Code cleanup for type hinting issues. 4 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>
4 years ago
Matt Clay 7c81a652c0 Type hint fixes. 4 years ago
Matt Clay 3a3c496ade Remove obsolete Python 2.x compat code. 4 years ago
Matt Clay 0c4c18bc04 Type hint fixes. 4 years ago
Matt Clay 8b2e628565 galaxy - Clean up type hints and imports. 4 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
4 years ago
Matt Clay 871b2ca73a Simplify existing type hints. 4 years ago
Matt Clay ccdb552d90
More type hint fixes for module_utils. (#77198)
* Type hint fixes for module_utils.
* Fix type hints in module_utils.facts.
4 years ago
hfinucane 86f00bd156
Update example to work (#77191)
`with_first_found` only takes a list of things, it's not like `tags`
where it can take a thing or a list of things.

Inspired by locally discovered breakage and then finding
https://github.com/ansible/ansible/issues/77136 where someone was also
doing this and getting into trouble.
4 years ago
Matt Clay e314f4e666
Add typing to module_utils.compat. (#77197) 4 years ago
Matt Clay 5a1b891917
Additional type hinting cleanup. (#77188) 4 years ago
Martin Krizek 74a204e6f1
first_found: allow spaces in names (#77141)
* first_found: allow spaces in names

Fixes #77136
4 years ago
Matt Clay 1286513947 module_utils - Fix type hinting issues. 4 years ago
Matt Clay 8e45925415 hostname - Use base class on UnimplementedStrategy
This requires moving UnimplementedStrategy below BaseStrategy and Hostname below UnimplementedStrategy.
4 years ago
Matt Clay 35ef2af0ce
Fix type hints and variable usage in modules. (#77184)
* Remove unused variables.
* Fix conflicting variable name.
* Add type hints.
4 years ago
Matt Clay 6de04e8be6 Fix module exception handlers.
Exception handler variable names should not conflict with other variables.

Use Python 2.6+ exception handler syntax.
4 years ago
Matt Clay d31730d781
Fixes for type hinting issues. (#77170) 4 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+
4 years ago
jbpratt 28a278ee48
fix spelling error in details (#77152)
correct inventory_hostname spelling error in include_vars and set_fact
modules

Signed-off-by: jbpratt <jbpratt78@gmail.com>
4 years ago
Matt Clay 43c2c983cc Fix type hints in galaxy. 4 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
4 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>
4 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
4 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
4 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>
4 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
4 years ago
Felix Fontein ff25b51178
Fix example return value in docstring. (#77076) 4 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
4 years ago
gcagle3 c688eb824b
Add basic support for "apt-get clean" operation to apt module (#76758)
* adding apt-get clean functionality

 documentation and example
4 years ago
Martin Krizek 18251f3685
dnf: ensure releasever is passed into libdnf as str (#77024)
Fixes #77010
4 years ago
Matt Martz 3779c1f278
restore inadvertently deleted default for convert_data. Fixes #77004 (#77016) 4 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
4 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.
4 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>
4 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>
4 years ago