Commit graph

131 commits

Author SHA1 Message Date
Ganesh Nalawade
4b979742fa
Fetch ios default config is defaults is enabled (#39741) (#39841)
If default option is eanbled fetch the current
running configuration by adding `all` or `full`
flag
(cherry picked from commit 09e3b5c92b)
Update Changelog
2018-05-08 10:11:54 +05:30
Andrew Gaffney
8e5956a98b Backport #39818 to stable-2.5 (#39824)
* Update vars for loop_control on each loop iteration (fixes #38899) (#39818)

(cherry picked from commit 01e8139d74)

* Changelog snippet for cherry-pick of #39818
2018-05-07 19:09:48 -04:00
Matt Martz
4d245c9a87
Backport #39764 for 2.5 - async_status environment (#39766)
* Make sure that the implicit async_status gets the env from a task with async. Fixes #39699 (#39764)

(cherry picked from commit 3b496db4d8)

* Add changelog for #39764
2018-05-07 10:02:18 -05:00
Abhijeet Kasurde
5016ea8615
vmware_guest: cast vlan to int or str when relevant (#39793)
`network['vlan']` should be a VLAN ID
Integers passed around using jinja variable references are
converted to strings (see # 9362)
The # 32738 PR should allow using 'NativeType' in ansible
Explicitly converting to integer will make the module works
as expected with or without the NativeType support

`network['vlan']` can also be a VLAN NAME (fallback)
Explicitly converting to string will make the module works
as expected with or without the NativeType support

Signed-off-by: Matthieu Fronton <m@tthieu.fr>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

(cherry picked from commit a0b4462aea)
2018-05-07 16:45:18 +05:30
Artem Goncharov
81abf7837d Backport/2.5/39371 Issue 30786 (#39660)
* Fixes 30786 - add server response to the failure

(cherry picked from commit 0ac885f1c7546caa5b9178b142f490d211167f5a)

* replace str(e) with to_native(e) according to code review

(cherry picked from commit e2e3bf6b9ae44d565baeaa7d7d1ab853888d8c7a)

* add changelogs/fragments
2018-05-04 12:55:40 -04:00
Ganesh Nalawade
8d570e67db
Fix eos_vlan associated interface check (#39661) (#39738)
* Fix eos_vlan associated interface check

Fix eos_vlan associated interface check by comparing
the interface in want and have without converting the
interface name to lower

* Update eos_vlan docs

* Update changelog
(cherry picked from commit afdc2364f2)
2018-05-04 20:14:48 +05:30
Trishna Guha
69564206e0
nxos bugfixes stable-2.5 (#39719)
* Handle nxos_feature issue where json isn't supported (#39150)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 9eff1f1d74)

* Integration Tests only: nxos_snmp_contact (#39318)

* add integration test cases for snmp_contact

* removing unnecessary files

(cherry picked from commit bdb75cd82c)

* fix nxos_ntp issues (#39178)

* fix nxos_ntp issues

* review comments

* fix idempotent fail case

(cherry picked from commit 2f99a17856)

* nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544)

This fixes an issue we recently encounteredi with nxos_interface:

```
Traceback (most recent call last):
  File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main
    have = map_config_to_obj(want, module)
  File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj
    obj['speed'] = re.search(r'speed (\d+)', body).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
```

(cherry picked from commit dca6e2d94d)

* fix nxos_snmp_community issues (#39258)

(cherry picked from commit 1afec5a48e)

* Add aggregate example in nxos_l2_interface module doc (#39275)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 86817cdd52)

* Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. … (#39074)

* Fix misuse of 'self' in lib/ansible/module_utils/network/eos/eos.py. Method load_config

* Fix all instances of self.config(self,...

(cherry picked from commit 80d7e22f5e)

* Fix for nxos_snmp_host issues (#39642)

* fix snmp_host issues

* source files

* fix shippable

* remove defaults to match arg spec

(cherry picked from commit f99bae1776)

* fix nxos_snmp_traps issues (#39444)

* fix snmp_traps code

* add IT cases

* fix shippable

* fix shippable without ignore

(cherry picked from commit 99748cbfa4)

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-04 15:25:55 +05:30
Toshio Kuratomi
c11d8abf9a Fix for file module with recursive permission setting and broken symlinks
There was a traceback when setting permissions on a directory tree when
there were broken symlinks inside of the tree and follow=true.  chmod -R
ignores broken symlinks inside of the tree so we've fixed the file
module to do the same.

Fixes #39456

(cherry picked from commit 6b159fdb03)
2018-05-03 18:27:34 -07:00
Toshio Kuratomi
3b17141525 Fix for file module with symlinks to nonexistent target (#39635)
* Fix for file module with symlinks to nonexistent target

When creating a symlink to a nonexistent target, creating the symlink
would work but subsequent runs of the task would fail because it was
trying to operate on the target instead of the symlink.

Fixes #39558

(cherry picked from commit 4f664f8ff6)
2018-05-03 18:11:02 -07:00
Jordan Borean
99f36c6ce5
win_get_url: Fixed a few issues with using FTP and added tests (#39646) (#39705)
* win_get_url: Fixed a few issues with using FTP and added tests

* Fixed typo in docs

(cherry picked from commit f75b7a9437)
2018-05-04 09:24:44 +10:00
Toshio Kuratomi
8c6f6033b0 Fix when template paths contain non-ascii chars and using the path in ansible_managed
Fixes #27262

(cherry picked from commit 81b2529159)

Add tests for template with non-ascii filenames

This is a test in response to #27262 but I could not provoke the error
so it only shows that the current code is working with non-ascii
filenames in this case.  It doesn't show whether there's some other bug
somewhere.

(cherry picked from commit f91d961cb4)
2018-05-02 13:02:12 -07:00
Brian Coca
00c023ed3c ensure 'home' translations (#36755)
* ensure 'home' translations
* removed slash as it created issues on diff plats

(cherry picked from commit cc1c7c63db)

* fixed bug introduced by orig commit, this should only affect single ~ paths
2018-05-02 11:51:51 -04:00
Ganesh Nalawade
bf96b1da63
Fix fetching ios default running config (#39475) (#39608)
If default option is enable in that case only
add 'all' or 'full' flag
(cherry picked from commit eb5e15e7e0)

Update changelog
2018-05-02 20:06:21 +05:30
Yanis Guenane
eb77afe4de Add space between arguments for acme-tiny (#36739) (#39018)
Currently, the module fail with a error saying that --acme-dir is mandatory.
Looking at the commandline:

    /usr/sbin/acme-tiny --chain --account-key /srv/letsencrypt/acme_key/acme.key
    --csr /srv/letsencrypt/nginx_certs/www.example.org.csr--acme-dir /srv/letsencrypt/webroot",

We can see that the space before --acme-dir is missing.
2018-05-01 12:55:19 +01:00
Chris Alfonso
543097c315 Backport/2.5/39063 (#39093)
* Fix ios and iosxr terminal prompt regex (#39063)

Fixes #38732

Make matching leading newline for cli prompt
optional as there are cases when returned repsonse
for ios/iosx remote host doesn't have newline before
cli prompt.
(cherry picked from commit eebfa66c2b)

* Adding changelog for ios and iosxr terminal prompt fix
2018-05-01 12:03:30 +01:00
Brian Coca
cee1cbf65b make individual bad paths a warning
still error if none of the paths provided was usable

fixes #39044

(cherry picked from commit e4dbabbef2)
2018-04-30 17:20:32 -04:00
Brian Coca
18d0fe6b30 minimize loading files/plugins
avoids some repetitive loading
 - read config file only once
 - now cache the ini parser per file
 - optimize shell plugin loading

tried to 'optimize' vars_plugins loading but it creates issues with precedence,
probalby due to iterator not being reset, will look into it in subsequent fix/PR

(cherry picked from commit 42912e1ac8)
2018-04-30 12:49:53 -04:00
Brian Coca
b595c6254f return empty host list when pattern is empty
fixes #37894

(cherry picked from commit 2e852fcd6d)
2018-04-30 12:48:56 -04:00
Brian Coca
19ab7b4b64 ignore version when deciding callback loading (#38281)
* ignore version when deciding callback loading

The code already defaulted to load the callback if the properties are not present
there was no need for us to also check the version

fixes #38270

* fix error msg on set optoins to use correct name

(cherry picked from commit 1850bb752f)
2018-04-30 12:47:58 -04:00
Brian Coca
80486090d5 protect against plugins using verify incorrectly
assume false on any errors

(cherry picked from commit ef40e5e3b2)

backport of #36591
2018-04-30 12:47:04 -04:00
Sloane Hertel
4de31cd96b
Add changelog for #37010 (#39511) 2018-04-30 12:29:11 -04:00
Toshio Kuratomi
e7aa8bc0e3 Need to convert filenames to byte strings before using them in APIs
Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback.  Fix that by explicitly converting
to byte strings before passing to external APIs.

May fix #27262

(cherry picked from commit 2976b653ce)

Add a changelog for filename encoding in template action fix

(cherry picked from commit d90c36e320)
2018-04-30 09:26:02 -07:00
Brian Coca
b5a5211cd4 remove slice docs (#37946)
(cherry picked from commit b533ebe20d)

backport of #37946
2018-04-30 10:14:19 -04:00
Brian Coca
86663c8060 fixy typo (#39430)
(cherry picked from commit 01e7f44e0d)
2018-04-27 11:06:56 -07:00
Jordan Borean
05f04c173c Change except Error when trying to get a missing option
(cherry picked from commit 25dea1f72c)
2018-04-27 11:57:14 -04:00
Benn Roth
515bb78ee1 minor accuracy fix
Don't round the parameter 12.04 in the explanatory paragraph unless `version()` rounds the parameter

(cherry picked from commit 5cf544e03e5f833e1614fa940849976550d55448)
(cherry picked from commit 56967497d5)
2018-04-27 11:56:09 -04:00
Adrian Lopez
f77f605115 chkconfig localizes messages, ansible fails to recognise
In the particular case of executin "chkconfig --list NAME", ansible
checks the stderr looking for a particular english message.
This message is different in other languages, Spanish for example
(although it have been corrected in the latests versions)

Fixes #29818

(cherry picked from commit e7db3c0eba)
2018-04-27 11:26:57 -04:00
Sam Doran
070c7b77ab Backport #39366 - call diff callback also when task diff is true (#39372)
* call diff callback also when task diff is true (#39366)

fixes #31129

(cherry picked from commit d76298b5d3)

* Add changelog entry
2018-04-27 10:20:15 -04:00
Jordan Borean
655ffa5368
Win file path special char 2.5 (#39397)
* win_file: Handle [] in paths, fix touch in check mode (#37901)

* win_file: Handle [] in paths, fix touch in check mode

* Fixed typo for p/invoke command

(cherry picked from commit 4b57fa91d0)

* Added changelog fragment for win_file special char fix

(cherry picked from commit 61bcf4740f)
2018-04-27 08:54:02 +10:00
Matt Davis
a02592baec fix yamllint sanity failure 2018-04-26 10:51:13 -07:00
Matt Davis
48b75cad8e New release v2.5.2 2018-04-26 10:39:44 -07:00
Toshio Kuratomi
cb27ed5a58 Winrm encoding in exception fix (#39333)
Exceptions need to use native strings.  We need to make sure we're
combining native strings with native strings.

(cherry picked from commit 0b643009db)

Add changelog entry for winrm encoding fix

(cherry picked from commit a5e33969b1)
2018-04-25 17:15:43 -07:00
Abhijeet Kasurde
7dbe964de5
We need to return virtual_facts after VMWare platform detection (#39149)
(cherry picked from commit 4f36d7965e)
2018-04-25 17:54:54 +05:30
Jordan Borean
6ab0d60e81
Ansible.ModuleUtils.FileUtil - backport 2.5 Add ability to test non file system provider paths (#39203)
* Ansible.ModuleUtils.FileUtil - Add ability to test non file system provider paths (#39200)


(cherry picked from commit b6afe6946d)

* Added changelog fragment
2018-04-24 13:17:43 +10:00
Jordan Borean
250d5b74fa
Fix for win_get_url module (Fixes #39151) - 2.5 backport (#39207)
* Fix for win_get_url module (#39152)


(cherry picked from commit 0c96863ec6)

* Added changelog fragment
2018-04-24 12:46:40 +10:00
Matt Martz
ec8bce2051 Add changelog for #38302 2018-04-23 18:01:21 -04:00
Toshio Kuratomi
cd7042857c Fix copy to only follow symlinks for files in the non-recursive case
Revert "**Temporary**"

This reverts commit 28b86b1148.

We don't need this now that copy has been fixed

(cherry picked from commit f332151f59)
2018-04-20 12:48:32 -07:00
Ganesh Nalawade
94d40c8515
Fix ios and iosxr terminal prompt regex (#39063) (#39089)
Fixes #38732

Make matching leading newline for cli prompt
optional as there are cases when returned repsonse
for ios/iosx remote host doesn't have newline before
cli prompt.
(cherry picked from commit eebfa66c2b)
2018-04-20 23:49:19 +05:30
Matt Martz
d6872a7b07
Backport #38747 for 2.5 - Block copy and reparenting improvements (#38829)
* Attempt 4: Prevent reparenting a block with itself (#38747)

* More concisely reparent, ensuring we don't go too shallow or too deep in this process. Fixes #38357

* More explicit reparenting, with a short circuit for a common case

* We need new_block to have a parent, otherwise we lose context with this approach

* Remove duplicate parent assignment

* Change callers of Block.copy to not use exclude_parent=True, when including the parent, exclude tasks

(cherry picked from commit f474195a3b)

* Add changelog for #38747
2018-04-20 12:31:56 -05:00
Matt Martz
0bbb67383b
Backport #38827 for 2.5 - Allow inheriting attrs from static parents (#38847)
* Skip self._parent on dynamic, defer to grandparent for attr lookup (#38827)

* Skip self._parent on dynamic, defer to grandparent for attr lookup

* Revert _inheritable

* Add tests for include inheritance from static blocks

Fixes #38037 #36194

(cherry picked from commit 354aa8d602)

* Add changelog for #38827
2018-04-20 11:45:28 -05:00
Matt Martz
017f9a4876
Backport #37083 for 2.5 - IncludedFile comparison fix for free strategy (#38981)
* Consider parent also when comparing IncludedFile (#37083)

* Consider parent also when comparing IncludedFile

* Add new tests for IncludedFile and convert to pytest

(cherry picked from commit cdb79b0e3a)

* Add changelog for #37083
2018-04-20 11:42:30 -05:00
Matt Martz
07ca962417
Backport #38884 for 2.5 - docker/docker-py guard (#38889)
* Error if docker and docker-py are simultaneously (#38884)

* Error if docker and docker-py are simultaneously installed over top of each other. Fixes #36125

* Remove duplicate installed

(cherry picked from commit 68e3ff80a7)

* Add changelog for #36470
2018-04-20 11:41:35 -05:00
Matt Davis
ed473d792b New release v2.5.1 2018-04-18 16:48:39 -07:00
Trishna Guha
456fe2add1
nxos bugfixes cherry-pick (#38950)
* fix nxos_ntp_options (#38695)

(cherry picked from commit 1d975bdc93)

* fix ntp_auth issues (#38824)

(cherry picked from commit a372142434)

* update nxos changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-18 09:59:39 -04:00
Abhijeet Kasurde
9a7da8d3da
add instanceUuid (also called PersistentId) in vmware utils (#38870)
(cherry picked from commit 0cdba9ff70)
2018-04-18 17:41:15 +05:30
Jordan Borean
0fede2ba60
Tolerate win line endings on module load 2.5 (#38919)
* Tolerate win line endings on windows module_util load (#37291)

* tolerate windows line endings when loading windows module utils.  Helpful for old custom windows modules.

* add test modules to demonstrate win line ending module load behaviour.

* attempt to fix sanity check failures

* pep8 fix

* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)

* switch to rstrip() following core team meeting feedback

(cherry picked from commit ad94d03ba1)

* Added changelog fragment

* Added ignore rules to older sanity tests

* Removed test files due to old shebang not being possible without bigger change
2018-04-18 15:25:18 +10:00
Jordan Borean
10aa5a37aa
win_regedit: backport 2.5 stabilise tests (#38918)
* win_regedit: stabilise tests (#38912)

(cherry picked from commit 77ef4802f0)

* Added changelog fragment
2018-04-18 08:45:00 +10:00
Toshio Kuratomi
ae79eef0b2 Add changelog entry for grafana base64 port
(cherry picked from commit f5cc4acc53)
2018-04-17 06:52:56 -07:00
John R Barker
507423f111
issue:38321 fix onyx_config module failed while using python = 3.5 (#38343) (#38869)
* issue:38321 fix onyx_config module failed while using python = 3.5 (#38343)

(cherry picked from commit 0d79268a6d)

* changelog
2018-04-17 13:16:03 +01:00
Abhijeet Kasurde
bb50c65769
VMware: handle permission denied while reading facts (#38868)
This fix adds exception handling which is raised when user
does not have correct set of permissions/privileges to read virtual machine
facts especially host system configuration.

Fixes: #37056

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit efc3f4f824)
2018-04-17 16:20:46 +05:30