Commit graph

33293 commits

Author SHA1 Message Date
Toshio Kuratomi
52d2245b26 Keywords docs (#32807)
* Fixup keyword dumping

* Clarify introductory text
* Turn links in the keyword description into seealso entries in the rst.

* Have plugin_formatter cleanup trailing whitespace

The indent filter in jinja2 < 2.10 indents blank lines by default which
leads to trailing whitespace.  Cleanup after that filter.

* Edits

* Copy edit

(cherry picked from commit e07cbb033f)
2017-11-10 17:11:28 -08:00
Adrian Likins
29bdd0b326 Better handling of malformed vault data envelope (#32515)
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)
2017-11-10 14:31:32 -05:00
Brian Coca
58d37124d9 avoid chroot paths (#32778)
* avoid chroot paths in entity names when loading host_group_vars

fixes #32764

(cherry picked from commit e7941b0d4e)
2017-11-10 13:27:57 -05:00
Ganesh Nalawade
5944a447f7
Fix ios_config file prompt issue (#32744) (#32780)
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
2017-11-10 20:32:35 +05:30
Ganesh Nalawade
eb4c5936f3
Fix junos netconf port issue in integration test (#32610) (#32668)
(cherry picked from commit 6d1d06e0f7)
2017-11-10 20:32:06 +05:30
Jordan Borean
ac1538ac74 Updated changelog for vmware logon error handling 2017-11-10 16:25:30 +10:00
Abhijeet Kasurde
64f75fc2d3 Add error handling for user login (#32613)
This fix adds additional error handling for vmware connect
method, where username provided user does not have required
permissions to use/login ESXi.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 80967380d3)
2017-11-10 16:23:59 +10:00
Abhijeet Kasurde
80c275a371
Move resource pool login to a separate function and fix undefined var reference (#32674)
(cherry picked from commit 932f62ab57)
2017-11-10 06:20:31 +00:00
Abhijeet Kasurde
65ed70955d
Get the moid in a more failsafe manner (#32671)
(cherry picked from commit eca4897a08)
2017-11-10 06:18:47 +00:00
Abhijeet Kasurde
fa23f30762
vmware_guest: refactor spec serialization (#32681)
* Refactor spec serialization so that native types are evaluated last.
* Remove redundant type checks

Fixes #30818

(cherry picked from commit ada404d0ac)
2017-11-10 01:27:00 +00:00
Jordan Borean
32c1953df0 Updated changelog for win_copy fix 2017-11-10 06:38:57 +10:00
u625030
612d9e04d7 Update win_copy for #32677 (#32682)
* Update win_copy for #32677

enable large zip file support in win_copy

* Update win_copy.py

(cherry picked from commit 6d597ac05a)
2017-11-10 06:36:55 +10:00
Toshio Kuratomi
df04fde6c3 Add the change to when we escape backslashes (for the template lookup plugin) to changelog
This was slated for 2.3.3 but after talking with kustodian we decided it
wasn't appropriate for a minor release.  So 2.4.0 is where it appeared
2017-11-09 10:22:29 -08:00
Toshio Kuratomi
db54b0fb25 New release v2.4.2.0-0.3.beta3 2017-11-08 16:41:38 -08:00
Matt Clay
c994819fcf Changelog entry for script inventory plugin fix. 2017-11-08 10:59:38 -08:00
Chris Meyers
f00f2466d4 tests for InventoryModule error conditions (#31381)
* tests for InventoryModule error conditions

* modified unicode in tests to ahear to Ansible best practices

* flake8 fixes

(cherry picked from commit cf938e9992)
2017-11-08 10:56:19 -08:00
Martin Krizek
95bd052c4e Add changelog entry for the stdin py3 fix 2017-11-08 12:04:24 +01:00
Jan Pazdziora
000df969dc Fix #31694: running with closed stdin on python 3 (#31695)
(cherry picked from commit e5dbf63b65)
2017-11-08 12:02:33 +01:00
Brian Coca
aa54a3510f handle ignore_errors in loop
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)
2017-11-07 19:53:18 -05:00
Kevin Zhao
24743e5cdc cherry-pick changes of azure_rm_common from devel to 2.4 (#32607)
* remove explicit provider reg from azure_rm (#31369)

* now that it's handled automatically as of msrest > 0.4.9

* add user-agent to Azure API calls (#31872)

* addi Ansible user-agent in Azure API calls

* fix import error

* add user agent for cloud shell (#32332)
2017-11-07 14:56:09 -08:00
Ryan S. Brown
e9b5e14764 [cloud] sns_topic: Fix unreferenced variable
Cherry-pick of 4e759a9cce
2017-11-07 09:55:26 -05:00
Toshio Kuratomi
f9e16d7072 Added urls python3 fix to changelog 2017-11-06 09:23:17 -08:00
David Hain
97c3037206 Use to_native when validating proxy result (#32596)
* Use bytes directly instead of converting to text
(cherry picked from commit 708829fab9)
2017-11-06 09:22:17 -08:00
Sloane Hertel
793c473fe2 Use region derived from get_aws_connection_info() in dynamodb_table to fix tagging bug (#32557) 2017-11-06 08:49:09 -05:00
Martin Krizek
29cf375157 Add changelog entry for the yum locale fix 2017-11-06 11:32:42 +01:00
Martin Krizek
36bcab8a68 yum: use the C locale when screen scraping (#32203)
(cherry picked from commit a8ab1a0b20)
2017-11-06 11:31:32 +01:00
Martin Krizek
274503991e Add changelog entry for git archive fix 2017-11-06 11:30:52 +01:00
Martin Krizek
d8bfed678c git: fix archive when update is set to no (#31829)
(cherry picked from commit e3a847a142)
2017-11-06 11:28:46 +01:00
Toshio Kuratomi
0796190053 Prefer the stdlib SSLContext over urllib3 context
We do not go through the effort of finding the right PROTOCOL setting if
we have SSLContext in the stdlib.  So we do not want to hit the code
that uses PROTOCOL to set the urllib3-provided ssl context when
SSLContext is available.  Also, the urllib3 implementation appears to
have a bug in some recent versions.  Preferring the stdlib version will
work around that for those with Python-2.7.9+ as well.

Fixes #26235
Fixes #25402
Fixes #31998

(cherry picked from commit 725ae96e1b)
2017-11-04 13:11:45 -07:00
patlachance
309dbecbc7 iam.py: return iam.role dict when creating roles (#28964)
(cherry picked from commit 45e35be4c1)
2017-11-03 10:07:21 -04:00
Dmitry Marakasov
20764e248e Documentation typo fixes (#32473)
(cherry picked from commit 843fba509f)
2017-11-02 19:40:09 -07:00
Toshio Kuratomi
0617ac1f24 Add changelog entry for inventory nonascii paths fix 2017-11-02 19:32:12 -07:00
Toshio Kuratomi
07fa571502 Fix non-ascii errors in config manager
(cherry picked from commit d166bba126)
2017-11-02 19:32:12 -07:00
Jordan Borean
f76e8a8e39 Updated changelog regarding win_service quoted path fix 2017-11-03 09:57:04 +10:00
Jordan Borean
e771b64f1b win_service: quoted path fix (#32469)
* win_service: fix for path in quotes

* Added tests to verify behaviour doesn't regress

(cherry picked from commit 5b1db00b65)
2017-11-03 09:56:08 +10:00
Matt Davis
82c2da31be lock azure containerservice to below 2.0.0
* supersedes/fixes #32518
* only for 2.4.x - we'll make the necessary code changes for 2.5 to work with the updated version
2017-11-02 16:34:29 -07:00
Brian Coca
07674f5062 ini plugin should recursively instantiate pending
solves inconsistent behaviour on ini host format depending on definition order
fixes #32196

(cherry picked from commit 9d28973b5e)
2017-11-02 17:58:19 -04:00
Ondra Machacek
dd930344b6 ovirt_hosts: Don't fail upgrade when NON_RESPONSIVE state 2017-11-02 14:40:31 -04:00
Ondra Machacek
3df921a14a ovirt_clusters: Fix fencing and kuma comparision 2017-11-02 14:37:19 -04:00
Ondra Machacek
dd19f96561 ovirt_host_networks: Fix label assignment 2017-11-02 14:34:39 -04:00
Brian Coca
fa289a022c correctly deal with changed (#31812)
(cherry picked from commit 21cdddce74)
2017-11-02 12:31:52 -04:00
Pilou
35d942d6a0 Fix include_role unit tests (#31920)
* Ensure include_role unit tests check something

This is not the case: get_tasks_vars doesn't yield

* Fix include_role unit tests

Since e609618274, include_role are not
static anymore.

(cherry picked from commit 43914b3837)
2017-11-02 08:39:32 -07:00
u571kills
0140372d0f Fix example on comparing master config (#32406)
Current example produces error message:

"msg": "Unsupported parameters for (ios_config) module: diff_config Supported parameters include: after,auth_pass,authorize,backup,before,defaults,diff_against,diff_ignore_lines,force,host,intended_config,lines,match,multiline_delimiter,parents,password,port,provider,replace,running_config,save,save_when,src,ssh_keyfile,timeout,username"
(cherry picked from commit 869cf3fbdb)
2017-11-01 17:44:01 -07:00
Jordan Borean
b2f3dc9052 updated changelog with win_find fix 2017-11-02 09:38:27 +10:00
Jordan Borean
6a7333950a win_find: allow module to skip on files it fails to check (#32105)
* win_find: allow module to skip on files it fails to check

* fixed up test creation to work pre psv5

(cherry picked from commit 56a7278256)
2017-11-02 09:36:53 +10:00
Toshio Kuratomi
6f2876f49c New release v2.4.2.0-0.2.beta2 2017-11-01 13:51:37 -07:00
Brian Coca
b2cef41bcd added doc notes about vars plugins in precedence
(cherry picked from commit 52c97a1cf4)
2017-11-01 11:42:48 -07:00
Ganesh Nalawade
5bbf70afe1
Fixes #31090. In network parse_cli filter plugin, this change moves the creation of a (#31092) (#32458)
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
2017-11-01 23:46:14 +05:30
Ganesh Nalawade
bc01b5d981
eos_eapi: adding the desired state config to the new vrf fixes #32111 (#32112) (#32452)
* 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)
2017-11-01 23:02:51 +05:30
Ganesh Nalawade
b8ee3bb24f
Fix wrong prompt issue for network modules (#32426) (#32442)
* Fix wrong prompt issue for network moodules

Fixes #31161
Fixes #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)
2017-11-01 22:35:47 +05:30