Commit graph

3820 commits

Author SHA1 Message Date
saichint aef50eaa40 Integration Tests only: nxos_udld, nxos_udld_interface, nxos_vxlan_vtep_vni (#29143)
* it cases for vxlan_vtep_vni, udld

* platform specific testing

* fix vxlan_vtep for n7k

* fix udld_intf setup

* skip udld tests on titanium n7k

* remove hardcoding

* fix udld tests for titanium
2017-11-16 07:39:59 +00:00
Ganesh Nalawade ba0aade8f4
Fix ios_config integration test failures (#32959) 2017-11-16 12:37:47 +05:30
Abhijeet Kasurde e61bcc3438
Provide clear error message after failure (#32928) 2017-11-16 06:42:27 +00:00
Abhijeet Kasurde 2d4c4e09db
Add vmware fact about 'Cores Per Socket' (#32881)
This fix adds new fact - 'Cores Per Socket' about vmware guest machine.
Also, adds integration test for this change.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-16 06:22:32 +00:00
Mike Wiebe 208208ab8f Fix nxos_snmp_host bug (#32916)
* Fix nxos_snmp_host bug

* Enable nxos_snmp_host tests
2017-11-16 06:17:42 +00:00
Tim Rupp 3f3c526026
Removes deprecated "append" param from snat pool (#32953)
This param was deprecated in 2.4 and slated for removal in 2.5. This
patch removes it.
2017-11-15 19:35:09 -08:00
Tim Rupp 0c1f493b6c
Adds module for managing bigip device connectivity (#32950)
This module is a critical part of the HA process for BIG-IPs.
2017-11-15 16:51:51 -08:00
Jordan Borean 1bc4940ee1
added powershell symlink util helper (#27153)
* Added symbolic link util for powershell

* updated module_util license to BSD
2017-11-16 10:12:02 +10:00
Jordan Borean e16e6313c7 windows: fix for checking locked system files (#30665)
* fix for checking locked system files

* moved functions to share module util and created tests

* fixed windows-paths test based on win_stat changes
2017-11-15 19:04:03 -05:00
Jordan Borean 5e20fd0943 removed psobject to hashtables that were missed (#32710)
* removed psobject to hashtables that were missed

* fix up win_region change
2017-11-15 14:51:16 -08:00
Matt Clay ef21038dd5 Fix ansible-test race calling get_coverage_path. 2017-11-15 12:57:18 -08:00
Dag Wieers 3089892e59 sl_vm: PEP8 compliancy and documentation changes (#32657)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
2017-11-15 15:22:32 -05:00
Adrian Likins 86dc3c09ac
Fix vault --ask-vault-pass with no tty (#31493)
* Fix vault --ask-vault-pass with no tty

2.4.0 added a check for isatty() that would skip setting up interactive
vault password prompts if not running on a tty.

But... getpass.getpass() will fallback to reading from stdin if
it gets that far without a tty. Since 2.4.0 skipped the interactive
prompts / getpass.getpass() in that case, it would never get a chance
to fall back to stdin.

So if 'echo $VAULT_PASSWORD| ansible-playbook --ask-vault-pass site.yml'
was ran without a tty (ie, from a jenkins job or via the vagrant
ansible provisioner) the 2.4 behavior was different than 2.3. 2.4
would never read the password from stdin, resulting in a vault password
error like:

        ERROR! Attempting to decrypt but no vault secrets found

Fix is just to always call the interactive password prompts based
on getpass.getpass() on --ask-vault-pass or --vault-id @prompt and
let getpass sort it out.

* up test_prompt_no_tty to expect prompt with no tty

We do call the PromptSecret class if there is no tty, but
we are back to expecting it to read from stdin in that case.

* Fix logic for when to auto-prompt vault pass

If --ask-vault-pass is used, then pretty much always
prompt.

If it is not used, then prompt if there are no other
vault ids provided and 'auto_prompt==True'.

Fixes vagrant bug https://github.com/hashicorp/vagrant/issues/9033

Fixes #30993
2017-11-15 14:01:32 -05:00
Pavel c56dcb7afa module_utils: vmware.py. Incorrect chain of attributes to obtain snapshots from virtual machine (#32669)
* Update vmware.py
Incorrect chain of attributes to obtain snapshots from virtual machine. Module 'vmware_guest_facts' uses method 'gather_vm_facts' of vmware.py and always gets empty list of snapshots.
* Added test for module vmware_guest_facts. Checked VM snapshots.
* Fixed tests for vmware_guest_facts. Ignored certificate for vmware_guest_snapshot module.
2017-11-15 16:00:22 +00:00
Sebastiaan van Doesselaar 900abcddb3 Integrated publickey import and removal in iosxr_user (#32115)
* Integrated publickey import and removal in iosxr_user

* Fixed linting issues

* Added version added for publickeyfile option

* Added quotation marks to version, oops

* Added some integration tests, added some checks to prevent aggregate users with public keys.

* Added some integration test files

* Created mutually exclusive public_key and public_key_contents versions of config

* Modified tests to use both methods and test more logins

* Added supports for aggregates

* Incorporated provider auth

* Fixed some lint issues

* Fixed a YAML lint issue

* Implemented catches for unconfigured providers.

* Fixed catches, hopefully

* Another test

* Added groups support so you can add users to multiple groups

* Trailing whitespace
2017-11-15 07:34:36 -07:00
Prasad Katti 239464f804 ec2_key: add a test for the force option (#32748)
* ec2_key: test force option

* ec2_key: changes requested via review comments
2017-11-15 22:53:41 +10:00
Matt Clay 6472723ba8
Add missing ansible-test --remote-terminate support. (#32918)
* Expand ansible-test --remote-terminate support:

- windows-integration
- network-integration

These commands previously accepted the option, but did not support it.

* Terminate windows and network instances when done.
2017-11-14 17:08:48 -08:00
Gawain fa764f6918 New Module vmware_host_facts (#26492)
Add new module  vmware_host_facts ,it can get remote vmware host system info like setup module

* modify ansible version
* optimized output for human readable
* add serial number get_system_facts() add ansible_product_serial
* fix pep8 issue and ansible module required format
* Use find_obj method instead get_obj
* add ansible_hostname ansible_distribution_build
* add integration test
* vmware_host_facts integration test add verify
* fix yamllint issue
* fix boilerplate test
* Update vmware_host_facts.py
* fix RETURN key's name
2017-11-14 15:41:55 +00:00
Trishna Guha 3ee2501c83
multiple fixes nxos (#32903)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 15:23:11 +00:00
Anil Kumar Muraleedharan 177a4fb3ec Adding enos_command module and unit test (#32782)
* Adding git_command module and its UT file

* Changing Author Name and removing 2 blank lines

* Removing blank lines

* Adding enos_config and its UT files

* Removing config module as I am allowed to have only module per PR

* Work on Ganesh's Review comments

* John Review Comments on enos_command.py

* Review comments of John
2017-11-14 15:09:29 +00:00
Trishna Guha 11de330372
change inventory_hostname to ansible_host to fix test (#32890)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 10:44:47 +00:00
Trishna Guha c40de24e9c
fix mtu check nxos_interface (#32880)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 10:40:37 +00:00
Ganesh Nalawade c3636108bc
Change netconf port in testcase as per test enviornment (#32883) 2017-11-14 15:11:44 +05:30
Trishna Guha a17244f896
ios_vlan DI module (#32490)
* ios_vlan DI module

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

* Integration test

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

* comment out testcases since the image is not available in dci

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

* add aggregate test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 05:50:17 +00:00
Prasad Katti f891e92581 ec2_key: fix fingerprint generation in tests (#32817) 2017-11-14 14:40:55 +10:00
Sam Doran ea3638b580 Add proper check mode support to the script module (#31852)
* 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
2017-11-13 15:33:44 -08:00
Matt Martz 99d4f5bab4 Remove uses of assert in production code (#32079)
* Remove uses of assert in production code

* Fix assertion

* Add code smell test for assertions, currently limited to lib/ansible

* Fix assertion

* Add docs for no-assert

* Remove new assert from enos

* Fix assert in module_utils.connection
2017-11-13 11:51:18 -05:00
Kellin 464ded80f5 Add link dest to synchronize module (#32746)
* Clean up after two recent synchronize tests

- add clean up after the last two tests in synchronize to make them
  match with the expectations in the previous tests

Signed-off-by: Robert Marshall <rmarshall@redhat.com>

* Add link-dest functionality to synchronize module

- add the link-dest option to the synchronize module code
- add tests for the link-dest option
- add documentation of the link_dest option to synchronize
- modify changed flag so it can properly work around rsync
  upstream not flagging hardlinks as a change properly in
  formatted output

Signed-off-by: Robert Marshall <rmarshall@redhat.com>

* Minor change to test
2017-11-13 11:13:25 -05:00
Trishna Guha f49555d494
nxos_bgp_neighbor_af feature idea disable-peer-as-check (#32665)
* nxos_bgp_neighbor_af feature idea disable-peer-as-check

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

* Add unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 14:48:31 +00:00
Trishna Guha e4052c1261
Add mtu option nxos_interface feature idea (#32680)
* Add mtu option nxos_interface feature idea

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

* Add unit test for mtu feature

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 14:48:04 +00:00
Mike Wiebe de8d00b401 Fix snmp bugs on Nexus 3500 platform (#32773)
* Add n35 platform support

* Fix regex bug and add snmp_location it tests

* Enable nxos_snmp_location tests
2017-11-13 08:03:06 +00:00
Adrian Likins 9c58827410
Better handling of malformed vault data envelope (#32515)
* Better handling of malformed vault data envelope

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
2017-11-10 14:24:56 -05:00
Frederic Lepied 35f79370e1 mock ncclient import in test_connection.py (#32786) 2017-11-10 11:53:04 -05:00
Dario Zanzico 8a21fa2c07 remove cpuHotAddEnabled, memoryHotAddEnabled defaults from configSpec (#25202)
* add hardware.hotadd_cpu, hardware.hotadd_memory parameters
* use hotadd_{cpu,memory} paramters on create integration tests
2017-11-10 13:09:30 +00:00
Tim Rightnour 4756b392ea Apply fix to allow the root resource pool of a cluster to be chosen (#31641)
Whitespace cleanup
2017-11-10 13:51:36 +01:00
Jordan Borean abc4210a33 azure_rm_virtualmachine: add custom image support (#32367)
* azure_rm_virtualmachine: added support for specifying custom image

* Use separate parameter for custom_image, add very basic test

* missed the version_added tag for doco

* removed whitespace I accidentally left in

* merged custom image into the image dict and added more tests

* added one more test
2017-11-09 18:48:14 -05:00
John R Barker ff7c349f11
Provide details via DCI Env (#32770) 2017-11-09 22:12:50 +00:00
Nathaniel Case 9c0275a879
Connection plugins network_cli and netconf (#32521)
* implements jsonrpc message passing for ansible-connection

* implements more generic mechanism for persistent connections
* starts persistent connection in task_executor if enabled and supported
* supports using network_cli as top level connection plugin
* enhances logging for persistent connection to stdout

* Update action plugins

* Fix Python3 RPC

* Fix Junos bytes<-->str issues

* supports using netconf as top level connection plugin

* Error message when running netconf on an unsupported platform
* Update tests

* Fix `authorize: yes` for `connection: local`

* Handle potentially JSON data in terminal

* Add clarifying detail if possible on ConnectionError
2017-11-09 15:04:40 -05:00
John R Barker 897b31f249
Use same TEST seperater as Shippable (#32758) 2017-11-09 18:23:10 +00:00
Ganesh Nalawade 37b0537279
Fix ios_config file prompt issue (#32744)
Fixes #23263

Add a carriage return (\r) at end on copy config
command which results in prompt on cli terminal
2017-11-09 22:43:49 +05:30
Will Thames 316e7939d6 [cloud] Improve aws testing and use {{ region }} var (#26892)
* Protect AWS credentials from accidental commits

* Improve documentation for IAM policies

* Update ELB tests to be multi region

Allow AZs to reflect the region in which the tests are run.

This will not work for regions with fewer than three AZs,
but those are relatively rare
2017-11-09 11:56:31 -05:00
Abhijeet Kasurde dbadb5a014 Add details about snapshot in result (#32730)
This fix adds details about snapshots in result of
vmware_guest_snapshot, when operation is successful.

Fixes: #32154

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-09 11:42:30 -05:00
Jiri Tyr 1a3037ff63 Making options of type list (fixing #32704) (#32706) 2017-11-09 10:57:27 -05:00
Mike Wiebe fedd1779cc Add ISSU capability and fix workflow bug for nxos_install_os module (#32540)
* Initial issu support

* Enhance ISSU support

* Additional refactoring to simplify code flow

* Remove debugs and bug fixes

* Update doc example output

* Update provider line in task example

* Remove unneeded else clause and comments

* Fix ansible-doc errors

* Satisfy ansibot requirements

* Update header docs

* Update nxos_install_os.py
2017-11-09 14:54:19 +00:00
Brian Coca db749de5b8 namespace facts
updated action plugins to use new guranteed facts
updated tests to new data clean
added cases for ansible_local and some docstrings
2017-11-09 09:48:14 -05:00
cnasten f1fe467c22 nso_config module for setting configuration in Cisco NSO (#30973) 2017-11-09 13:34:41 +00:00
John R Barker 4443da2d79
Remove debug (#32736)
* Make script executable
* Tidy up comments
2017-11-09 12:38:23 +00:00
John R Barker 4464635787
Specify branch details, add verbose, disable colour (#32731) 2017-11-09 11:43:41 +00:00
Martin Krizek 356901b72d yum: case for multilib when installing from a file (#32236) 2017-11-09 06:04:53 -05:00
Martin Krizek 714598e91b
acl: do not remove all default entries (#32615) 2017-11-09 10:31:33 +01:00