Commit Graph

161 Commits (b582ae6e2950e3b119902df4fe6566d647433284)

Author SHA1 Message Date
Trishna Guha 299047d963
cherry-pick stable-2.5 (#40177)
* Fix nxos terminal plugin regex (#39659)

Fix nxos terminal plugin regex to match
command prompt without newline character as prefix

(cherry picked from commit 0ac222d68b)

* remove purge from nxos_logging doc, argspec (#39947)

* remove purge from nxos_logging doc, argspec

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* shippable

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

* IT cases for nxos_logging (#39929)

* IT cases for nxos_logging

* review comment

(cherry picked from commit 2557c0662a)

* fix nxos_ping issues (#40028)

(cherry picked from commit 6fac574f17)

* Fix vxlan_vtep_vni tests (#39968)

(cherry picked from commit 0407c51447)

* ios cliconf plugin fix regex for version (#40066)

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

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* shippable

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Sloane Hertel fe56d68c70
aws_s3: fix uploading from the target - backport #39023 (#40192)
* [aws_s3] Fix uploading src option on the target machine to a bucket (#39023)

* Fix backward compatibility for uploading src option on the target machine to a bucket

* Allow the module to handle errors for nonexistent files

(cherry picked from commit b8a93c12e2)

* changelog
7 years ago
Brian Coca e3b35d96be document lookup errors optoin (#39645)
* document lookup errors optoin

* changed to doc

* updated as per feedback

(cherry picked from commit 32c2aae258)
7 years ago
Martin Krizek 274fea3f5f Backport: Fix nested noop block padding in dynamic includes (#40182)
* Fix nested noop block padding in dynamic includes (#38814)

* Fix nested noop block padding in dynamic includes

* Address issues from the review

* Fix typo

(cherry picked from commit 5dd8977cfa)

* Add changelog/fragment for 38814
7 years ago
Sloane Hertel bc73fba58f
backport ec2_vpc_subnet fix and custom waiters from PRs 37534/38473/39171/38960 (#39440)
* [cloud] Make ec2_vpc_route_table wait for the route to propagate (#35975)

* Stabilize ec2_vpc_route_table

Wait for route table to be present before attempting to use it

Sleep before getting the final state of the route table in case modifications are incomplete

* Conditionally wait if changes were made

* Simplify logic

(cherry picked from commit 8fb31ac2f01e7c75d5181510290c99aee22be7ef)

* Route custom waiter (#36922)

This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet.

The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code.
(cherry picked from commit a40bce2bcbd5a40aee0de2b6ab5f6197bb1c5237)

* Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356)

(cherry picked from commit c9e8aca26cfc7559e7e8c7970acf06cd30cc7629)

* [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534)

* stabilize ec2_vpc_subnet module

* Add waiters for ec2_vpc_subnet

Clean up integration tests

* Reenable CI for stabilized ec2_vpc_subnet tests

* rename waiters

* Use module_json_aws where applicable

Handle WaiterError first if waiting failed

* Fix traceback when tagging with keys/values that look like booleans

* Fix check mode with tags

* Add integration tests for tags that look like booleans and check mode

* Add waiter for deleting subnet

* Sleep a few seconds after using aws command line

(cherry picked from commit ea943e454c783c6b0ffb91b78131f27cd9bce269)

* Fix sporadic errors in ec2_vpc_subnet integration tests (#38473)

(cherry picked from commit 46f13d343786fa3985cc16cc770762984c7884ac)

* [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171)

 Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter
(cherry picked from commit 6b91dae21c20006677e1e4adf2a9ff7ad55ca49c)

* [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960)

(cherry picked from commit c4f010704890581a4974e83af03c2e81fb29e58e)

* changelog
7 years ago
Ricardo Carrillo Cruz 3115f31655 Cherry pick iosxr admin fix (#40108)
* Exit admin mode properly on iosxr_config (#39594)

Fixes #38811

When using 'admin' in iosxr-config, we need to pass an end
to config terminal session but also pass exit so we exit admin
mode.

(cherry picked from commit 56c5567912)

* Add bugfix fragment
7 years ago
Jordan Borean 920c9e447b
win_template: fix issue where dest was specified as a directory (#39887) (#40125)
(cherry picked from commit d6eb642e88)
7 years ago
Jordan Borean 470f77e6dd
become win: better error messages and docs update (#39936) (#40122)
* become win: better error messages and docs update

* Fix syntax error and added changelog fragment

(cherry picked from commit e0813d7d47)
7 years ago
Dag Wieers 096757a6a3 Ensure remove files work when file was already removed
If a file disappears when you are removing it, this will ensure it
doesn't fail and continues as expected.

(cherry picked from commit 6a08b16c37)

Add changelog for file removal race

(cherry picked from commit 7c9122a89d)
7 years ago
Toshio Kuratomi c833b096fa
Fix encoding issue when parsing plugin examples (#39872)
This caused a non-fatal traceback when building, for example, the module
documentation for the debug module.

(cherry picked from commit 3e64036684)
7 years ago
Abhijeet Kasurde bd27c950f3
Fix unset ansible_virtualization_role (#39514) (#39885)
Error was:
AttributeError("'str' object has no attribute 'startwith'",)

Closes #39138

(cherry picked from commit 2397ca1a7e)
7 years ago
John R Barker 7764d9ce45
"route" has to be the first option in ufw command (#31756) (#40019)
* "route" has to be the first option in ufw command (#31756)

For supporting deletion of ufw routes, route option has to be placed before delete option
(cherry picked from commit 21004d86f9)

* Changelog
7 years ago
John R Barker 6a46e3a44b
Backport/2.5/37847Fix interfaces_file to accept allow-* (#37847 (#40008)
* Fix interfaces_file to accept allow-* (#37847)

(cherry picked from commit 5ac41ee8d8)

* interfaces-file
7 years ago
Brian Coca 448999f10e fix keyword doc generation
* use aliases when they exist
  * fix hardcoded loop attributes handling

(cherry picked from commit 19fee0ef41)
7 years ago
Brian Coca 0cd5457ea2 remove properties from vars in include_role (#38968)
* remove properties from vars in include_role
* also from_ args

(cherry picked from commit b9f7f582d1)
7 years ago
Yuwei Zhou 3de89da6f0 Backport: Fixes some NIC bugs (#39213) (#39266)
* cherry-pick 1ecd2c9dcdb6df9baada84d220dddda3423137c2

* Create azure_rm_networkinterface-fix-creation-ignore-nsg-name.yaml
7 years ago
Chris Alfonso fb669f76fb Backport/2.5/39027 (#39091)
* nios lookup errors out when there are no results #37970 (#39027)

* Update nios.py

* Update nios.py

* Update nios.py

* nios lookup errors out when there are no results #37970  Open

Indentation failure issue resolved

* Returning empty list instead of None

In case of no results, res will be returned as an empty list instead of None (implementing ganeshrn comment)

(cherry picked from commit fd50248463)

* Adding changelog mesage for nios lookup error
7 years ago
Trishna Guha fb26f6107d
nxos module doc fragment for authorize,auth_pass (#39946)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Sam Doran 511d3110f7
Only change expiration date if it is different (#38885) (#39575)
* Only change expiration date if it is different

Modify user_info() method to also return the password expiration.
Compare current and desired expiration times and only change if they are different.

* Improve formatting on user tests

* Add integration test for expiration

* Add changelog fragment

* Improve integration test

Skip macOS and use getent module for validating expiration date.

* Fix expiration change for FreeBSD

* Don't use datetime since the total_seconds method isn't available on CentOS 6

* Use better name for expiration index field

Use separate tasks for verifying expiration date on BSD

* Use calendar.timegm() rather than time.mktime()

calendar.timegm() is the inverse of time.gmtime() and returns a timestamp in UTC not localtime
Add tests that change the system timezone away from UTC

* Mark tests as destructive and use test for change status

* Fix account expiration for FreeBSD

Use DATE_FORMAT when setting expiration date on FreeBSD. Previously the argument passed to -e was an integer of days since epoch when the account will expire which was inserted directly into master.passwd. This value is interpreted as seconds since epoch by the system, meaning the account expiration was actually set to a few hours past epoch.

Greatly simply comparing desired  and current expiration time by using the first three values of the struct_time tuple rather than doing a whole bunch of manipulations of the seconds since epoch.

(cherry picked from commit 5a6bdef76b)
7 years ago
Abhijeet Kasurde 894830326a
Don't update cpu/memory allocation in configspec if there is no change. (#39865)
Fixes #38941

(cherry picked from commit 0296c8466a)
7 years ago
Martin Krizek c485c439c7
Backport: apt: mark installed packages manual (#37751) (#39411)
(cherry picked from commit 00d9345158)
(cherry picked from commit 687f3bbef3)
7 years ago
Trishna Guha fb5bc5d513
nxos on_become terminal plugin stable_2.5 (#39852)
* nxos enable mode (#39355)

* nxos enable mode

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix prompt

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add authorize,auth_pass

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove byte string from exec_cli_command

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add on_become test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* removed_in_version

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

* nxos on_become changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Deepak Agrawal c23aa1c9ce
show version brief does not work on iosxr virtual (#39847)
* show version brief does not work on iosxr virtual (#37609)

* show version brief does not work on iosxr virtual

* ci failures fix

(cherry picked from commit 66b389a00d)

* changelog entry
7 years ago
Trishna Guha 079b7cb1fe
nxos and ios bugfix stable-2.5 (#39845)
* nxos_linkagg normalize interface (#39591)

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

* use show run instead of section pipeline ios_l2_interface (#39658)

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

* add changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_snmp_user issues (#39760)

* fix nxos_snmp_user issues

* shipppable fix

(cherry picked from commit e3bfbe5875)

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix shippable

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Deepak Agrawal 54a229adb9
Handling of configurations blocks with end-* at the end of the block (#39843)
* Handling of configurations blocks with end-* at the end of the block (#39673)

* handle end-policy issue

* revert changes in iosxr cliconf

* fix trailing parents not included in difference

* Moving fix to platform specific fix

* pep 8 issues

(cherry picked from commit ef577b71cc)

* changelog entry
7 years ago
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
7 years ago
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
7 years ago
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
7 years ago
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)
7 years ago
Artem Goncharov 81abf7837d Backport/2.5/39371 Issue 30786 (#39660)
* Fixes 30786 - add server response to the failure

(cherry picked from commit 0ac885f1c7)

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

(cherry picked from commit e2e3bf6b9a)

* add changelogs/fragments
7 years ago
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)
7 years ago
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>
7 years ago
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)
7 years ago
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)
7 years ago
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)
7 years ago
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)
7 years ago
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
7 years ago
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
7 years ago
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.
7 years ago
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
7 years ago
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)
7 years ago
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)
7 years ago
Brian Coca b595c6254f return empty host list when pattern is empty
fixes #37894

(cherry picked from commit 2e852fcd6d)
7 years ago
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)
7 years ago
Brian Coca 80486090d5 protect against plugins using verify incorrectly
assume false on any errors

(cherry picked from commit ef40e5e3b2)

backport of #36591
7 years ago
Sloane Hertel 4de31cd96b
Add changelog for #37010 (#39511) 7 years ago
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)
7 years ago
Brian Coca b5a5211cd4 remove slice docs (#37946)
(cherry picked from commit b533ebe20d)

backport of #37946
7 years ago
Brian Coca 86663c8060 fixy typo (#39430)
(cherry picked from commit 01e7f44e0d)
7 years ago
Jordan Borean 05f04c173c Change except Error when trying to get a missing option
(cherry picked from commit 25dea1f72c)
7 years ago