Commit graph

4052 commits

Author SHA1 Message Date
Brian Coca 50b6d28ee1
Config init+ (#74914)
Can now specify plugin/plugin type for list and dump actions
 New 'init' action to create usable config sources 

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-22 12:21:59 -04:00
David Shrewsbury 703cb79442
Implement async callbacks (#74953)
* add changelog and output from default callback
* add test
* add comments about TE task
2021-06-22 12:19:32 -04:00
Sloane Hertel ca6123e0ee
Template suboptions in a role's arg spec (#75073) 2021-06-22 17:24:02 +02:00
Junegunn Choi 8e755707b9
Add 'hash_behaviour' option to include_vars module (#72944) 2021-06-22 09:29:53 +05:30
Ikko Ashimine 38a11c3240
Fix typo in default_callback.py (#75051)
Changed beggining -> beginning
2021-06-18 10:01:11 +05:30
Sam Doran be0cdc0ea2
deprecate _remote_checksum() and remove use in fetch (#74848)
* Remove use of _remote_checksum from fetch module
* Add deprecation message displayed during runtime
* Increase test coverage for fetch
* Add tests covering the use of stat from the fetch module

    This required creating an unpriveleged user account and connecting as that user remotely since
    it is not possible to create a file that the root user cannot stat.

* Use fact caching to persist remote tmp dir across playbook runs
* Add variables to setup_remote_tmp test role to allow caching of the remote temp dir fact
  and preventing removal of the remote_tmp_dir
2021-06-16 13:51:07 -04:00
Brian Coca 5a5a1882d4
Added FAQ entry for complex validation needs (#74707)
* Added FAQ entry for complex validation needs

* updated validate docs

* fix

* longline

* Apply suggestions from code review

Co-authored-by: Sandra McCann <samccann@redhat.com>
2021-06-16 13:43:01 -04:00
Manuel Gutierrez 4cb20f577b
Fix env lookup docs typo (#75022)
- Fixed "impossbile" typo
2021-06-16 10:00:15 -04:00
Brian Coca 79a0799082
fix typo in host_group_vars config (#75012)
* no need to deprecate, not used directly

  it just documents the use of the setting in loader
2021-06-15 18:03:01 -04:00
Jordan Borean 58d8397771
psrp - cleanup command (#74985) 2021-06-15 07:33:56 +10:00
Brian Coca 77e936bd50
async_status revert most changes, keep some fixes, undep module (#74931)
* revert most changes, keep some fixes, undep module

  too many corner cases, reverting major changes for controller
  side processing.
2021-06-14 16:39:59 -04:00
Jordan Borean cf3a304ce1
psrp - Fix reset connection on failed scenarios (#74967)
* psrp - Fix reset connection on failed scenarios

* Update psrp-reset.yml

* Update changelogs/fragments/psrp-reset.yml

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

* Update changelogs/fragments/psrp-reset.yml

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

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-06-12 12:01:23 +10:00
Brian Coca 675df166c2
fix ssh_transfer_method/scp_if_ssh defaults (#74925)
* fix ssh_transfer_method/scp_if_ssh defaults

  fixes #74922

* clog
2021-06-10 15:22:41 -05:00
s-hamann e2658801f6
Add seed parameter to password lookup (#69775) 2021-06-04 12:20:44 -04:00
Brian Coca 26827f5039
ansible-doc fix displaying 'CLI' options for plugin docs
cli options will now display either use provided info, or automating from the name


Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
2021-06-04 10:22:39 -04:00
Martin Krizek 4f3ee4624e
Add end_batch meta task (#74899)
* Add end_batch meta task

* Add note

* Fix sanity
2021-06-04 05:17:19 +10:00
Brian Coca 9c718ccc42
Async status rewrite
-  remove need for module (at least for posix side)
  - adds retry with backoff on fetching file, since
    race is bigger since we don't spend time on module
  - now gives more info on fail
  - also made actionfail/skip handle results if given
2021-06-03 09:54:40 -04:00
Martin Krizek e201b542be
Ensure end_play ends play, not batch (#74332)
* Ensure end_play ends play, not batch

Fixes #73971

ci_complete

* Preserve result

* Move AnsibleEndPlay to TQM

* Add tests

* Add changelog

* Explaining comment

* Fix changelog name

* ci_complete
2021-06-03 09:26:22 +02:00
Ian Wienand fe20546d36
first_found: clear up the skip option usage (#74816) 2021-06-03 11:41:46 +05:30
David Lee Whiteside 805799ac8b
add pkcs11 support to Ansible ssh connection module (#32829)
* rebased with upstream

* removed extra usetty as it wasnt needed, style changes, added var option setable by inventory for pkcs11

* update pkcs11_provider version_added

* Update lib/ansible/plugins/connection/ssh.py

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* Update lib/ansible/plugins/connection/ssh.py

Correct logic for a password being required for pkcs11_provider

Co-authored-by: Jordan Borean <jborean93@gmail.com>

* style nit fixes for checking pkcs11_provider is set

* fixed duplication when using password_prompt with pkcs11_provider

* added changelog fragment

* added changelog fragment

Co-authored-by: David Whiteside <david.whiteside@nrel.gov>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
Co-authored-by: Jordan Borean <jborean93@gmail.com>
2021-06-02 12:32:43 +10:00
Martin Krizek 01ab6c6ec7
Apply display_failed_stderr on loop item results (#74865) 2021-06-01 11:31:46 -04:00
Rukmangathan e0558ac193
yum action plugin: 'use' as an alias of 'use_backend' (#70792)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: rukmangathan <rukmangathan.annadurai@gigamon.com>
2021-05-31 09:48:15 +05:30
Sloane Hertel 5640093f1c
Use the module redirect_list when getting defaults for action plugins (#73864)
* Fix module-specific defaults in the gather_facts, package, and service action plugins.

* Handle ansible.legacy actions better in get_action_args_with_defaults

* Add tests for each action plugin

* Changelog

Fixes #72918
2021-05-27 19:06:45 -04:00
Brian Coca a5a13246ce
ssh remove unused/unusable cli option ssh_args (#74846) 2021-05-27 17:16:54 -04:00
Abhijeet Kasurde ae50d05182
ini: Add parameter to allow no value (#74806)
ConfigParser allows to read key with no value.

Fixes: #50594

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 11:12:38 +05:30
Matt Clay e5c3f6ce99 Revert "aync_status rewrite (#74577)"
This reverts commit b6de1984db.
2021-05-26 11:37:58 -07:00
Brian Coca b6de1984db
aync_status rewrite (#74577)
remove need for module (at least for posix side)
2021-05-25 12:34:38 -04:00
Matt Martz df5ce3e672
Remove deprecated cache support from script inventory plugin (#74813) 2021-05-25 11:35:46 -04:00
Abhijeet Kasurde 870f943365
docs: Update Python 2 doc links (#74633)
* docs: Update Python 2 doc links

Update links from Python 2 to Python 3

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

* use docs.python.com/3/ everywhere, except onethat should remain 2.6

* refer to python 3 in module docs and comments

* format two python docs links as list

* updates links in unwanted.py test file

* per matt clay, this should link to python 2

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-24 15:11:26 -04:00
Abhijeet Kasurde 1bd7dcf339
encrypt: add new paramter 'ident' (#74595)
Add a new parameter `ident` for specifying version of BCrypt
algorithm. This parameter is only valid for `blowfish` hash type.
2021-05-24 11:46:37 -04:00
Matt Martz bc48eba896
Remove deprecated include vartags usage (#74780)
* Add clog frag
* Remove ignore
2021-05-20 15:32:52 -04:00
Sam Doran 71e33d2578
version test - improve message when value is empty (#74754)
When an empty value is provided, no `version` attribute will exist on the `LooseVersion` or
`StrictVersion` object. We catch and handle this, but it's not immediatebly clear that an
AttributeError means an empty value was provided.

Specifically handle the case where value or version are empty and add more
helpful error messages.

Add integration tests.
2021-05-20 11:55:30 -04:00
Sam Doran d8e6f21d9f
ini lookup - add case sensitive option (#74630)
* Add tests for case-sensitive option
* Run all test playbooks from a single file
2021-05-17 11:41:23 -04:00
Sam Doran 0affe4d027
ini lookup - catch and handle duplicate key and missing section errors (#74629)
* Remove unused import
* Add integration tests for errors
* Cleanup formatting on existing tests
* Add changelog
2021-05-12 16:57:02 -04:00
Brian Coca 2c93b22043
use self.host which will always be updated (#74574)
* use self.host which will always be updated

  pc remote_addr is not correctly updated in all cases
2021-05-11 14:49:56 -04:00
Matt Martz 8d1cf7f266
Vendor distutils.version (#74644)
* Vendor distutils.version

* Fix import order. ci_complete

* remove distutils warning filter

* Don't remove warnings filter from importer

* ci_complete

* Add pylint config for preventing distutils.version

* Add changelog fragment
2021-05-11 12:33:51 -05:00
Felix Fontein 60a03a0f87
Add missing 'why:' to 'deprecated:'. (#74639) 2021-05-11 17:19:59 +02:00
Shane St Savage df6554c4ec
fix: action _fixup_perms2 macos +a remote_paths in list() as it can be a tuple (#74613)
* fix: action _fixup_perms2 macos +a remote_paths in list() as it can be tuple

in `lib/ansible/plugin/action/__init__.py`'s `_fixup_perms2`,
`remote_paths` can be a list or tuple. however, the macos
specific attempt to use chmod +a attempts to concatenate
`remote_paths` with a list, which will fail if it is a tuple.
wrapping `remote_paths` in `list()` fixes this error.

* Update changelogs/fragments/74613-actionfixup_perms2_macos_remote_paths_ensure_list.yml

Co-authored-by: Rick Elrod <rick@elrod.me>
2021-05-11 17:08:33 +02:00
Sam Doran 55b401a3e7
pause - ensure control characters are always set appropriately (#74568)
* pause - ensure control characters are always set appropriately

On some systems, curses.tigetstr() returns None, which does not work as a control character.

* Add unit tests

* Sort imports

* Skip on older Python

This is an action plugin and only runs on the controller, so no need to test of Python 2. Making
the import hackery work on Python 2 would required some more work which I am not sure is
worth it since we are moving away from Python 2 support on the controller.

* Make the tests work on Python 2 and 3
2021-05-06 15:09:26 -04:00
Sloane Hertel aea0c4dd1b
Fix inventory cache prefix typos (#74523)
* Fix section for inventory cache prefix

* Redirect general config inventory cache options to inventory plugin documentation

* Update the template to fix the docs-build error

* removes 'default' entries for config settings with default: ''

* single backticks => italics, double backticks => code

* use 'Default: ~' to match other entries that have no default setting

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
2021-05-05 13:27:40 -04:00
Brian Coca 30912b6a47
dont specify default for port, allow ssh/config (#74526)
* dont specify default for port, allow ssh/config

 also added general note on how defaults work.

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
2021-05-04 11:09:05 -04:00
Harm Geerts 9bd70045c9
Fix BaseFileCacheModule#keys to respect prefix (#72789)
* Fix BaseFileCacheModule#keys to respect prefix

Change:
- Previously BaseFileCacheModule#keys would return keys with the cache
  prefix. These keys are impossible to retrieve from the cache without
  removing the prefix or using the cache without a prefix.
  Now it removes the prefix from the key and only returns keys that
  share the same prefix as the cache.

Test Plan:
- New unit tests

* Add explicit BaseFileCacheModule#keys test

Test that files that do not match the cache prefix are ignored.
Test that the prefix is removed from the cache key.
2021-04-30 15:28:28 -04:00
David Shrewsbury f1a5c411d9
Fix sequence lookup message and add tests (#74472)
* add test for bad kv arg value
* add simple form parsing tests and make error messages the same
* add changelog
2021-04-29 15:12:23 -04:00
Sam Doran 74b2add460
paramiko_ssh - mark connection as connected when successful (#74459)
* Remove unused import from test
2021-04-29 15:11:02 -04:00
Wojciech Sciesinski f40ab25909
Improve a documentation of the first_found lookup plugin (#73080)
Co-authored-by: Wojciech Ściesiński <wojciech.sciesinski@huuugegames.com>
2021-04-29 10:02:21 +05:30
antonc42 c63b867836
fixed URL for becoming an unprivileged user doc (#74448) 2021-04-28 16:14:56 -05:00
Brian Coca 3cff54d69b
Fix missing delegate display (#74370)
* dont rely on vars, task already gives us info
* ensure we always display delegation in host label
* also added parens with ansible_host to show  target host vs resolved host
* delegating to self is not delegating
* delegated vars restoration for backwards compat
* tests need mock task with delegate_to
2021-04-28 13:24:38 -04:00
Martin Krizek 68accca995
Remove needless get_next_task_for_host calls (#74174)
Called with `peek=True` and the return values are not used.

ci_complete
2021-04-28 13:19:37 +02:00
Alex Domoradov bacede7a2b
Update first_found documentation (#70502)
* import_tasks do not work with loop. We should use include_tasks instead
* update documentation
2021-04-27 13:53:21 -04:00
Brian Coca d8fa2b50d5
Fix world readable setting (#74324)
* Fix world readable setting

   now uses shell option in all cases, the old constant still exists
    as 'documentation' but it not settable.
   also fix the docsite link in warnings/errors

* fix typose#

* fix comment#

* added deprecated to config

* missing :

* import cleanup
2021-04-26 12:49:59 -04:00