Commit graph

36316 commits

Author SHA1 Message Date
John R Barker
bf1436ca52 facts: Detecting NVME partitions under Linux (#39730) (#39804)
* facts: Detecting NVME partitions under Linux (#39730)

In the current state of the code, the nvme partitions are returned as empty as in :
        "ansible_devices": {
            "nvme0n1": {
                "model": "SAMSUNG MZVLW256HEHP-000L7",
                "partitions": {},

The parsing of the /sys/block/<diskname> try to find a disk named like :
    <diskname><x> as in sda1 for sda

But in the nvme context, the partition of nvme0n1 is named nvme0n1p1.
This add a possible 'p' between the diskname and the partname.

This patch simply add the option of having a 'p' between the diskname
and the partname.

The patch works on my host :
                "model": "INTEL SSDPEDMD400G4",
                "partitions": {
                    "nvme0n1p1": {
                         ...
                        "size": "93.13 GB",
                    }

Fixes #38742
Signed-off-by: Erwan Velu <erwan@redhat.com>
(cherry picked from commit 2214c747a2)

* Use a more exact regex (#39811)

The pattern we're matching can have zero or one p.  Be more careful to
match exactly that.

Slight revision of #39730

(cherry picked from commit 75283983f6)
2018-05-07 14:18:53 -07:00
Charles
17f7d35b32
Broken link to MSDN (#39814)
Fix broken link to MSDN site for FileSystemRights enumeration

+label: docsite_pr

(cherry picked from commit ea7883ef7e)
2018-05-08 05:50:26 +10:00
Matt Clay
515ab5fd99 Restore nuage_vspk integration tests.
(cherry picked from commit 1c7417cba7)
2018-05-07 11:32:50 -07: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
Ganesh Nalawade
20e8766840
Fix eos_config integration test failure (#39662) (#39784)
Enable become for eos_config check_mode test cases
(cherry picked from commit b20b964c4a)
2018-05-07 09:03:19 +05:30
Matt Clay
b711bde6b2 Temporarily disable the nuage_vspk test.
This test interferes with the uri test on centos6.

(cherry picked from commit a121b5073c)
2018-05-05 14:01:03 -07:00
Alicia Cozine
831cfe9164
doc for _config backup argument (#38650) (#39763)
(cherry-picked from commit 6de49f0)
2018-05-04 17:33:08 -05:00
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
Ganesh Nalawade
cf374ca9d4
Fix ios integration test failures in CI (#39729) (#39731)
Fix ios integration test failures in CI. Since the packet transfer and receive rate
on the interface is not determined to remove the tx_rate and rx_rate test conditions
to prevent intermittent failure.
(cherry picked from commit 4c5ac16447)
2018-05-04 17:30:03 +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
Matt Clay
659e10885b Enable nuage_vspk tests for Python 2.7.
(cherry picked from commit c2d7347819)
2018-05-03 15:38:02 -07:00
Toshio Kuratomi
4d9895ad93 Document follow changes
Add the file, blockinfile, and replace changes to the follow parameter
to the porting guide

(cherry picked from commit 1885883a88)
2018-05-03 11:58:02 -07:00
John R Barker
aa6c60ea80
nxos.yaml no longer needed (#39693) 2018-05-03 19:22:51 +01:00
John R Barker
de8213e230
vyos_interface require multiple network nodes to run (#39670) (#39691)
* vyos_interface require multiple network nodes to run

We don't have the ability to run these currently, so disable them.
The original logic was also incorrect, the tests don't pass on lab, DCI
nor single instance nodepool, so disable

https://github.com/ansible/ansible/issues/39667 tracks getting these
enabled again

* eth0 -> Gi0/0

* Correctly detect if we should run lldp

* Correctly detect if we should run lldp

(cherry picked from commit 923a81e9e5)
2018-05-03 18:52:42 +01:00
John R Barker
d5538ce807
Default ssh port (#39678) (#39690)
(cherry picked from commit a7660f0603)
2018-05-03 18:49:41 +01:00
Maish
389db4c49e [aws] Added empty default for ec2_ami name parameter (#38585)
* removed additional check for name parameter

(cherry picked from commit 91357d07f4f9eb3714f582c1959ff54d25129500)

* Added empty default
Fix for issue https://github.com/ansible/ansible/issues/38482

(cherry picked from commit 60a32771039c190a7e9f6e0eb4d0f6bf4c356fd4)

* [ec2_ami] Ensure name or image_id is provided for state=present (#38972)

Add integration tests for backward compatibility and ensuring name or image_id is provided
(cherry picked from commit e2aa1155ba)
2018-05-03 08:03:11 -04:00
aaronk1
eaa9364159
update win_psmodule.py (#39631)
<!--- Fix minor typo in Powershell version requirement -->

+label: docsite_pr

(cherry picked from commit ca36e07be0)
2018-05-03 14:51:48 +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
Matt Clay
f1d584bb58 Remove unstable from azure_rm_storageblob test. 2018-05-02 10:34:40 -07:00
Matt Clay
f3d8d0baae Remove unstable marker from rabbitmq_user test.
(cherry picked from commit f526a461ee)
2018-05-02 10:15:06 -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
John R Barker
d5e8bedfd6
Connect via ssh using ansible_port (#39603) (#39607)
Depending on how we spin up the VM we use different ssh port. Honor that
in the vyos_user test
(cherry picked from commit 287f4ff374)
2018-05-02 16:36:15 +01: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
Trishna Guha
df9642aa30
fix nxos_vrf_af teardown for nxapi (#39599) (#39601)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 0a17adb3df)
2018-05-02 18:10:11 +05:30
Matt Clay
b7c311d3c7 Use HTTPS instead of HTTP for httpbin tests. (#39457)
The httpbin.org site is now redirecting HTTP to HTTPS.

(cherry picked from commit b92ef8e54a)
2018-05-01 20:57:27 -07:00
Matt Clay
784956c219
Sync stable-2.5 test infrastructure with devel. (#39544)
Sync stable-2.5 test infrastructure with devel:

- shippable.yml
- test/runner/
- test/sanity/
- test/utils/
- docs/docsite/rst/dev_guide/testing/sanity/
- test/integration/targets/*/aliases
2018-05-01 15:47:24 -07:00
James Cammarata
4d0422d4ed Properly unlock the socket file lock in ansible-connection (#39223) (#39330)
Also use a lock file per host, rather than one global file lock.

Commit 9c0275a879 introduced a bug where the lock file was only being
unlocked by the child PID of the resulting fork done in ansible-connection.
This causes delays when a large inventory causes a lot of contention on
that global lock. This patch fixes the problem by ensuring the lock is
released regardless of the fork condition, and also to use a lock file
based on the remote address of the target host, removing the global lock
bottleneck.

Fixes #38892

(cherry picked from commit 7ce9968ce1)
2018-05-01 14:19:26 -07:00
Matt Clay
20ab1d2994 Move requirements into tests. (#35885)
(cherry picked from commit e7b793c8c6)
2018-05-01 09:55:56 -07:00
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
Matt Clay
aa534d8be9 Move var precedence check to integration tests.
(cherry picked from commit 8daa80e5bb)
2018-04-30 16:20:16 -07:00
Matt Clay
e72ab67081 Fix broken docs link. 2018-04-30 15:57:44 -07:00
Matt Clay
9f6706fe82 Clean up non-standard module shebangs.
(cherry picked from commit aee01564a9)
2018-04-30 15:30:42 -07:00
scottb
bb4c00c006 Copy edits and tweaks
(cherry picked from commit e7f9c5cc60)
2018-04-30 15:30:42 -07:00
Brian Coca
cc77752958 updated api example
- added many more comments
- removed very obsolete 1.x refs

(cherry picked from commit cf43e0d605)
2018-04-30 15:30:42 -07:00
Matt Clay
44247f95c3 Fix more docs errors. (#39051)
* Fix remaining unknown-document docs errors.
* Fix last toc-tree-missing-document docs error.

(cherry picked from commit 9e8889bb70)
2018-04-30 15:30:42 -07:00
Matt Clay
434c6ef7e8 Fix docs build warnings.
(cherry picked from commit 4fc5e89e83)
2018-04-30 15:30:42 -07:00
Matt Clay
bf138c9e8e Add missing boilerplate. 2018-04-30 14:46:15 -07: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
Alicia Cozine
27b1044bc1
Update intermediate_concepts.rst (#39500) (#39503)
Updated  GitHub Repos section to better explain what ansible-network@redhat.com is for (not an email list, but adding to the network-automation github repo.
(cherry picked from commit 9773157da6)
2018-04-30 11:35:53 -05:00
Sloane Hertel
4de31cd96b
Add changelog for #37010 (#39511) 2018-04-30 12:29:11 -04:00