* Do not run script in check mode
Fixes#30676
* Reformat script integration test
* Add integration tests for check mode of script module
* Fix name on test
* Cleanup temp file
* win_script integration test syntaxt changes
* Add check mode tests for win_script
* Use proper variable in test
* Fail if source file does not exist
* Verify script is accessible and don't copy in check mode
Use shlex to properly split shell arguments, though a path with spaces in it still needs to be quoted in the playbook.
Add note to docs describing such.
Improve error message if file is not found indicating there may be a space in the path.
* Properly encode path now that path is split using shlex
* Allow for spaces in both path and script name
* Add unicode character test to Linux script tests
* Add Linux test for space in path to script
(cherry picked from commit ea3638b580)
* nxos_config and nxos_facts - fixes for N35 platform. (#32762)
* update nxos_facts to handle errors in n35 platform
* switch show commands to output text
* replace basestring which is not supported in python3
* do it like the other modules: use string_types
* incorporate PR review
(cherry picked from commit 1360ae6518)
* update changelog
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
If an embedded vaulted variable ('!vault' in yaml)
had an invalid format, it would eventually cause
an error for seemingly unrelated reasons.
"Invalid" meaning not valid hexlify (extra chars,
non-hex chars, etc).
For ex, if a host_vars file had invalid vault format
variables, on py2, it would cause an error like:
'ansible.vars.hostvars.HostVars object' has no
attribute u'broken.example.com'
Depending on where the invalid vault is, it could
also cause "VARIABLE IS NOT DEFINED!". The behavior
can also change if ansible-playbook is py2 or py3.
Root cause is errors from binascii.unhexlify() not
being handled consistently.
Fix is to add a AnsibleVaultFormatError exception and
raise it on any unhexlify() errors and to handle it
properly elsewhere.
Add a _unhexlify() that try/excepts around a binascii.unhexlify()
and raises an AnsibleVaultFormatError on invalid vault data.
This is so the same exception type is always raised for this
case. Previous it was different between py2 and py3.
binascii.unhexlify() raises a binascii.Error if the hexlified
blobs in a vault data blob are invalid.
On py2, binascii.Error is a subclass of Exception.
On py3, binascii.Error is a subclass of TypeError
When decrypting content of vault encrypted variables,
if a binascii.Error is raised it propagates up to
playbook.base.Base.post_validate(). post_validate()
handles exceptions for TypeErrors but not for
base Exception subclasses (like py2 binascii.Error).
* Add a display.warning on vault format errors
* Unit tests for _unhexlify, parse_vaulttext*
* Add intg test cases for invalid vault formats
Fixes#28038
(cherry picked from commit 9c58827410)
Fixes#23263
Add a carriage return (\r) at end on copy config
command which results in prompt on cli terminal
(cherry picked from commit 37b0537279)
Update CHANGELOG.md
ensures we get both a templated ignore_errors and a
correct 'summary' result for ignore_errors when used in loops
fixes#32384
(cherry picked from commit d22627d944)
new match(block). It previously only occurred if a new match occurred,
but suggest it should occur when an end of a block match is found.
(cherry picked from commit 7553c42e09)
Update CHANGELOG
* adding the desired state config to the new vrf fixes#32111
* fix default vrf initial configured
* add unit test
* Update CHANGELOG
(cherry picked from commit 2c99cbc874)
* Fix wrong prompt issue for network moodules
Fixes#31161Fixes#32416
* Store the device prompt in case of error
from remote device
* Check for prompt value in ios action plugin
* Add integration test
* Update Changelog
(cherry picked from commit 26583adb58)
Fixes#32343
* Move provider arg spec as part of suboptions
to validate input args against provider spec.
* This handles `no_log` for password arg correctly.
Merged to devel PR #28984
( cherry picked from commit 599fe23ed6 )
* Introspect the management IP on ios_ping (#31571)
On our CI we don't have external connectivity, so let's ping to
the management interface IP.
Also, ignore errors on the expected failures tests.
(cherry picked from commit c75c4cbfc8)
* Remove duped authorize on ios_ping anchored tasks (#31572)
Otherwise, we get warnings.
(cherry picked from commit ac95ecaf13)
* Introspect platform before running ios tests
* Add authorize
* Fix quotes on ios_ping test (#32131)
(cherry picked from commit ca115b0a8e)
* Fix lookup source tests on ios_system (#32254)
In IOS-XE, you need to pass an interface to lookup-source, otherwise
it fails with bad syntax.
(cherry picked from commit 4b35793f62)
* Remove ip nameservers on ios_system/set_name_servers teardown (#32239)
Not sure why lookup source-interface, the only thing tested on that
file is adding/removing name servers, no lookup is set.
(cherry picked from commit 9752ce368d)
* fix conflict
* Update CHANGELOG
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* Remove provider from ios integration test (#31037)
* Remove provider from each task as it is not required.
* Add `authorize: yes` whereever required
(cherry picked from commit 65ab37cbd3)
* CHANGELOG entry for ios tests fix
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* Enable ECHO in prompt module
Fixes#14160
* Set flags to make it possible to edit echoed input as well as hide control charcters
Only do this if a time limit is not set.
* Consolidate settings
(cherry picked from commit 104934c095)