summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins
Commit message (Collapse)AuthorAgeFilesLines
* Fix using loops with environment and add tests (#32796)Sloane Hertel2018-01-241-4/+3
| | | | (cherry picked from commit 7bb35e8781b46cb6024a6e45e76cb663185fe10d)
* Ensure that the become password is written on py3 in the ssh connection ↵Matt Martz2018-01-181-0/+3
| | | | | | plugin. Fixes #34727 (cherry picked from commit 29c1d5cb5d283c649a5bc30dce53b8e4875d01d3)
* Revert "Do not escape backslashes when using the template lookup plugin"Toshio Kuratomi2017-11-091-2/+1
| | | | | | | This reverts commit 2b40463a48cb0e4db576cb3775110df6c07a1c3a. Decided that this change was too big for a bugfix release. Make it 2.4.x only.
* Fix password leak in logs for provider argument (#32215)Ganesh Nalawade2017-11-0310-6/+49
| | | | | | | | | | | | | | | | | | | * Fix password leak in logs for provider argument Since provider argument is not validated against a spec the `no_log` arguments are not handled leading to password leaking to syslogs. To fix this: * Mask password and other `no_log` provider arguments in action plugin * In case of eapi and nxapi as the password is used in module code, * copy the provider password to top-level password argument which * handles `no_log` correctly. This will, however, throw a deprecation * warning message for password arg even if it is not given as a * top-level argument. * Remove auth details from provider args in action plugin * Update CHANGELOG
* fixed become to show the stdout and stderr streams instead of the ↵Jordan Borean2017-09-141-1/+1
| | | | | | StreamReader (#30254) (cherry picked from commit 77b2aca5a2657e16ab6a236b43a8122164e3b574)
* Create a new pipe for sshpass on retries. Fixes #29095Matt Martz2017-09-111-0/+6
| | | | (cherry picked from commit d043ba2673d20eb84b2d1d895c0e8033ec9b303e)
* Fix py3 string issue in jail connection plugin (take 2) (#28374)Pierre Guinoiseau2017-09-091-13/+4
| | | | | | * Fix py3 string issue in jail connection plugin (cherry picked from commit 436b173b24dd88ec77e12596fb9403142e6e08fd)
* Ensure proper conversion while backing up of junos config (#28958) (#28992)Ganesh Nalawade2017-09-041-2/+3
| | | | | | | | | | | * Ensure proper conversion while backing up of junos config * Minor changes * Fix review comment * Open config backup file in binary mode (cherry picked from commit cc9ed352dd547b19439cb5c9373f8529e6385314)
* Fix encoding error on grp.gr_name, which can contain non-ascii chars at ↵Sergey Scherbakov2017-09-011-2/+2
| | | | | | | | | | domain PCs (#25804) * Fix encoding errors on grp.gr_name, which can contain non-ascii character at LDAP/AD domain workstations * fix: utils.to_text() is now used instead of py3-incompatible unicode() method (cherry picked from commit c16d258a27d73a31a577f02fdcbcdadd78fb2d95)
* Junos_config unicode (#23369) (#28913)Ganesh Nalawade2017-09-011-2/+2
| | | | | | | | | * Try to handle unicode output more sensibly * Appears I'm getting latin1 instead Ugh. (cherry picked from commit 689b93bf145a48bf641705a00c5d1996e3dc45dc)
* allow pesky 'bridge' facts to bypass facts filter (#28401)Brian Coca2017-08-291-1/+2
| | | | | | | | | | * allow pesky 'bridge' facts to bypass facts filter fixes #27729, #23577 * I ate pepe (cherry picked from commit c06f8a3f9b7eccffe88e18c2b6814536996d172b)
* Fix zip filter for Python3Andreas Olsson2017-08-141-11/+5
| | | | | | | | Using the now bundled six library. Fixes #28117 (cherry picked from commit c9cdc3a259973bfcc425260520e34fa59b6f8acb)
* the smart transport is broken by ssh retry codeToshio Kuratomi2017-08-141-4/+10
| | | | | | | | | | | | | | | | | | | | 1fe67f9 introduced retries to the ssh connection put file and fetch file. Unfortunately, that change broke the smart transport because it started raising exceptions instead of returning from _run(). This breakage is documented in #23711. An attempt to fix it was made at #23717 but the first attempt was objected to as needing to touch too much code. The second attmept was objected to as smart was forced to encapsulate retries (thus retrying a sftp "rety" times before trying scp "retry" times and then finally moving onto piped). This third attempt has retries encapsulate smart. So each sub-transport is tried once and if all three fail, another retry attempt is made which tries each of the three again. Fixes #23711 Fixes #23717 (cherry picked from commit 3edac559d3b74848fb7b61879592338a890c9958)
* fix unicode errors in iosxrDavid Newswanger2017-08-071-2/+2
| | | | (cherry picked from commit 0b5b5ec50a51740288ce2d9cf826e262135bd291)
* Fix the pause module for python3Toshio Kuratomi2017-08-071-14/+21
| | | | | | | | | | | | | | | | | | * On python3, stdin goes through a buffer that translates from raw bytes to text. this interferes with pause as it (1) performs universal newline conversion and therefore '\r' is turned into '\n' and (2) the buffering prevents us from getting the typed characters immediately (possibly a python3 bug?) Using the raw byte stream that's behind the text decoder fixes these problems. Unrelated cleanups: * Use to_text instead of str for conversion into strings to avoid possible tracebacks * Use either \r or \n as the end of a line. Fixes #26278 Resolves #26446 (cherry picked from commit 5ceabe939d0820e7b6a5938ab689064a03ed1d9b)
* Do not escape backslashes when using the template lookup pluginToshio Kuratomi2017-08-071-1/+2
| | | | | | | | This brings the lookup plugin inline with what the template module does. Fixes #26397 (cherry picked from commit cf5fb0acdf37e710fd3a4dc0780defa1a56789dc)
* Fix synchronize setting user variableToshio Kuratomi2017-08-071-9/+9
| | | | | | | | | | The user variable stores whether we need to set user@ in our connection string. It's now being used at the toplevel of the run() method so the default needs to be calculated further up the stack Fixes #24910 (cherry picked from commit 6908038036667a725aac09c62fadb4fe03cfda7e)
* make random_choice more error resilient (#27380)Brian Coca2017-07-311-1/+9
| | | | | | | | * make random_choise more error resilient fixes #27373 (cherry picked from commit b79744f2823f972764cdda178d4d220ff0358fdc)
* ensure prefix in plugin loading to avoid conflictsBrian Coca2017-07-311-5/+10
| | | | | | | | when using 'all' to load all plugins were ending in main namespace creating conflicts with each other and random modulesr i.e. when trying to access json callback we were getting json 'parsing' lib (cherry picked from commit b93b9e68d71adb4f8688da4be2230af9317e9c62)
* Fix error with `meta: clear_facts` (#26406)Jean-Frédéric2017-07-281-1/+2
| | | | | | | | | | Using `meta: clear_facts` was failing with `coercing to Unicode: need string or buffer, Host found` This applies the same fix as 3101e24. Fixes #26405 (cherry picked from commit 23041c3b6cc40d9f7fd325afb924448aa91fdf38)
* better reading of 'facts'Brian Coca2017-07-262-4/+2
| | | | (cherry picked from commit c7e841e0e4b4db9a5c0e0bab685b825196bbf36d)
* include_role handlers bug fix (#26335)Will Thames2017-07-252-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * Ensure that include_role properly fires handlers include_role needs to ensure that any handlers included with the role are added to the _notified_handler and _listening_handler lists of the TaskQueueManager, otherwise it fails when trying to run the handler. Additionally, the handler needs to be added to the PlayIterator's `_uuid_cache` or it fails after running the handler Add more uuid debug statements - this code was hard to debug with existing debug statements, so add more uuid information at little additional output cost. Fixes #18411 * Add tests for include_role handlers Tests for #18411 (cherry picked from commit ef8c9798d3399605284f3357069769b67330fd81)
* Fix for to_text and to_bytes error handlersToshio Kuratomi2017-07-241-3/+3
| | | | | | | | | | | | | | | | | * surrogate_then_strict doesn't exist. Switch to surrogate_or_strict instead. * Found some bugs in the _text.py implementation * The composed error handlers (error handlers which are made up of two or more python encoding error handlers) had a wrong string in it, 'surrogate_or_escape' doesn't exist. Replaced that with 'surrogate_or_replace' which is the correct handler name. * Left comment about the implicit conditions that are part of the surrogate_then_replace code path Fixes #23865 Fixes #23861 (cherry picked from commit fc5d71de0da187658899cf12e0a6b3cdb210f5fc)
* converted become runas to explicit CreateProcessWithLogonWMatt Davis2017-07-031-47/+319
| | | | | | | | | * fixes become_method: runas for unprivileged users * sets permissions on tempdir appropriately * allows automatic system environment generation for new token (old Process.Start way prevents this) * add basic become runas tests (cherry picked from commit 6d99a0a93469448a2fd23169e31036263102e7e1)
* re-enable non-pipelined mode for Powershell (#26124)Matt Davis2017-06-263-36/+38
| | | | | | * fixes #23986 * fixes 3rd-party Windows connection plugins that don't support pipelining (eg awsrun) (cherry picked from commit 6677559c698f15c582fba80d866f46458848f974)
* backported delegation/facts fix, see #25880Brian Coca2017-06-191-1/+1
|
* fix KeyError on eAPI transport for use_ssl and validate_certs (#25788)Trishna Guha2017-06-161-3/+3
| | | Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* add validation to fetch for source/destBrian Coca2017-06-131-3/+10
| | | | | | also added missing display (cherry picked from commit c4169d93e8caf00034c59a42f50b513878157ad8)
* Convert docker cmd output to native, earlyMatt Martz2017-06-101-3/+3
| | | | (cherry picked from commit 23eebb62e661d560085ef84096c310ccd144b94d)
* Also check the iterator for failed host status in linear strategyJames Cammarata2017-05-231-1/+1
| | | | | | | | | | When only looking at the failed state of the TaskResult, certain failures cause the linear strategy to fail out sooner than it should and not execute the always portion of blocks. Fixes #24301 (cherry picked from commit f217dae938dd451d32c54643ae98020cc592e63d)
* Include error exception in AnsibleErrorAbhijeet Kasurde2017-05-235-8/+15
| | | | | | | - Use to_native instead of str Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit f9b836a9010b760e7076bf1b78089e994d0372ce)
* Base changes required to allow winrm to work on py3 (#24744)Matt Martz2017-05-181-2/+2
| | | | (cherry picked from commit e7d8ebf08038c672a6f9397cc9b9a66465af5547)
* Convert some more base64 strings to text for winrm, to support async and ↵Matt Martz2017-05-181-2/+2
| | | | | | become (#24796) (cherry picked from commit 1eed6c5b3d01822ab5e19ea8ab743edf27bebf71)
* Fix for ansible/ansible-modules-core#1568Adam DeConinck2017-05-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checksums of local and remote files match, and when follow = True, determine if remote destination is a symlink. If so, de-reference it and pass the link target to the file module as 'dest'. This change fixes an edge case in file copy behavior when: - 'dest' is a symlink to some other file ('realdest') - follow = True - the checksums of the source file, 'src', and the symlink target, 'realdest', match. Because the checksums match, the copy module is skipped and the file module is invoked directly with 'dest' = the symlink, and 'src' = the source of the copy module, whether that source is present on the target machine or not. When 'src' doesn't exist on the target machine, this leads to an error that looks like this because it can't change the target of the symlink: TASK [copy] ******************************************************************** fatal: [192.168.56.101]: FAILED! => {"changed": false, "checksum": "f572d396fae9206628714fb2ce00f72e94f2258f", "failed": true, "gid": 1000, "group": "ajdecon", "mode": "0777", "msg": "src file does not exist, use \"force=yes\" if you really want to create the link: /tmp/issue1568/dest_dir/source", "owner": "ajdecon", "path": "/tmp/issue1568/dest_dir/dest", "size": 8, "src": "source", "state": "link", "uid": 1000} When the path 'src' *does* exist on the target machine, the file module makes this the symlink "dest -> src" instead of "dest -> realdest"... even if the checksum of 'src' on the target machine is different from the checksum of 'src' on the machine where Ansible is running. (cherry picked from commit 2f74f6738d2e147fa1642924220d749de7ebedad)
* Avoid default serialization of classes in dump_attrsJames Cammarata2017-05-171-2/+1
| | | | | | | | | | | | | | | For playbook base objects, when dumping attributes via dump_attrs() an attribute like loop_control is a class. Using the default serialization for these is slow and consumes a lot of memory. Since LoopControl is also based on the Base class, we can use serialize() instead and save a lot of resources. This also adds a from_attrs() complimentary method to nicely turn the dumped attrs back into proper field attributes. Fixes #23579 (cherry picked from commit 78478e80ea01c2d752af5abdfbf3f744bfd188ac)
* Use delegated vars for the delegated host nameJames Cammarata2017-05-161-5/+7
| | | | | | | | | | | | In _process_pending_results (strategy/__init__.py), we were using the delegate_to field directly from the original task, which was not being templated correctly. As an alternate to #23599, this patch instead pulls the host name out of the delegated vars passed back in the task result dictionary to avoid having to re-template things. Fixes #23599 Fixes #20508 (cherry picked from commit e5cd675b38d49b22f1ecc929943d016fb7159856)
* Fix template not showing a diff with a directoryToshio Kuratomi2017-05-111-2/+7
| | | | | | | | | | | Template can take a directory as the destination. When that's the case, we need to diff between the source and the file inside of the directory. That happened when the directory was specified with a trailing slash but not when it was specified on its own. This change fixes that. Fixes #24413 (cherry picked from commit 548cacdf6a28a708142c4a2e4ed1ecba8102b60a)
* deal with null/none connectionsBrian Coca2017-05-111-3/+7
| | | | | | | | fixes #23621 pushed 'connection resolution' to play_context override fieldattribute getter (cherry picked from commit c50cf22d521d4d2efcdf45283f868f035ff44cef)
* fix spurious warnings with ansible_winrm_kinit_X args (#24380)Matt Davis2017-05-081-2/+2
| | | | | | | * added to pywinrm arg whitelist * clarified error text on kinit_mode error * fixes #23822 (cherry picked from commit 98ff93b2dbc9370649294b873a448db47236cd9f)
* include_vars to delegated only if delegate_facts (#24259)Brian Coca2017-05-031-12/+6
| | | | | | | | | | * include_vars to delegated only if delegate_facts fixes #24172 * since code is now same, simplified (cherry picked from commit b731c2d8092934e48053ae9f90a35d998e89cf5d)
* Fix password prompt matching (#24081)Matt Martz2017-05-011-4/+2
| | | | | | | | | | * Fix password prompt matching * Add some tests for check_password_prompt * Prevent pep8 line ends with a space error (cherry picked from commit 040fb4435a570d7cf807b9a947d2bd0b331c1eb3)
* Minor typo correction varibles -> variablesNick Piper2017-05-011-1/+1
| | | | | No impact as variable wasn't used. (cherry picked from commit 403c1427509eda68c36d9da7276dba944cd0fa49)
* Print specific error for BadHostKeyException (#24120)Nathaniel Case2017-04-281-0/+2
| | | | (cherry picked from commit f9ec06d1dcdef5675a3c4b190bee45d8132f3fa6)
* Set validate_checksum default yes of fetch to match the docKeepZero2017-04-261-1/+1
| | | | (cherry picked from commit 98e7d4b49d1d6755da3d385d6496f22a6f85c1e8)
* moved to exceptions for basic skip/failsBrian Coca2017-04-257-25/+4
| | | | | | | better handling of checkmode and async fix test to follow new flow control (cherry picked from commit e29dc49a49eb042cb2f707eb8e9e030a718677ed)
* Set terminal width for network *_command modules to avoid paging (#23728) ↵Trishna Guha2017-04-256-6/+10
| | | | | | (#23952) Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> (cherry picked from commit f354bd1eab5857648b15f920e0cf8e4203c7f333)
* fix environment populated detectionBrian Coca2017-04-211-1/+1
| | | | | | fixes #23764 (cherry picked from commit 27185f44b07558589819f55333eab40841e00be0)
* Remove catch-all regex on IOS terminal plugin (#23858)Ricardo Carrillo Cruz2017-04-211-1/+1
| | | | | | | | | | | | We have a list of specific messages that we scree-scrape and flag them as legit errors. However, we also have a catch-all regex that matches everything starting with %. That can cause issues on commands that return lines with that character, like for example the 'crypto key generate'. Fixes #23770 (cherry picked from commit 8517fbf9361269ecc3525ab1b8d861a7447ac6ae)
* script fails on asyncBrian Coca2017-04-201-3/+1
| | | | (cherry picked from commit fe9af903f3a20d63ca0793c1e0d3b65c858caeb7)
* finer grained failed/skipped on async for actionsBrian Coca2017-04-206-9/+9
| | | | | | fixes #23729 (cherry picked from commit 3965689328a97471afd21a3cdeabdd7c56d83a42)