Commit graph

1441 commits

Author SHA1 Message Date
Philippe Dellaert
920cd7bb1c New module: Waiting for VMware tools to become available (#27236)
* Adding VMware tools module
Functionality: Waits for VMware tools to become available (running
state)

* Adding base integration test preparations
Until govcsim supports actual guest tool status, the tests are disabled

* Cleanup and better getvm method

* Updating Changelog

* Adding required metaclass and future import

* Rename to vmware_guest_tools_wait

* Cleanup of documentation

* Fixing review remarks
2017-08-10 03:50:58 +02:00
Zac Medico
501fc7a248 template: fix KeyError: 'undefined variable: 0 (#27972)
* template: fix KeyError: 'undefined variable: 0

For compatibility with the Context.get_all() implementation
in jinja 2.9, make AnsibleJ2Vars implement collections.Mapping.
Also, make AnsibleJ2Template.newcontext() handle dict type
for the 'vars' parameter.

See: d67f0fd4cc
Fixes: https://github.com/ansible/ansible/issues/20494

* add units/template/test_vars

* intg tests for jinja-2.9 issues like 20494

test cases here are based on
https://github.com/ansible/ansible/issues/20494#issue-202108318
2017-08-09 18:50:53 -04:00
David Moreau-Simard
b35c749268 Add a sensu_client module
This provides a sensu_client module in order to be able to dynamically
configure a Sensu client.

It takes a different approach than the existing Sensu modules such as
sensu_check but is hopefully a much more flexible and simple way of
handling configurations.
2017-08-09 16:36:39 -04:00
David Moreau-Simard
7a56e5d45d Add sensu_handler Ansible module
This provides a sensu_handler module in order to be able to dynamically
configure a Sensu handler.
2017-08-09 16:34:20 -04:00
Colin Nolan
db50650365 Adds support for all Consul 0.8 ACL rule scopes (#25800)
* Added in support for 'agent' and 'node' types.

* Tidies and moves `consul_acl` module closer to PEP8 compliance.

* Switched from using byspoke code to handle py2/3 string issues to using `to_text`.

* Made changes suggested by jrandall in https://github.com/ansible/ansible/pull/23467#pullrequestreview-34021967.

* Refactored consul_acl to support scopes with no pattern (and therefore a different HCL defintion).

* Corrects whitespace in Consul ACL HCL representation.

* Fixes Consul ACL to return the HCL equivalent JSON (according to the Consul docs) for the set ACLs.

* Repositioned import to align with Ansible standard (!= PEP8 standard).

* Adds Python 2.6 compatibility.

* Fixes PEP8 issues.

* Removes consul_acl.py as it now passes PEP8.

* Follows advice in the "Documenting Your Module" guide and moves imports up from the bottom.

* Tidies consul_acl module documentation.

* Updates link to guide about Consul ACLs.

* Removes new line spaces from error message string.

* Provide better error message if user forgets to associate a value to a Consul ACL rule.

* Minor refactoring of Consul ACL module.

* Fixes bug that was breaking idempotence in Consul ACL module.

* Detects redefinition of same rule.

* Adds test to check the Consul ACL module can set rules for all supported scopes.

* Fixes return when updating an ACL.

* Clean up of Consul ACL integration test file.

* Verify correct changes to existing Consul ACL rule.

* Adds tests for idempotence.

* Splits Consul ACL tests into cohesive modules.

* Adds test for deleting Consul ACLs.

* Test that Consul ACL module can set all rule scopes.

* Fixes issues surrounding the creation of ACLs.

Thanks for the comments by manos in https://github.com/ansible/ansible/pull/25800#issuecomment-310137889.

* Stops Consul ACL's name being "forgotten" if ACL updated by token.

* Fixes incorrect assignment when a Consul ACL is deleted.

* Fixes value of `changed` when Consul ACL is removed.

* Fixes tests for Consul ACL.

* Adds interal documentation.

* Refactors to separate update and create (also makes it possible to unit test this module).

* Improves documentation.

* Completes RETURN documentation for Consul ACL module.

* Fixes issue with equality checking for `None` in ACL Consul.

* Fixes Python 2 issue with making a decision based on `str` type.

* Fixes inequality check bug in Python 2.

* Adds tests for setting ACL with token.

* Adds support for creating an ACL with a given token.

* Outputs operation performed on Consul ACL when changed.

* Fixs issue with test for creating a Consul ACL with rules.

* Corrects property used to set ACL token in python-consul library.

* Fixes tear-down issue in test that creates a Consul ACL using a token.
2017-08-09 15:21:12 -04:00
saichint
14186af558 Fix for nxos_ospf idempotent issue (#27913) 2017-08-09 11:25:35 -04:00
Ricardo Carrillo Cruz
9f26b853e8 Remove vyos_facts neighbors integration tests (#27957)
The tests rely on setting the lldp IP on the management interface.
However, the IP discovered is the private IP of the node, and tests
require accessing it via Nodepool node public IP.
Removing that test for now to get CI green again, we'll reasses once we
release 2.4.
2017-08-09 15:24:27 +02:00
Trishna Guha
a005ca035d remove replace config test (#27953)
remove replace config eos_config test
2017-08-09 18:04:11 +05:30
Ricardo Carrillo Cruz
0f77afbd60 Change play timeout for persistent connection command timeout (#27948)
There's been a change in persistent connect framework that switches
playbook timeout (which corresponds to 'timeout' param) to command_timeout.
While we fix this and return the functionality, let's put the command_timeout
in place to avoid CI being red.
2017-08-09 12:44:36 +02:00
Ganesh Nalawade
c05b303db5 junos lldp interface test fix (#27946) 2017-08-09 15:17:36 +05:30
Trishna Guha
dd8b65395f fix eos failed tests (#27945)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-08-09 15:14:42 +05:30
Dag Wieers
6874ba23ff New module: Support manipulating XML files (#25323)
* Import original unmodified upstream version

This is another attempt to get the xml module upstream.
https://github.com/cmprescott/ansible-xml/

This is the original file from upstream,
without commit 1e7a3f6b6e2bc01aa9cebfd80ac5cd4555032774

* Add additional changes required for upstreaming

This PR includes the following changes:

- Clean up of DOCUMENTATION
- Rename "ensure" parameter to "state" parameter (kept alias)
- Added EXAMPLES
- Remove explicit type-case using str() for formatting
- Clean up AnsibleModule parameter handling
- Retained Python 2.4 compatibility
- PEP8 compliancy
- Various fixes as suggested by abadger during first review

This fixes cmprescott/ansible-xml#108

* Added original integration tests

There is some room for improvement wrt. idempotency and check-mode
testing.

* Some tests depend on lxml v3.0alpha1 or higher

We are now expecting lxml v2.3.0 or higher.
We skips tests if lxml is too old.

Plus small fix.

* Relicense to GPLv3+ header

All past contributors have agreed to relicense this module to GPLv2+, and GPLv3 specifically.

See: https://github.com/cmprescott/ansible-xml/issues/113

This fixes cmprescott/ansible-xml#73

* Fix small typo in integration tests

* Python 3 support

This PR also includes:
- Python 3 support
- Documentation fixes
- Check-mode fixes and improvements
- Bugfix in check-mode support
- Always return xmlstring, even if there's no change
- Check for lxml 2.3.0 or newer

* Add return values

* Various fixes after review
2017-08-08 20:21:03 -07:00
schwatvogel
b8d371ca8b Fixes #23558 rpm key ids (#27847)
* Changed rpm-keyid extraction and verification method
* minor style fixes
* fixed rpm key deletion,added integration test for mono key,fixed wording in integration tests
2017-08-08 11:56:03 -07:00
saichint
babec35faa Fix nxos_vtp_password and nxos_vrf_interface for remove idempotency tests (#27724)
* fixes for 27600 27676

* add sanity tests
2017-08-08 12:40:22 -04:00
David Newswanger
b985c34dd4 added integration tests for vyos_facts (#26748)
* broke vyos facts into two files

* list vyos facts when failing

* dynamically determine ip

* broke up assert
2017-08-08 18:20:47 +02:00
Abhijeet Kasurde
e244deedbd Add wait for vcsim to come online (#27887)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-08 09:15:51 -04:00
Mike Wiebe
65cf31e1ce Fix nxos_interface_ospf idempotence issue (#27783)
* Add tests and fix 27167

* Add modify test
2017-08-07 13:54:31 -04:00
Dag Wieers
3a86579b69 vcenter_license: New module to manage vCenter licenses (#25143)
This module supports check-mode and diff output.
It also includes basic integration tests.

This PR fixes #24971
2017-08-07 12:49:29 -04:00
Jordan Borean
0b69f3e40d win_stat: removed file in use test as it is too tempormental (#27832) 2017-08-07 14:23:01 +10:00
Jordan Borean
107e177658 win_stat: add explicit error message when file is in use (#27826)
* win_stat: add explicit error message when file is in use

* make the lock last a bit longer
2017-08-07 12:04:42 +10:00
Ricardo Carrillo Cruz
0343ac1a9d Fix asserts of junos_command netconf_json notequal and lessthanorequal (#27818) 2017-08-06 10:06:53 +02:00
Ricardo Carrillo Cruz
99e92f4bca Fix junos_command netconf_json lessthanorequal (#27808) 2017-08-05 20:55:11 +02:00
Ricardo Carrillo Cruz
0e4cbb4bf1 Remove inventory_hostname assert on junos_command netconf_text contains (#27807)
CI nodes have UUIDs as hostnames, not Ansible inventory hostnames.
2017-08-05 19:44:25 +02:00
Ricardo Carrillo Cruz
6a6bcb6749 Fix junos_command netconf_xml notequal asserts (#27806) 2017-08-05 17:49:48 +02:00
Ricardo Carrillo Cruz
2ad56c0700 Add a timeout to force socket creation on re-setting netconf port (#27801) 2017-08-05 15:28:06 +02:00
René Moser
fdaa803cca cloudstack: cs_vmsnapshot: fix pep8 (#27792) 2017-08-05 10:34:17 +02:00
René Moser
f1ef61da4e cloudstack: cs_domain: tests: add update tests (#27791) 2017-08-05 10:33:01 +02:00
Matt Clay
c59e32469f Add Fedora Python 3 Docker images and fix tests. (#27794)
* Add new Fedora docker images with Python 3.
* Use consistent env var for lookup test.
* Fix testing of virtualenv with Python 3.
* Fix docker_secret tests on Fedora 26.
* Add Python 3 support to Fedora postgresql test.
* Add Python 3 support to Fedora mysql tests.
* Fix uri test server for Python 3 on Fedora.
* Fix iso_extract test for Python 3 on Fedora.
* Add Python 3 support for Fedora to openssl tests.
* Fix dnf group test for Python 3 on Fedora.
* Use force with user deletion in become test.
2017-08-04 21:12:35 -07:00
Matt Clay
bf17cb6edd Test iso_extract on OS X. 2017-08-04 13:46:05 -07:00
Ganesh Nalawade
634327c5f6 Fix ios_fact integration test issue (#27771)
Fixes #27563
2017-08-05 00:47:53 +05:30
Ganesh Nalawade
02bcd7c0ed Fix for junos_netconf test failures in dci (#27776) 2017-08-05 00:47:32 +05:30
Dag Wieers
25e67d804c iso_extract: Reimplement using 7zip (not requiring root) (#24937)
* Reimplement iso_extract using 7zip (not requiring root)

So one of the drawbacks of the original implementation is that it required root for mounting/unmount the ISO image.
This is now no longer needed as we use 7zip for extracting files from the ISO.

* Fall back to using mount/umount if 7zip not found

As discussed with others.

Also improved integration tests.
2017-08-04 14:38:42 -04:00
Ricardo Carrillo Cruz
8e9fe76434 Replace mtu for for local-index on junos_command lessthan (#27772) 2017-08-04 17:56:41 +02:00
Ganesh Nalawade
0f261964f7 Make junos integration test checks platform independent (#27768) 2017-08-04 17:18:57 +02:00
Ganesh Nalawade
3c09f69765 change netconf test port from 8080 to 22 (#27761) 2017-08-04 19:30:00 +05:30
Ganesh Nalawade
181b31e282 junos integration test fixes for dci (#27759) 2017-08-04 18:46:57 +05:30
René Moser
5700b09610 cloudstack: new module cs_instance_nic_secondaryip, replaces cs_nic (#26491) 2017-08-04 15:01:12 +02:00
Ricardo Carrillo Cruz
c4c99d66fc Replace fxp0 for lo0 on junos_command equal and notequal tests (#27758)
The nodes in the CI do not use fxp nomenclature, but em.
Use lo0, as that's common for nodes in our CI and our test lab.
2017-08-04 14:46:59 +02:00
Ricardo Carrillo Cruz
19b1361184 Remove assert that junos command xml contains inventory_hostname_short (#27754)
The test assumes the node has the hostname set as the inventory_hostname_short.
That's not the case in our CI, we the inventory_hostname is a UUID, returned
by the openstack dynamic inventory.
2017-08-04 13:38:59 +02:00
Ricardo Carrillo Cruz
623235857f Change tx delay to 2 on the rest of junos_lldp tests (#27753) 2017-08-04 12:57:36 +02:00
Ricardo Carrillo Cruz
3acd192843 Fix assert on junos_lldp tx delay (#27752) 2017-08-04 12:46:35 +02:00
Ricardo Carrillo Cruz
a904f9c047 Change the transmit delay on junos_lldp test (#27750)
We are getting this error message:
"Advertisement-interval should be greater than or equal to four times the tx-delay".
Changing transmit delay to 2 meets that constraint.
2017-08-04 12:04:42 +02:00
Ganesh Nalawade
d3e5d30f7c Add aggregate for junos modules and sub spec validation (#27726)
* Add aggregate for junos modules and sub spec validation

*  aggregate support of junos modules
*  aggregate sub spec validation
*  relevant changes to junos integration test
*  junos module boilerplate changes

* Add new boilerplate for junos modules

* Fix CI issues
2017-08-04 14:55:58 +05:30
George Nikolopoulos
31b4ae2e6a New module: manage Citrix Netscaler GSLB site configuration (network/netscaler/netscaler_gslb_site) (#27639)
* Add netscaler_gslb_site

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
2017-08-03 15:26:17 +01:00
George Nikolopoulos
d88c07a037 New module: manage Citrix Netscaler GSLB service configuration (network/netscaler/netscaler_gslb_service)) (#27638)
* Add netscaler_gslb_service

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
2017-08-03 15:26:05 +01:00
George Nikolopoulos
cd865be987 New module: manage Citrix Netscaler SSL certificate keys (network/netscaler/netscaler_ssl_certkey)) (#27641)
* Add netscaler_ssl_certkey

* Fix options

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
2017-08-03 15:24:56 +01:00
George Nikolopoulos
e2f907ae3e Add netscaler_gslb_vserver (#27640) 2017-08-03 12:32:10 +01:00
Trishna Guha
60b3f80c6c add replace testcase eos_config (#27693)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-08-03 12:30:35 +01:00
Adrian Likins
6fbd0a8bb5 Add set_fact_persistent action and module. (#26153)
* Add 'cacheable' param to  set_fact action and module.

Used just like set_fact, except facts set with cacheable: true
will be stored in the fact cache if fact caching is enabled.

set_fact normally only sets facts in the non_persistent_fact_cache, so they
are lost between invocations.

* update set_facts docs

* use 'ansible_facts_cacheable' in module/actions result

* pop fact cacheable related items out of args/results

We dont want to use 'ansible_facts_cacheable' result item
or 'cacheable' arg as actual facts, so pop them out of the
dicts.
2017-08-02 15:57:58 -04:00
Adrian Likins
27a015f0ad add a 'min' type for gather_subset to collect nothing (#27085)
previously gather_subset=['!all'] would still gather the
min set of facts, and there was no way to collect no facts.

The 'min' specifier in gather_subset is equilivent to
exclude the minimal_gather_subset facts as well.

   gather_subset=['!all', '!min'] will collect no facts

This also lets explicitly added gather_subsets override excludes.

   gather_subset=['pkg_mgr', '!all', '!min'] will collect only the pkg_mgr
fact.
2017-08-02 11:04:01 -04:00