Commit Graph

3509 Commits (5c3bbd4620c4a94ece7741ecfe5514a1bd06422b)

Author SHA1 Message Date
Toshio Kuratomi 9f7b0dfc30 Remove automatic use of system six
* Enable the pylint no-name-in-module check.  Checks that identifiers in
  imports actually exist.  When we do this, we also have to ignore
  _MovedItems used in our bundled six.  This means pylint won't check
  for bad imports below ansible.module_utils.six.moves but that's
  something that pylint punts on with a system copy of six so this is
  still an improvement.
* Remove automatic use of system six.  The exec in the six code which
  tried to use a system library if available destroyed pylint's ability
  to check for imports of identifiers which did not exist (the
  no-name-in-module check).  That test is important enough that we
  should sacrifice the bundling detection in favour of the test.
  Distributions that want to unbundle six can replace the bundled six in
  ansible/module_utils/six/__init__.py to unbundle.  however, be aware
  that six is tricky to unbundle.  They may want to base their efforts
  off the code we were using:

  2fff690caa/lib/ansible/module_utils/six/__init__.py

* Update tests for new location of bundled six Several code-smell tests
  whitelist the bundled six library.  Update the path to the library so
  that they work.

* Also check for basestring in modules as the enabled pylint tests will
  also point out basestring usage for us.
7 years ago
Toshio Kuratomi da3d3d512e Enable pylint checking for undefined variables 7 years ago
René Moser a566a7ea2e cloud: cs_user: add feature keys handling (#27285) 7 years ago
Ricardo Carrillo Cruz 3a3bdde869 Fix multiple code and test issues on iosxr (#27267)
* Fix multiple code and test issues on iosxr

It passes the integration tests now.
Fixes #27123

* Fix pep8 issue

* Fix unit tests
7 years ago
Yanis Guenane 372956c16a Revert "Enforce the _raw_params variable with include_role (#26430)"
This reverts commit 05477412ba.
7 years ago
Eric Johnson 09e9203844 [google] adding a GCE labels module 7 years ago
Yanis Guenane d72ac0b391 openssl_privatekey: Standardize implementaton of the module
The OpenSSLObject class has been merged[1]. This commit makes the
openssl_privatekey rely on this class and standardize the way openssl
module should be written.

Co-Authored-By: Christian Pointner <cpointner@mgit.at>

[1] https://github.com/ansible/ansible/pull/26945
7 years ago
Trishna Guha 703eea3da2 eos_logging implementation module (#27093)
* eos_logging implementation module

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

* eos_logging integration test

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

* modify aggregate args logic

* changed collection to aggregate

* add blankline

* handle size value outside method
7 years ago
Philippe Dellaert c00554735f New module: management of the Nuage Networks VSP SDN solution (network/nuage/nuage_vspk) (#24895)
* Nuage module and unit tests with requested changes

* Cleanup of imports

* Adding check on python version

* Adding import try and catch wrappers

* Cleanup of requirements and adding integration tests

* Using pypi package for simulator

* Cleanup of requirements and adding integration tests

* Adding aliases for integration tests

* Adding module to import sanity test skip list

* Revert "Adding module to import sanity test skip list"

This reverts commit eab23af8c5.

* Adding check for importlib and cleanup of requirements
7 years ago
Trishna Guha e37e736ddb nxos_logging implementation module (#26949)
* nxos_logging implementation module

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

* pep8 fixes

* nxos_logging integration test

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

* test typo fix

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

* idempotent fix

* rename feature to facility

* make dest_group global var

* remove str from arg_spec
7 years ago
Yanis Guenane 8b22c45a45 Enable integration tests for the crypto/ namespace (#26684)
Crypto namespace contains the openssl modules. It has no integration
testing as of now.

This commits aims to add integration tests for the crypto namespace.
This will make it easier to spot breaking changes in the future.

This tests currently apply to:

  * openssl_privatekey
  * openssl_publickey
  * openssl_csr
7 years ago
Toshio Kuratomi 035be94271 Fix cloudformation module for import of non-module_utils file 7 years ago
Brian Coca 8387b839d8 add new yaml inventory for testing 7 years ago
Rob 3401a4b330 Rename classic elb modules to match new names applied to application LB modules (#25745) 7 years ago
Toshio Kuratomi 47f26ee11c Refactor the tests for _symbolic_mode_to_octal
* Move tests to their own file
* Port to a pytest parametrized test so it's easier to define new tests
* Now that _symbolic_mode_to_octal is a classmethod, we don't have to
  instantiate an AnsibleModule to test it.
* Add tests for #14994, having more than one operator per role and umask
  chmod
7 years ago
Dag Wieers a5eea9042e vmware_host: Small fixes and docs updates (#25144)
* vmware_host: Small fixes and docs updates

This PR includes:
- A fix to no longer require a datacenter folder for adding a host
- Documentation improvements
- Ensure imports are specific

* Update vmware_host

Fix adds following:
* Update logic in vmware_host
* Update example documentation
* Added test case for vmware_host

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 9649195c26 Refactor getvm method (#27188)
Fix refactors getvm method and modules which are using it.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay d031ff8aec Disable zypper* tests which are timing out. 7 years ago
Ricardo Carrillo Cruz 66f90d1401 Add update_password always and update_password on_create tests to iosxr_user (#27230)
* Add idempotency test to delete aggregate of iosxr users

* Add update_password always and on_create asserts to iosxr_user
7 years ago
Ricardo Carrillo Cruz 4ad022b622 Add idempotency test to delete aggregate of iosxr users (#27228) 7 years ago
Ricardo Carrillo Cruz 2dc5066f83 Test idempotency after one iosxr user is created (#27227) 7 years ago
Ricardo Carrillo Cruz ec323514ef Remove first all users tested on iosxr_user (#27226) 7 years ago
Ricardo Carrillo Cruz e9a0411059 Assert username and secret is within first element of results (#27219) 7 years ago
Dag Wieers be1c517f4d Add example of templating inline using copy module (#19752)
* Add example of templating inline using copy module

The **copy** module documentation implies that `content:` only works
for 'simple values' and for complex stuff you need the **template**
module, but that is an understatement. You can use **copy** to template
anything you desire.

So I changed the wording, added an example, and also added a note
to the template module that the **copy** module could be used for
'inline templating'.

This fixes #19741.
7 years ago
Toshio Kuratomi 6a41a4f311 Expand the result from pwd to make the test more robust
Sometimes MacOSX's pwd doesn't return an expanded path.  Not sure why
but this test is still valid if we expand it via a playbook filter so
go ahead and do that.
7 years ago
David Newswanger 362f43c996 added mssing testcas variable (#27125) 7 years ago
Abhijeet Kasurde ede82e2130 Implement vmware_argument_spec for required params (#25731)
Without the fix hostname, username and password params
used to skip required check.

Fixes #25696

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Frederic Lepied 7a02f2545a Allow to skip test_aci_rest if no xmljson is installed
There is no such package in Fedora so building the Fedora package fails. See
e970237a2f_ffe3b87d/rpmbuild.log

Introduced by e970237a2f
7 years ago
Jordan Borean 5c6e5d4841 win_domain_group: new module (#26682)
* win_domain_group: new module
7 years ago
Matt Clay 1c611a85ab Disable failing dpkg_selections test. 7 years ago
Matt Clay 5617d68c3e Disable failing apt test. 7 years ago
Nathaniel Case 85e7e342b0 nxos_bgp_af correct parents (#26996)
* move config location

* client-to-client is inverse of BOOL_PARAMS
7 years ago
Gabor Lekeny 7eab802669 SSH fails with '"parsed": false' error message
Fixes: #15436
7 years ago
Toshio Kuratomi f86ce0975d Add a directory walker to copy
* We need a directory walker that can handle symlinks, empty directories,
  and some other odd needs.  This commit contains a directory walker that
  can do all that.  The walker returns information about the files in the
  directories that we can then use to implement different strategies for
  copying the files to the remote machines.
* Add local_follow parameter to copy that follows local symlinks (follow
  is for remote symlinks)
* Refactor the copying of files out of run into its own method
* Add new integration tests for copy

Fixes #24949
Fixes #21513
7 years ago
Toshio Kuratomi 753a3a03d0 Revert "Fix for recursive copy slowness"
This reverts commit 78ced5318f.

The fix for copy slowness did not handle circular symlinks.
7 years ago
Pilou 556a1daa33 fix searched paths in DataLoader.path_dwim_relative (avoid AnsibleFileNotFound) (#26729)
* add unit test: nested dynamic includes

* nested dynamic includes: avoid AnsibleFileNotFound error

Error was:
Unable to retrieve file contents
Could not find or access 'include2.yml'

Before 8f758204cf, at the end of
'path_dwim_relative' method, the 'search' variable contained amongst
others paths:
'/tmp/roles/testrole/tasks/tasks/included.yml' and
'/tmp/roles/testrole/tasks/included.yml'.
The commit mentioned before removed the last one despite the method
docstrings specify 'with or without explicitly named dirname subdirs'.

* add integration test: nested includes
7 years ago
Ganesh Nalawade 5ab8d30d10 Add net_vrf implementation for junos (#27055)
*  junos_vrf implementation
*  junos_vrf integration test
*  net_vrf integration test for junos
7 years ago
David Newswanger 039706a239 When running all network tests at once, list the ones that failed at the end. (#27075)
* list failed tests for iosxr

* list failed tests for ovs

* list failed tests for junos

* list failed tests for ios

* list failed tests for eos

* list failed tests for nxos

* list failed tests for vyos
7 years ago
Jordan Borean a260063ffd Added function to convert camelCase to snake_case for powershell (#26203)
* Added camel case to snake case converters

* removed uneeded shebang

* renamed util to remove PowerShell from the name
7 years ago
Toshio Kuratomi df15583ad0 Promulgate house's fix for docker_volume to docker_secret
* Revert change to docker_common as it's not as good as the try: except fix
* limit docker_volume fix to ImportErrors
* fix docker_secret i nthe same way
* Remove docker_secret from import tests
7 years ago
Will Thames ef8c9798d3 include_role handlers bug fix (#26335)
* Ensure that include_role properly fires handlers

include_role needs to ensure that any handlers included
with the role are added to the _notified_handler and
_listening_handler lists of the TaskQueueManager, otherwise
it fails when trying to run the handler.

Additionally, the handler needs to be added to the
PlayIterator's `_uuid_cache` or it fails after running
the handler

Add more uuid debug statements - this code was hard
to debug with existing debug statements, so add more
uuid information at little additional output cost.

Fixes #18411

* Add tests for include_role handlers

Tests for #18411
7 years ago
Nathaniel Case 56a0b988a9 nxos integration fix part 1 (#27069)
* Assorted Python 3 fixes

* Fix `testcase` definition in integration tests

* Fix nxos_acl_interface

* clean up nxapi after nxos_nxapi
7 years ago
James Mighion b8337ee9d3 New module aireos_command (#26769)
* Adding ciscowlc_command module and unit tests.

* Adding __init__.py for unit test.

* Fixing PEP8 W503.

* Renaming module from ciscowlc_command to aire_command.

* Renaming aire_command to aireos_command.
7 years ago
Frederic Lepied 65d093d9a7 Skip f5 tests if f5-sdk is not installed (#27035)
Fixes: bug #27034

Introduced by 278fa552f8
7 years ago
Tim Rupp 09e9b4b4ba Adds refactored bigip_monitor_tcp (#26842)
This module needed to be refactored to use the REST API and
coding conventions for newer modules. This patch adds those changes.
This patch also deprecates params in favor of separate modules. These
deprecated params will be removed in 2.5.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp/tasks
7 years ago
Andreas Olsson 593297d7a2 Only use `git verify-tag` when verifying annotated tags (#26414)
* Only use `git verify-tag` when verifying annotated tags

The command `git verify-tag` only applies to annotated tags. When
verifying lightweight tags, which are more similar to non-moving
branches, one has to use `git verify-commit` instead.

Using ':' as a separator is appropriate since that is one of the
characters not allowed in a Git reference name.

See also https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html

* Improve testing of the Git module's gpg verification
7 years ago
Sloane Hertel 79e54f4006 [cloud] s3_bucket: policy comparison - fixes #25428 (#25723)
Creates a new way to compare bucket policies by making their elements hashable & comparing that way after normalizing syntax like single-item lists.
7 years ago
Abhijeet Kasurde cf34cefbdc Add FindByUUID testcase for vmware_guest_facts (#27022)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers 2b4a8095e9 Simplify XML error-handling and typo (#26929)
This PR fixes:
- A typo in the aci_login function
- Improve (XML) error-handling
- Rename status_code back to status
7 years ago
Ganesh Nalawade abb4361990 Add vyos_interface default description (#27029)
* Add default description string to vyos_interface

* If `state=up` it should remove the `disable` configuration
  for interface. However, if no other interface parameter is configured
  this ends up deleting the interface itself which is not the desired
  behaviour. Hence adding a default description field to avoid such
  scenario's.

* Minor changes

* Add default description to aggregate
7 years ago
James Mighion f682d9bf49 Adding aruba_command module along with unit tests. (#26625)
* Adding aruba_command module along with unit tests.

* Fixing PEP8 E303 too many blank lines.

* Adding default for timeout.

* Removing unused arguments. Moving default for timeout argument. Fixing cliconf to find hostname.

* Fixing PEP8 E302.
7 years ago
Matt Davis 907b662dc6 Powershell module_utils loader and tests (#26932)
* supports custom module_utils loads (anything in module prefaced with `#Requires -Module Ansible.ModuleUtils.*`)
* supports all usual PluginLoader module_utils locations (built-in lib/ansible/module_utils/, custom path from config, playbook module_utils/, ~/.ansible/module_utils, role module_utils, etc), 
* moves Powershell module_utils from module_utils/powershell.ps1 to module_utils/powershell/Ansible.ModuleUtils.PowerShellLegacy.psm1
7 years ago
Dag Wieers 636f8737c9 win_unzip: Add integration tests, check-mode, various (#25335) 7 years ago
Matt Davis 9d3494eb87 add generated password to win_owner test user (#26826)
* previous test without a password failed on hosts that had strict password policy
7 years ago
Dag Wieers 1e8713a50a win_shortcut: Fail when command is not absolute path (#26533)
This PR ensures the user gets a proper error when the `src` is not an absolute path.

And some cosmetic cleanup, and improve integration tests.
7 years ago
Matt Clay 09146e5573 Add files failing import test to skip list. 7 years ago
Tim Rupp a236d249ae Adds the bigip_configsync_actions module (#26506)
This module is required as part of HA configuration of a set of
BIG-IPs. It is used to initiate and way for configuration syncing
to happen.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_configsync_actions.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_configsync_actions/tasks
7 years ago
Tim Rupp 75e609c15e adds the bigip_ucs module (#26663)
This module allows you to load existing UCS files onto a BIG-IP
system

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_ucs.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_ucs/tasks
7 years ago
Tim Rupp 72f41148a0 Adds tcp_echo module for bigip (#26844)
This patch is part a refactor of TCP monitors for BIG-IP. This module
may file in testing without the base tcp module merged because it makes
use of similar fixtures.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_echo.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_echo/tasks
7 years ago
Tim Rupp 278fa552f8 Adds half-open tcp monitor module (#26920)
This is necessary as a part of refactoring the tcp monitor module.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_half_open.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_half_open/tasks
7 years ago
Ganesh Nalawade e0cf64d64c Fix idempotency issue in vyos_interface integration test (#26993) 7 years ago
Ganesh Nalawade 58dc6c7882 vyos_interface integration test fix (#26976) 7 years ago
Ricardo Carrillo Cruz 15eb0d463d Revert "Do not grep eos_command for filtering virtio (#26972)"
This reverts commit b742930253.
7 years ago
Ricardo Carrillo Cruz b742930253 Do not grep eos_command for filtering virtio (#26972)
It seems piping doesn't work on eos_command, so just search
for string on entire stdout.
7 years ago
Ganesh Nalawade 33ac35c68d Fix vyos intergration test issue (#26947)
* Fix vyos intergration test issue

* Fix review comment
7 years ago
Abhijeet Kasurde f7c8e7bdab Update vmware_inventory (#26308)
Fix adds
* Exception handling
* Unit tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ganesh Nalawade b8cd646afd net_lldp_interface module implementation for junos (#26915)
*  junos_lldp_interface module implementation
*  junos_lldp_interface integration test
*  net_lldp_interface module intgration test for junos
*  Add lldp configuration parameter in junos_lldp
*  Modify junos_lldp testcase as per above change
*  Add net_lldp_interface module documentation
7 years ago
Guillaume Coré 42ca1ef040 Add unit tests for parted module (#24164)
* Add unit tests for parted module

Test the current expected behavior of the module:
- mock parted() and get_device_info()
- Use some of the examples and test the 'script' passed to parted.
- mock check_parted_label() to return false, as if parted version is > 3.1
- assert get_device_info output is correct

Current implementation of the module runs parted several time while going
through all parameters (flags, name, ...). Between calls it uses get_device_info
to update the dictionary. Use check_mode for some of the tests to force module
to go through all the parameters even is dictionary is not updated.

* test_parted.py: add "name" param into expected results

since 78fff751ab, parse_partition_info
fetch the partition name. This commit adds 'name' key and value into
the expected results.
7 years ago
Ivo van Kreveld e976f299f8 Divided test methods of TestExtendValue class (#22574)
Divided the two test methods of the TestExtendValue class into multiple test methods so there is a test method for each compare.
7 years ago
Ricardo Carrillo Cruz 4532c791fd Add missing provider on disable eapi tasks (#26928) 7 years ago
Ricardo Carrillo Cruz 258d2058cd Remove enable EAPI from prepare_eos_tests (#26910)
Enabling EAPI is not common on CLI *and* EAPI tests, therefore
enabling it should be put at the eapi.yaml task level.
7 years ago
Toshio Kuratomi ff22528b07 Consolidate boolean/mk_boolean conversion functions into a single location
Consolidate the module_utils, constants, and config functions that
convert values into booleans into a single function in module_utils.

Port code to use the module_utils.validate.convert_bool.boolean function
isntead of mk_boolean.
7 years ago
Abhijeet Kasurde e979663dfe Add testcase for vmware_guest_facts (#26873)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers e970237a2f New module: access Cisco ACI (network/aci/aci_rest) (#26029)
* aci_rest: New module to access Cisco ACI

This PR includes:
- Relicense as GPLv3+
- Check-mode support
- Cosmetic changes to documentation
- Examples in YAML format
- Removal of incorrect requirements (for this module)
- Do not log passwords
- Implement native fetch_url instead of requests
- Use standard hostname, username and password parameters
- Add alias src for parameter config_file
- Add mutual exclusive content option for inline data (and show some inline examples)
- Add timeout parameter
- Add validate_certs parameter
- Handling ACI result output (identical for JSON as XML input)
- Parse/expose ACI error output to user

* Lower case method, add use_ssl, Use python dicts

This commit includes:
- Use lowercase method names
- Add `use_ssl` parameter (not the `protocol` parameter)
- Use a python dict for the request data (not a JSON string)
- Documentation improvements

* Ensure one of 'content' or 'src' is provided

* Fix issue with totalCount being a string in JSON

This fixes the problem with JSON output where totalCount is a string and
not an integer.

This fixes jedelman8/aci-ansible#7

* Improve code documentation

* Improve error handling and module response

* Small typo

* Improve documentation and examples

* Keep protocol parameter, but deprecate it

* Extrude aci functions from module_utils

* aci_rest: Add unit tests
7 years ago
Nathaniel Case 855544604a Fix nxos_bgp_neighbor_af advertise_map and advertise_map_non_exist (#26721) 7 years ago
Ricardo Carrillo Cruz d3fcb0d1de Disable eos_user eapi tests (#26895)
They are failing, so let's disable them and we investigate in other change
the fix.
We can revert this when fixed.
7 years ago
Ricardo Carrillo Cruz bd24c4ce9d Use eos_config for eos_user tests teardown (#26893)
Purge is not idempotent, so let's fix it with other change.
For teardown, it's better to use eos_config/eos_command.
7 years ago
Ricardo Carrillo Cruz baa9290d71 Replace network-admin for network-operator on eos_user collections test (#26891)
The 'admin' word was being masked by Ansible as potential cred.
Let's just use network-operator since we are just testing here
we can create users in aggregate.
7 years ago
Trishna Guha e5c2e1b7be iosxr_logging implementation module (#26886)
* iosxr_logging implementation module

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

* iosxr_logging integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ricardo Carrillo Cruz 6a71d6fa2e Remove eapi include on eos_vlan as there are no eapi based tests (#26888) 7 years ago
Trishna Guha c38bccb3c4 Add ios_logging implementation module (#26785)
* Add ios_logging implementation module

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

* fix doc

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

* integration test net_logging and ios_logging

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

* modify the module code

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

* modify the module code

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

* change collection to aggregate

* fix buffer size logic

* fix pep8 issues
7 years ago
sramakr b980a5c02a Use Boto3 for ec2_group Fixes #23507 (#25340)
* Use Boto3 for ec2_group

Currently boto doesn't support ipv6. To support ipv6 in ec2_group, we need boto3.
boto3 has significant API changes, which caused more re-factoring for ec2_group module.
Added additional integration test to test_ec2_group role.

* Follow the standard for boto3 ansible

Fixed imports. Use boto3 ansible exception with camel_dict_to_snake_dict.
Refactored the call to authorize/revoke  ingress and egress.

* Removed dependancy with module ipaddress

Added new parameter called cidr_ipv6 for specifying
ipv6 addresses inline with how boto3 handles ipv6 addresses.

* Updated integration test

* Added ipv6 integration test for ec2_group

* Set purge_rules to false for integration test

* Fixed import statements

Added example for ipv6.
Removed defining HAS_BOTO3 variable and import HAS_BOTO3 from ec2.
Cleaned up import statements.

* Fixed exception handling

* Add IAM permissions for ec2_group tests

Missing AuthorizeSecurityGroupEgress necessary for latest tests

* Wrapped botocore import in try/except block

Import just botocore to be more similar to other modules
7 years ago
Ganesh Nalawade 879acf378d junos implementation of net_lldp (#26872)
*  junos_lldp module
*  junos_lldp integration test
*  net_lldp integration test for junos
*  Other minor changes
7 years ago
René Moser 30ad30c470 cloudstack: remove CloudStackException dep for several modules (#26874)
* cloudstack: cs_affinitygroup: remove CloudStackException dependency

* cloudstack: cs_domain: remove CloudStackException dependency

* cloudstack: cs_firewall: remove CloudStackException dependency

* cloudstack: cs_host: remove CloudStackException dependency

* cloudstack: cs_instancegroup: remove CloudStackException dependency

* cloudstack: cs_pod: remove CloudStackException dependency

* cloudstack: cs_configuration: remove CloudStackException dependency, fix pep8

* cloudstack: cs_cluster: remove CloudStackException dependency

* cloudstack: cs_network_acl: remove CloudStackException dependency

* cloudstack: cs_network_acl_rule: remove CloudStackException dependency

* cloudstack: cs_zone_facts: remove CloudStackException dependency

* cloudstack: cs_zone: remove CloudStackException dependency

* cloudstack: cs_vpn_gateway: remove CloudStackException dependency

* cloudstack: cs_vpc: remove CloudStackException dependency

* cloudstack: cs_sshkeypair: remove CloudStackException dependency

* cloudstack: cs_role: remove CloudStackException dependency

* cloudstack: cs_ip_address: remove CloudStackException dependency

* cloudstack: cs_ip_staticnat: remove CloudStackException dependency

* cloudstack: cs_resourcelimit: remove CloudStackException dependency

* cloudstack: cs_region: remove CloudStackException dependency

* cloudstack: cs_project: remove CloudStackException dependency

* cloudstack: cs_network: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule_member: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule: remove CloudStackException dependency

* cloudstack: cs_iso: remove CloudStackException dependency
7 years ago
Rene Moser 3c99315bdd cloudstack: cs_router: add integration tests 7 years ago
Rene Moser 9543025b91 cloudstack: cs_router: fix pep8 7 years ago
Robin Roth 2fc1df7870 Git test is no longer destructive
Fixed by #26458
7 years ago
René Moser 1d907de966 cloudstack: cs_user: fix pep8 and minor restyling (#26849) 7 years ago
Pilou d9265c7498 os_ironic: fix broken import (#26802) 7 years ago
Ganesh Nalawade bf48364c72 junos implementation for net_l3_interface module (#26829)
* junos implementation for net_l3_interface module

*  junos_l3_interface implementation
*  junos_l3_interface integration test
*  net_l3_interface integration test for junos

* Fix module name typo
7 years ago
Matt Clay e0e5b4cf64 Optimize running of CI cloud integration tests. 7 years ago
Matt Clay 27033915cc Add --list-targets and speed up --explain. (#26838)
* Add ansible-test --list-targets option.
* Speed up ansible-test integration --explain.
7 years ago
Matt Davis 5c8e19d630 re-enable win_chocolatey tests, add win_template to smoketest (#26835) 7 years ago
Matt Clay e63f69464f Add ansible-test options and docs. (#26823)
* All integration commands support --continue-on-error
* The network-integration command supports --inventory
* Add landing page for compile test docs.
* Add bot documentation links.
7 years ago
Matt Clay 7931e11437 Use subset of Windows tests for "all" tests. (#26830) 7 years ago
Matt Davis 32914cac3b tag subset of Windows module tests for smoketest
* once smoketest is implemented in CI, will run a much smaller set of Windows module integration tests for changes to module_utils or connection subsystems
7 years ago
Jordan Borean 8e05d7d962 win_secedit: Added module with tests/diff mode (#26332)
* win_secedit: Added module with tests/diff mode

* fixed up test issues

* Added missing return value

* change for win_secedit based on review

* updated win_security_policy examples for rename
7 years ago
Ricardo Carrillo Cruz 53295b2cbf Add timeout to EAPI eos_system tests (#26822)
Getting random failures, let's bump timeout in all of them
7 years ago
Dag Wieers 4a1864765b Windows: Path integration tests (#26490)
These integration tests were used for testing the exact behaviour of
Ansible for YAML-style syntax and key=value syntax.

This includes fixes to win_shortcut (as `src` can be a URL too)
7 years ago
Ricardo Carrillo Cruz 028ce1da15 Rmove EOS vlan EAPI tests (#26818)
These are not working locally, removing for now will put it in place
when issues are fixed.
7 years ago
Nathaniel Case 61249995a1 Update nxos_interface_ospf & add test (#26644)
* Update nxos_interface_ospf & add test
7 years ago
Jordan Borean eb1ed6567c win_regedit: rewrite to support edge cases and fix issues (#26468)
* win_regedit: rewrite to support edge cases and fix issues

* fix up byte handling of single bytes and minor doc fix

* removed unused method

* updated with requested changes
7 years ago
Ricardo Carrillo Cruz 080e9ee694 Add missing test_cases var to eos_vrf and eos_vlan (#26815) 7 years ago
Ricardo Carrillo Cruz 9d95ea0832 Bump EOS EAPI set hostname timeout param (#26810)
For some reason, it's taking longer as usual in CI, bumping it
makes the tests to pass on my manual testing.
7 years ago
Matt Clay 76158db10c Improve sanity import test messaging. (#26782) 7 years ago
Ricardo Carrillo Cruz ca5439e1e2 Switch to save_when on EAPI tests as well (#26807)
save is deprecated.
7 years ago
Ganesh Nalawade 751ad7021c vyos implementation for net_interface module (#26799)
* vyos implementation for net_interface module

*  vyos_interface implementation module
*  vyos_interface integration test
*  net_interface integration test for vyos

* Change collection to aggregate
7 years ago
Abhijeet Kasurde c10a59b745 Add testcase for vmware_vm_facts (#26342)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 789218c215 Initial ansible-test sanity docs. (#26775)
* Rename no-iterkeys test for consistency.

* Require docs for all ansible-test sanity tests.

* Initial ansible-test sanity docs.

* Fix capitalization of Python.

* Fix sanity code smell test false positives.

* Fix another code-smell false positive.
7 years ago
Peter Sprygada 3bbb32cac5 fixes error when trying to run show start over eapi (#26800) 7 years ago
Abhijeet Kasurde 156b29b26b Fix for check_mode in archive (#26788)
Fix adds check_mode fix for archive module. Also,
adds unit tests for archive module

Fixes: #26750

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Lujeni 661791dcb7 Fix the editable condition into pip module (#19028) (#19688)
* Fix the editable condition into pip module (#19028)

* Add editable to tests

Default changed to False, so now editable: True is needed explicitly in
tests
7 years ago
Matt Clay 7bc85f9b44 Restore zypper tests. (#26784)
* Revert "Temporarily disable zypper tests due to timeouts."

This reverts commit 25f943e22f.

* Revert "Disable zypper_repository tests due to errors."

This reverts commit 5833197a19.
7 years ago
Matt Clay e1b9af9082 Add retries to remote test package installs. 7 years ago
jctanner 245a4d30b9 vmware_guest: fix datastore selection on equal sized disks and add tests (#26774)
* Fix datastore selection on equal sized disks and add tests
7 years ago
Rene Moser a4359d5818 cloudstack: cs_role: add integration tests 7 years ago
Matt Clay 462444b2be PEP 8 fix. 7 years ago
Pilou 2a92120ffa INI inventory plugin: add documentation about variable types (#25798)
* INI inventory: check variable types
* INI inventory: add doc about variable types

Fixes #25784
7 years ago
Ricardo Carrillo Cruz af4dc6d0eb Add vyos_lldp and vyos_lldp_interface modules (#26753)
* Add vyos_lldp and vyos_lldp_interface modules

* Fix module docstring issue

* Fix bogus aggregate reference

* Add vyos_lldp integration tests

* Add vyos_lldp_interface integration tests

* Remove unused import for run_commands

* Add VyOS net_lldp integration tests

* Remove junos and netconf from net_lldp integration tests

* Add net_lldp_interface integration tests

* Correct CLI filtering tests for VyOS

* Fix pep8 issues

* Fix more pep8 issues
7 years ago
Pilou 4b3d6dfa8a Use pycodestyle instead of pep8 (#25947) 7 years ago
René Moser 7329a392ff cloudstack: cs_region: add integration tests (#26767) 7 years ago
Matt Clay fad469efca Ignore platform_agnostic.yaml in ansible-test. 7 years ago
Matt Clay 5833197a19 Disable zypper_repository tests due to errors. 7 years ago
Matt Clay 0b784c65b1 Add sanity import test to ansible-test. (#26730)
* Add sanity import test to ansible-test.
* Run sanity import test on all python versions.
7 years ago
Matt Davis 74cc99fa35 enable minimal test for win_chocolatey in shippable (#26731)
* until we can have a robust internal source for chocolatey (and/or PSScriptAnalyzer sanity tests), we want to at least make sure that the module is syntactially valid.
7 years ago
Matt Clay 20d49af475 Add ANSIBLE_TEST_CI env var to integration tests. 7 years ago
jctanner df507ca9c4 vmware_guest: fixes for cache objects and datacenter association (#26719)
* vmware_guest: fixes for cache objects and datacenter association
* find_all_objs was only looking for datastores
* Clear the result if it's datacenter is not correct.
* Re-enable pyvmomi installation

Addresses #25011
Addresses #26511
7 years ago
Matt Clay 25f943e22f Temporarily disable zypper tests due to timeouts. 7 years ago
Nathaniel Case 5cfdd5df0f nxos_pim_interface (#26367)
* Add unit tests to nxos_pim_interface

* Update tests to match module

* Update nxos_pim_interface

* Address pep8 issues
7 years ago
rahushen 74947168e3 Add nxos_command IT and generalize UT (#26617)
* Add nxos_command IT sanity

* generalize nxos_command UT for different NXOS platforms
7 years ago
Mike Wiebe eae37ecf21 Add integration tests for nxos_acl_interface (#26616)
* Add integration tests for nxos_acl_interface
7 years ago
Ken Celenza 31b6ac896d Kc update ip filter (#26566)
* add first, last and next usable

* add usable ip filters

* add size usable, range usable and wildcard

* add ip prefix and netmask filter

* add network formatting and check if ip in subnet

* clean up order, add comments

* fix pep8

* update format by index

* clean up and updates from jmcgill298
7 years ago
Ganesh Nalawade e14e37ee1e Fix junos unit test failures (#26676)
*  Use lxml api's in unit test to parse xml
*  Remove unwanted import in unit test
*  Add ncclient dependency in unit test requirement
7 years ago
Pilou 2d7e00c670 mock_unfrackpath_noop: handle follow parameter (#26662) 7 years ago
Ricardo Carrillo Cruz 6634f94323 First indentation of first task on prepare_eos_tests (#26706)
Hard to see what was going on :/
7 years ago
Ricardo Carrillo Cruz e618221a0f Split Eth1 and Eth2 configs of prepare_eos_tests (#26704)
Previous single block wasn't working for Eth2, despite not erroring
out.
7 years ago
Ricardo Carrillo Cruz efcdc68ad2 Set Ethernet2 to no switchport (#26703)
Missed this in earlier commit, otherwise eos_vrf tests fail.
7 years ago
Ricardo Carrillo Cruz 7ffa882f9d Fix provider indentation on prepare EOS ethernet pre step (#26694) 7 years ago
Ricardo Carrillo Cruz 59edc44166 Set no switchport on ethernet interfaces (#26693)
Otherwise this will silently make vrf tests to not work correctly.
7 years ago
Ricardo Carrillo Cruz cb59e61253 Fix enable ethernes (#26692)
Missing lines param
7 years ago
Ricardo Carrillo Cruz 8df175fa90 Make sure the Ethernet interfaces are up before running EOS tests (#26691) 7 years ago
Trishna Guha 2f60f97ee3 vyos_logging implementation module (#26654)
* vyos_logging implementation module

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

* vyos_logging integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ricardo Carrillo Cruz 4ef47fe6c9 Switch eos_config save tests to use save_when (#26688)
Save seems broken, just use save_when since we are deprecating save.
7 years ago
Ricardo Carrillo Cruz 29347b7e80 Fix assert on eos_vrf integration test (#26686)
We need to check the session_name key is not in the dict, rather
than checking it has no value, otherwise the test fails.
7 years ago
Ricardo Carrillo Cruz 9f2d58f7b4 Fix eos_config config test (#26679)
We needed to re-register show-running config before doing the
idempotency test.
7 years ago
Ricardo Carrillo Cruz 4006b5d18f Replace Ethernet5 for Ethernet2 on eos integration tests (#26674)
In our CI, we only have 3 NICS: Management1, Ethernet1 and
Ethernet2.
7 years ago
Ricardo Carrillo Cruz 3f5736e14e Add vyos_l3_interface module (#26610)
* Add vyos_l3_interface module

* Add integration tests for vyos_l3_interface

* Add more corner cases in tests and fix multiple IPs logic
7 years ago
jctanner 10fc4417f7 vmware_guest: use the datacenter as a context for clone specs (#26511)
* Slight refactor on vmware_guest to fix path searching and vcsim compatibility.
* Clean up pep8 errors
* Fix more pep8 issues
* Add assertions
* Remove debug failure
* Update docsting for folder with examples
* Revise _get_vm_prop based on suggestions
* Implement folder walker to find a folder path
* More enhancements for datacenter->datacenter cloning
* Fix a few pep8 issues
* Remove useless check for subclass of None
* Fix a few suggestions
* Move serialize_spec to a util function
* Group exceptions together

Fixes #25011
7 years ago
Tomas Tomecek 5b898a7732 add connection plugin for buildah (#26170)
* add connection plugin for buildah

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

 * create a method to invoke buildah
 * mount container filesystem persistently so we can access it
   during put and fetch
 * use copyfile function for copying files

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* revert tests

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* progress

(this will be squashed into a single commit before merge)

 * add docs for the conn plugin
 * fix issue invoking the integration tests
 * add a way to invoke commands inside the container as a different user

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fix shellcheck warning

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
7 years ago
Peter Sprygada 0b6f0e6c0d adds more intelligent save logic and diff to network config modules (#26565)
* adds more intelligent save logic and diff to network config modules

* adds sha1 property to NetworkConfig
* adds new argument save_when to argument_spec
* adds new argument diff_against to argument_spec
* adds new argument intended_config to argument_spec
* renames config argument to running_config with alias to config
* deprecates the use of the save argument
* before and after now work with src argument
* misc module clean

Modules updated
* nxos_config
* ios_config
* eos_config

Most notably this makes the save mechanism more intelligent for config
modules for devices that need to copy the ephemeral config to
non-volatile storage.

The diff_against argument allows the playbook task to control what the
device's running-config is diff'ed against. By default it will return
the diff of the startup-config.

* removes ios_config from pep8/legacy_files.txt

* extends the ignore lines argument to the module

* clean up CI errors

* add missing list brackets

* fixes typo

* fixes unit test cases

* remove last line break when returning config contents

* encode config string to bytes before hashing

* fix typo

* addresses feedback in PR

* update unit test cases
7 years ago
Matt Clay ab5dd24430 Handle pip/python errors in ansible-test better. 7 years ago
Dag Wieers e1e79b7a74 wakeonlan: Improve module coverage (#26655)
Trying to get this to 100% !
7 years ago
Rene Moser 64643c4e7d cloudstack: cs_iso: add cross_zone param 7 years ago
Rene Moser 31d530d6af cloudstack: cs_iso: add display_text param 7 years ago
Rene Moser 3dc379c89d cloudstack: cs_iso: add update support, fixes pep8 7 years ago
mikedlr 07a4079a81 aws.core in new aws dir in module utils - module with AnsibleAWSModule class and fail_json_aws (#25780)
* aws module utils including AnsibleAWSModule
* fail_json_aws method on AnsibleAWSModule to do fail_json nicely with AWS exceptions
* aws module util - feedback - rename to aws/core.py & improve doc strings
7 years ago
Adrian Likins 261c40bac7 Fix azure module use of module_utils.facts (#25318)
Module was importing '*' from facts to get to TimeoutError
but that has moved to facts.timeout, so import is updated.

Also rm old style imports to new style imports at the start
of the module.

'signal' py module was used and referenced but never imported,
presumably it was using the 'signal' previously imported into
module_utils.facts. Now imported directly.

'AnsibleModule' was also from a * import, so now imported directly.

A ref to 'module' was in _delete_disks_when_detached(), so now it
is updated to raise an AzureException() with its message, and
let its caller catch it and call module.fail_json()
7 years ago
Ricardo Carrillo Cruz b81209c187 Fix multiple EOS EAPI code and test issues (#26651) 7 years ago
Adrian Likins 0fc0b6f059 Mv AnsibleFactCollector back to module_utils (#26150)
It was in lib/ansible/modules/system/setup.py since it
was the only thing using it, but move it back to module_utils
and add a ansible_collector.get_ansible_collector() to build
a facts collector just like the one used by setup.py

mv test_setup.py -> test_ansible_collector.py
All the code it was testing is now in ansible_collector

rm code to create 'ansible_facts' subkey from namespace

Just leave it up to the caller to do, and just return a
flat dictionary from AnsibleFactCollector.collect()
7 years ago
Ricardo Carrillo Cruz 9f02bb02bf Add missing test_items variable to eos_banner target role (#26645) 7 years ago
David Newswanger 64f0eb50ff remove vyos/1.0.5 from test/runner/completion/network.txt 7 years ago
Ganesh Nalawade be89ef3eb6 junos_linkagg implementation and junos modules refactor (#26587)
* junos_linkagg implementation and junos modules refactor

*  junos_linkagg implementation
*  junos_linkagg integration test
*  net_linkagg integration test for junos
*  decouple `load_config` and `commit` operations,
   to allow single commit (in case on confirm commit) and
   to perform batch commit (multiple `load_config` followed by single
   `commit`)
*  Other related refactor

* Fix CI issues

* Fix unit test failure
7 years ago
Matt Clay 82558baaf6 Add role dependencies to change classification. 7 years ago
Matt Clay 779306cfed Disable skipped tests for remote platforms. (#26624) 7 years ago
Matt Davis 961af6d9e2 disable new win_get_url test
* invalid drive letter breaks new Powershell path validation (this is a separate issue that needs to be solved)
* test also exposes a minor bug in win_get_url where a nonexistent directory in the root of a drive that exists passes the "does the parent dir exist" check and causes DownloadFile to bomb (this should be fixed by dag's rewrite of win_get_url in https://github.com/ansible/ansible/pull/26612)
7 years ago
Matt Clay 9604a71568 Fix postgresql test on RHEL. 7 years ago
James Mighion 58ade65ea6 Adding admin option for iosxr_config (#26509)
* Adding admin option for iosxr_config. Adding unit test for new admin option for iosxr_config. Fixes #24308

* Removing space on empty line.
7 years ago
Ken Evensen f31d3ddeb7 Pamd Updates (#25817)
* Fix for #25522
Fix for #25855
Fix for #23963

* Minor fix

* Updates per bcoca.  Fix in regex for silvinux.
7 years ago
Trishna Guha 07498ebed3 fix nxos_overlay_global (#26422)
* fix nxos_overlay_global

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

* swap check_mode with candidate

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
John R Barker 738fb51c84 Add defaults for eos_system (#26593) 7 years ago
Trishna Guha b81882e2a8 vyos_static_route implementation module (#26426)
* vyos_static_route implementation module

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

* Add vyos_static_route implementation module

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

* unit test

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

* modify vyos_static_route

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

* integration test vyos_static and net_static_route

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

* fix typo integration test

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

* modify vyos_static_route

* modify integration test

* vyos_static_route doc build fix

* fix integration test data

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

* update net_static_route cli test set

* minor fix
7 years ago
Josh Moore d5ae6cc585 postgres_db: add dump and restore support (#20627)
* Feature #2731: added postgres import and dump

* Feature #2731: be more permissive of arguments

```
hacking/test-module -m ./ppostgresql_db.py -a "db=example state=dump target=/tmp/out"`
```

failed previously since host, user, and port were required as keywords
in the pg_dump / pg_import methods.

* Feature #2731: fixed doc string for validate-modules

```
$ ansible-validate-modules database/postgresql/
```

now passes.

* Feature #2731: disable 'password' for dump/restore

* Feature #2731: bump added version to 2.3

* Feature #2731: replace db_import with db_restore

* Feature #2731: add missing version description

* Feature #2731: fix 'state' description

* Feature #2731: fix pep8 issues

* Feature #2731: put state documentation in a single string

* Bump added version from 2.3 to 2.4

* Fix pep8 and pylint errors

* Attempt yaml formatting of documentation string

* Add integration tests for postgres_db:dump/restore

* Update dump/restore logic to support new kw-args

Also attempt to support password; integration tests are
still failing.

* Revert to postgres user for dump/restore

Passing PGPASSWORD is not working for subprocesses. For the
moment, reverting to the strategy of failing if login_password
is set and using `postgres` for all testing of dump/restore.

* Various cleanups to have tests passing

* Working tests for {sql,tar} x {,bz2,gz,xz}

* Use pg_user to support FreeBSD

* Revert login_ prefixes and re-enable password support

All `login_` keywords are mapped to their non-prefix versions
so the previous changes were effectively using `postgres` for
all actions. With the proper keywords, PGPASSWORD-passing to
the subprocess is now working.

* Optionally add password

environ_update doesn't handle None values in the
dictionary to be added to the environment. Adding
check.

* Quick fixes

* Refactor login arguments after fixes from pchauncey

The fixes introduced by pchaunchy pointed to further issues
(like no --dbname on PG<=9.2) with the login parameters. This
refactors them and adds further tests.

Note: this will still not pass integration tests due to a further
      issue with pg_dump as a non-admin user:

      pg_restore: [archiver (db)] Error while PROCESSING TOC:
      pg_restore: [archiver (db)] Error from TOC entry 1925; 0 0 COMMENT EXTENSION plpgsql
      pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql

* Introduce target_opts for passing limiting dumped/restored schemas

The current integration tests (PG version and template DBs) don't
permit a regular user (`{{ db_user1 }}`) access to plpgsql causing
restores to fail. By adding an option for passing arbitrary args to
pg_dump and pg_restore, testing is made easier. This also paves the
way for `-j` usage, once the PG version is bumped.
7 years ago
Tim Rupp 37ca55bf71 Adds missing fields for iapp service (#26507)
The iApp service module worked fine previously, but this patch
adds enhancements to it to include more fields that can be
specified when creating iapp services.
7 years ago
jhawkesworth deae1499ed win_get_url improvements; allow dir for dest and helpful error if dest parent dir doesn't exist (#25453)
* win_get_url now allows dir for destination and gives helpful message if download parent dir does not exist

* fix yaml lint failure
7 years ago
Andrew Saraceni 7d3951d065 win_scheduled_task: Add enhanced run option support (#24174)
* add enhanced run option support for win_scheduled_task

* changed run_level option to runlevel

* correct merge conflicts since task path fix

* changed run_level option to runlevel

* changed do_not_store_password to store_password, and other minor fixes

* conditional logic swap, and documentation change for password
7 years ago
Dag Wieers 52c1a1936d win_wakeonlan: New module to send Wake-On-Lan packets (#26232)
This is the Windows implementation of the **wakeonlan** module.
Useful if you want to wake up systems in a remote network with only
Windows systems.
7 years ago
Matt Clay a66bd8f7c3 Don't update RHEL instances before running tests. 7 years ago
Matt Clay 2146bb57ce Simplify FreeBSD setup for tests. 7 years ago
Matt Clay 4a013d6d69 Add RHEL 7.3 to ansible-test and CI. (#26550)
* Add support for RHEL to ansible-test.
* Enable RHEL 7.3 on Shippable.
7 years ago
Matt Clay 941a32a632 Install passlib before starting lookups test. 7 years ago
Matt Clay f5edc840e2 Update docker_secret test for RHEL 7.3 on AWS. 7 years ago
Matt Clay 3cfbc17dc6 Fix yum installroot test releasever lookup.
With this change the tests will pass on a RHEL 7.3 AMI.
7 years ago
Andrea Tartaglia 0d48732e7e Integration tests requirements (#26545)
* Removed pexpect and jmespath requirement, install it in task directly
* Removed passlib dependency
7 years ago
David Newswanger 294c0f91c0 added option to ansible-test to run test playbooks using the debug strategy (#26499) 7 years ago
René Moser 3050856f2a cloudstack: cs_instancegroup: fix pep8 (#26534) 7 years ago
Michael De La Rue 3c4db1e8dd Mdd psql user aws fix (#23988)
* postgresql_user module - transaction logic hacks to allow recovery from failed select

* postgresql_user - PEP8 and style fixes to make debugging easier

* postgresql_user - move password changing logic to separate function

* postgresql_user - trap failure in case where there is no access to pg_authid

* postgresql_user - further PEP8 fixes

* postgresql_user - Simplify password change logic and improve imports according to suggestions from PR review

* postgresql_user - Eliminate pep8/blank line errors introduced in merge

* Check behaviour when pg_authid relation isn't readable

TASK [postgresql : Normal user isn't allowed to access pg_authid relation:
      password comparison will fail, password will be updated] ***
An exception occurred during task execution. To see the full traceback,
use -vvv. The error was: psycopg2.ProgrammingError: permission denied
for relation pg_authid

* Don't reintroduce passlib, remove useless query
7 years ago
Rene Moser 89be01f2a2 cloudstack: cs_instance_nic: add integration tests 7 years ago
Dag Wieers f8982dcbd0 wakeonlan: Add integration tests and improvements (#26254)
This PR includes:
- Checkmode improvements
- Integration tests
- A fix for python3
- PEP8 fixes

This backports improvements from the win_wakeonlan module.
7 years ago
Ricardo Carrillo Cruz 9a9b1db62b Enable vyos_linkagg integration tests and test with 3 NICs (#26519) 7 years ago
Ganesh Nalawade ba60ac04fc Implementation of junos_static_route module (#26501)
* Implementation of junos_static_route module

*  junos implementation of net_static_route
*  integration test for junos_static_route
*  integration test for junos net_static_route

* Minor change

* Doc change

* Fix CI issue
7 years ago
René Moser 63f4aa3069 cloudstack: cs_host: add state maintenance (#26502) 7 years ago
Matt Clay a94156227d Improve error handling for cs tests. 7 years ago
Matt Clay 45e377566c Refactor ansible-test config classes. (#26505)
* Move Config classes from executor.py to config.py.
* Move Environment and Test config to config.py.
* Move Coverage/CoverageReport Config to config.py.
* Clean up type hints.
7 years ago
Matt Clay bd8ea89b1b Improve handling of network test changes. 7 years ago
Matt Clay 9e98140e2e Fix docker ce install for opensuse. (#26498)
* Fix docker ce install for opensuse.
* Revert "Temporarily disable docker_secret tests."
7 years ago
Matt Clay 97731a7d1b Temporarily disable docker_secret tests.
Will be re-enabled once opensuse tests are fixed.
7 years ago
Ganesh Nalawade 10233ef3b5 junos_user declarative module changes (#26475)
* junos_user declarative module changes

*  Active/Deactivate support
*  junos_user integration test
*  net_user intergration test for junos

* Add version_added for active param
7 years ago
Trishna Guha c5fb4bbcc0 Fix nxos_switchport and unit test (#26131)
* fix nxos_switchport

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

* nxos_switchport unit test

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

* legacy file

* update unit test

* handle exception
7 years ago
Chris Houseknecht 6af53cf0ef Adds docker_secret module (#26469) 7 years ago
Ricardo Carrillo Cruz c6c5c6cf81 Add VyOS integration tests for net_linkagg (#26478) 7 years ago
Abhijeet Kasurde 3004c913e6 Pep8 fixes for opendj_backendprop_* (#24587)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz c73275b4b8 Add vyos_linkagg module (#26418)
* Add vyos_linkagg module

* Add vyos_linkagg integration tests

* Fix pep8 issue

* Address several review comments
7 years ago
Matt Clay c26a556929 Add check for known_hosts changing during tests. (#26470)
* Add check for known_hosts changing during tests.
* Don't use known hosts file for delegate_to test.
7 years ago
Matt Clay 2401fb5b92 Fix expect timeout test. (#26473) 7 years ago
Matt Clay 895e6c5d06 Fix wait_for with newer versions of psutil. (#26455)
* Add support for newer psutil versions.
* Fix psutil install in wait_for integration test.
* Fix test requirements for wait_for elapsed.
7 years ago
Brian Coca 2a041d10d2 better backwards compat handling of status
restored 'rc' inspection but only when failed is not specified
removed redundant changed from basic.py as task_executor already adds
removed redundant filters, they are tests
added aliases to tests removed from filters
fixed test to new rc handling
7 years ago
Matt Clay fba76444e0 Add `ansible-test coverage report --show-missing`. 7 years ago
Matt Clay 69ab6fa803 Remove legacy pycrypto test requirement. 7 years ago
Matt Clay cbb5d1e5d5 Update git test to not rm ~/.ssh/known_hosts. 7 years ago
Matt Clay ef7f56c6e4 Revert "enabled vyos banner and config (#26438)"
This reverts commit b9b5183644.

Reverting this due to instability in vyos tests.
7 years ago
Matt Clay e4096cc97a Use bc instead of sharutils in yum tests.
This allows the tests to pass on a stock RHEL 7.3 AMI.
7 years ago
David Newswanger b9b5183644 enabled vyos banner and config (#26438) 7 years ago
Matt Davis 08af853ee9 fix win_shell/win_command nonzero RC failure setting (#26443)
* as a result of recent core engine changes to ignore rc, modules are responsible to set `failed` on nonzero RC if they want that behavior
* the `failed` filter currently triggers on nonzero RC, which caused the tests to false-pass
* updated tests to explicitly check both rc and failed keys, as well as using the failed filter.
7 years ago
saichint 5229370364 fix for nxos_acl_interface idempotency (#26156)
* fix for nxos_acl_interface idempotency

* shippable error fix

* fix issues with python3.x
7 years ago
Adrien Vergé 4ee1d0dd35 Revert "Limit yamllint version on python 2.6." (55aec8e)
Thanks to the report by Matt Clay at [1], yamllint now supports Python
2.6. Tests were enabled on Travis for 2.6 to make sure there will be no
regressions in the future.

[1]: https://github.com/adrienverge/yamllint/issues/55
7 years ago
Yanis Guenane 05477412ba Enforce the _raw_params variable with include_role (#26430)
Currently, when using this test, it fails with the following error
message:

> AttributeError: 'NoneType' object has no attribute 'rfind'

This is because there is no _raw_params value for parent_include.args
here
https://github.com/ansible/ansible/blob/devel/lib/ansible/playbook/included_file.py#L104

This commit ensure the value is specified so it can be reused and hence
not fail at this specific line.
7 years ago
Will Thames f8d522de69 Support check mode for efs_facts (#26273)
Facts modules support check mode by default

Fix pep8 compliance
7 years ago
Jordan Borean 8e9d04043a win_regedit: fix for same dword value (#26415) 7 years ago
John R Barker 50f2313b47 Continue running network tests after failure (#26407)
Previously tests would stop running on the first failure.
With this PR we move onto running the tests for the next module. This
allows DCI runs to have a fuller picture of what's broken.

This only effects manual and DCI runs, it doesn't effect Shippable runs
as this the modules are tested directly.
7 years ago
Rene Moser c92170e90d cloudstack: cs_instance: extent integration tests for ssh key handling 7 years ago
Trishna Guha ad3fe08aae fix vyos_banner multiline string issue (#26383)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Toshio Kuratomi 3ee997b720 metadata and doc generator optimization and fixes
* Fix ansible-doc traceback when a plugin doesn't parse correctly
* Change extract_metadata ivocation to take either an ast or source
  code.  When given source code, it can find file offsets for the start
  and end of dict.  When given the ast, it is quicker as it doesn't have
  to reparse the source.  Requires changing the call to the function to
  use a keyword arg.
* Fix reading of metadata to find the last occurrence of
  ANSIBLE_METADATA instead of the first.
* Add some more unittests to get closer to complete coverage
7 years ago
David Newswanger 0a6dcf4169 changed ansible-test so that it replaces . with - instead of . with _ so that the hostname is valid 7 years ago
Matt Davis 0ee46cb0df converted become runas to explicit CreateProcessWithLogonW (#26378)
* fixes become_method: runas for unprivileged users
* sets permissions on tempdir appropriately
* allows automatic system environment generation for new token (old Process.Start way prevents this)
* add basic become runas tests
7 years ago
Brian Coca 8f758204cf correct, cleanup & simplify dwim stack (#25956)
* correct, cleanup & simplify dwim stack

latlh chIS logh HeS qar wej chel laD
better errors
update find_file to new exception

* addressed latest comments

* test should not use realpath as it follows symlink

this fails when on OS X as /var is now a symlink to /private/var
but first_found was not supposed to follow symlinks
7 years ago
Brian Coca 272f5fd03a avoid doing cmp on .git 7 years ago
Ganesh Nalawade 11e72d495d Add net_logging platform agnostic module and junos implementation (#26316)
* Add net_logging platform agnostic module and junos implemenatation

*  net_logging platform agnostic module
*  junos implemenatation of logging module
*  net_logging integration test
*  junos_logging integration test
7 years ago
Trishna Guha 1b427aa419 Fix vyos banner idempotent (#26338)
* fix vyos_banner idempotent

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

* fix vyos_banner unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay cd3a795e65 Permissions fix for remote coverage downloads. 7 years ago
Matt Clay 554423cf04 Expose docker socket to test containers. 7 years ago
Matt Clay 7ab4a889ad Update tox.ini to use ansible-test. 7 years ago
René Moser 77d0542985 test, integration: add diff support (#26296) 7 years ago
Pierre-Louis Bonicoli d08ff86169 ansible-test: pass --[skip-]tags to ansible-playbook
Thanks to Olaf Klischat for the idea.
7 years ago
Abhijeet Kasurde f0a5854e39 Fix unresolved import in vmware module_utils (#25288)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 5c374cd1ae Add Test Suite for vmware_vswitch (#26076)
Fix adds test suite for vwmare_switch

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 69e55b2cfe Add testsuite for VMware Distributed vSwitch (#26193)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 28fcfcdbef Add testsuite for vmware cluster (#26281)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Trishna Guha 93bbcd8a32 vyos_user fix idempotent (#26289)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Toshio Kuratomi 34589cee6d Unittests for extracting metadata from plugins (#26218)
* Unittests for extracting metadata from plugins
* Port plugin_docs to use the generic extract_metadata function
* Make the helper functions seek_end_of{string,dict} private
7 years ago
Rob d1652aecf0 Upgrade ec2_remote_facts to use boto3 (#22937)
* Deprecate ec2_remote_facts in favor of ec2_instance_facts which uses boto3

* Update legacy-files.txt with deprecated file name change
7 years ago
Abhijeet Kasurde bc4ff8aed9 Modify flask_control for vmware_host test suites (#26175)
Fix adds additional helper methods to get information about
host system from vcsim

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 17c1bb6f08 Remove legacy integration test make targets. (#26255)
* Remove legacy integration test make targets.
* Remove incorrect role path from cloudscale test.
7 years ago
Mike Wiebe 240de965ee Fix nxos_acl module and add IT tests (#25966)
* Fix nxos_acl module and add IT tests

* Add nxos_acl test

* Add additional properties to test
7 years ago
Alexander Braverman 038e090bc1 Add sshpass to Dockerfile for Ansbile integration tests 7 years ago
David Newswanger 9500aac5b9 added integration tests for dpkg_selections (#26043) 7 years ago
Nathaniel Case 3102746ebe nxos_pim_rp_address fixes (#26119)
* nxos_pim_rp_address tests

* nxos_pim_rp_address changes

* Address issues with idempotence
7 years ago
Ricardo Carrillo Cruz 8a1cd05fdc Assert vyos_user commands output against first element of array (#26233) 7 years ago
Ricardo Carrillo Cruz c8ba8bdd6d Add ios_static_route module (#25527)
* Add ios_static_route module

* Add ios_static_route integration tests

* Add platform agnostic integration tests for IOS

* Replace unicode function to ansible module_utils to_text

* Add collections handling logic

* Add integration tests for collections

* Make collections and prefix mutually exclusive

* Add net_static_route integration tests for collections

* Do not store load_config return value, as it returns nothing
7 years ago
David Newswanger 5242ff1b59 added integration tests for rpm_key (#26134) 7 years ago
Ganesh Nalawade 911a7e085e Add active param to junos declarative modules (#26222)
*  active/deactivate configuration capability
*  integration test refactor
7 years ago
Trishna Guha 15e78d1073 fix iosxr_user integration test (#26220)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Nathaniel Case ad6c4a544e nxos_pim updates (#26145)
* nxos_pim tests

* Cleanup nxos_pim
7 years ago
Nathaniel Case eea18e9875 nxos_vxlan_vtep_vni fixes (#25913)
* nxos_vxlan_vtep_vni first pass
* nxos_vxlan_vtep_vni tests
7 years ago
Jordan Borean 98fc54f02d win_find: fix for empty nested directories (#26164) 7 years ago
Dag Wieers 0a15ab7ce9 win_say: Fix issue, add integration tests (#26089)
* win_say: Fix issue, add integration test

This PR includes:
- Make speed_speech an integer parameter
- Test for empty parameters too
- Add integration tests

* Improve the $speech_speed parameter handling

As requested
7 years ago
David Moreau-Simard 9fdd07fba8 Provide the list of files that were included by include_vars
include_vars will now also return a key 'ansible_included_var_files'
which contains the list of files that were successfully loaded.
This is useful information and, amongst other things, a way for users
to know exactly what files were included when debugging their
playbooks.
This also allows us to improve the integration tests around
include_vars.
7 years ago
Abhijeet Kasurde bb847e332d Check if SELinux is installed on system (#24437)
* Refactor code
* PEP8 fixes
* Check if /etc/selinux/config file exists before
  proceeding any other operations

Fixes #21622

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers 5be32aa5af Move ping and win_ping closer together (#26028)
So in an effort to verify if Windows modules are feature complete
compared to the python equivalent, I stumbled upon these differences.

This PR includes:
- Add missing 'data' option from documentation
- Simplify ping module
- Update integration tests to test exception
7 years ago
Tim Rupp e7402e3d5b Support full path templates (#26121)
This patch allows the iapp service module to support full path
templates instead of only relative templates
7 years ago
Tim Rupp 04ac15f241 Adds bigip_qkview module (#25980)
This module can be used to generate qkviews on a bigip and
save them to a location on the ansible controller.
This module is primarily used for diagnostics.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_qkview.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_qkview/tasks
7 years ago
Tim Rupp 16bd93a14e Refactors bigip ssl cert module (#25882)
Includes unit tests and a refactor of the module to make code
more easily supported. Also fixes an issue where the extension of
the cert name was not appended if not provided. This problem was
causing certs to not be editable in the UI. Also deprecates params.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_ssl_certificate.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_ssl_certificate/tasks
7 years ago
Matt Clay 55aec8ebc9 Limit yamllint version on python 2.6. 7 years ago
Trishna Guha be11d12fa2 fix vyos_user integration test assert (#26185)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
George Nikolopoulos 11836a0296 Add module netscaler_cs_action (#26147) 7 years ago
Trishna Guha 9a88c157ec add vyos, openvswitch to network-all playbook (#26167)
* add vyos to network-all playbook

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

* Add opensvwitch to network-all

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha 34eca3816d fix vyos_user configuration (#26166)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ganesh Nalawade 3bd8dbb53d Add support for netconf network discovery (#25435)
* Add support for netconf network discovery

* Fix unit test failure
7 years ago
Dag Wieers bb7ebc6a55 win_msg: Added integration tests, parameter fixes (#26126) 7 years ago
Dag Wieers fceb71128e Return code is not very useful to assume a task failed
So I thought I fixed it before, but there's still one location where
the `rc` value is influential to decide whether a task failed or not.

We already established in #24867 that it is up to the module to decide
what the return code actually means, not the task executor. We modified
the existing modules to move that logic into the module (eg. for
command, shell, etc.)

This relates to the integration tests of win_robocopy, where different
return codes have different meanings:

  - 0  --  No files copied.
  - 1  --  Files copied successfully! (changed)
  - 2  --  Some Extra files or directories were detected. No files were copied. (warning)
  - 3  --  (2+1) Some files were copied. Additional files were present. (changed)
  - 4  --  Some mismatched files or directories were detected. Housekeeping might be required!  (changed + warning)
  - 5  --  (4+1) Some files were copied. Some files were mismatched.  (changed + warning)
  - 6  --  (4+2) Additional files and mismatched files exist.  No files were copied. (warning)
  - 7  --  (4+1+2) Files were copied, a file mismatch was present, and additional files were present. (changed + warning)
  - 8  --  Some files or directories could not be copied! (changed + failed)
  - 9 - 15  --  Fatal error. Check log message! (failed)
  - 16  --  Serious Error! No files were copied! Do you have permissions to access $src and $dest? (failed)

This also fixes #24652
7 years ago
George Nikolopoulos 6bed831f8c Add netscaler_server module (#25537) 7 years ago
Abhijeet Kasurde 96dcd1060c Add testsuite for vmware_datacenter (#26133)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Nathaniel Case 3d6d428bbc Test multiple nxos versions at once (#25595)
* Extend tests to have multiple device representations

* Move filepath munging to nxos_module

* Device needs to be kwarg so we can leave it off

* Update other nxos tests

* Update tests that fell through
7 years ago
Abhijeet Kasurde 79b2897462 Update vmware_guest_find module (#26066)
Fix updated following:
* Update Documentation
* Update Examples
* Find VM's folder using VM's UUID
* Make name as optional parameter

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 9f7fcf15be Add missing quote on limit_to vyos includes (#26139) 7 years ago
Toshio Kuratomi e238ae999b Cyptography pr 20566 rebase (#25560)
Make pyca/cryptography the preferred backend for cryptographic needs (mainly vault) falling back to pycrypto

pyca/cryptography is already implicitly a dependency in many cases
through paramiko (2.0+) as well as the new openssl_publickey module,
which requires pyOpenSSL 16.0+. Additionally, pyca/cryptography is
an optional dep for better performance with vault already.

This commit leverages cryptography's padding, constant time comparisons,
and CBC/CTR modes to reduce the amount of code ansible needs to
maintain.

* Handle wrong password given for VaultAES format

* Do not display deprecation warning for cryptography on python-2.6

* Namespace all of the pycrypto imports and always import them

  Makes unittests better and the code less likely to get stupid mistakes
  (like using HMAC from cryptogrpahy when the one from pycrypto is needed)

* Add back in atfork since we need pycrypto to reinitialize its RNG just in case we're being used with old paramiko

* contrib/inventory/gce: Remove spurious require on pycrypto

(cherry picked from commit 9e16b9db275263b3ea8d1b124966fdebfc9ab271)

* Add cryptography to ec2_win_password module requirements
  * Fix python3 bug which would pass text strings to a function which
    requires byte strings.

* Attempt to add pycrypto version to setup deps

* Change hacking README for dual pycrypto/cryptography

* update dependencies for various CI scripts

* additional CI dockerfile/script updates

* add paramiko to the windows and sanity requirement set

  This is needed because ansible lists it as a requirement. Previously
  the missing dep wasn't enforced, but cryptography imports pkg_resources
  so you can't ignore a requirement any more

* Add integration test cases for old vault and for wrong passwords

* helper script for manual testing of pycrypto/cryptography

* Skip the pycrypto tests so that users without it installed can still run the unittests

* Run unittests for vault with both cryptography and pycrypto backend
7 years ago
Abhijeet Kasurde e7e091d154 Update Flask controller for latest testsuites (#26125)
Fix adds GPL Licence and few improvements to accommodate
new testsuites.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Davis 36ad934156 re-enable non-pipelined mode for Powershell (#25012)
* fixes #23986
* fixes 3rd-party Windows connection plugins that don't support pipelining (eg awsrun)
7 years ago
Jordan Borean b41c42cf0d win_share: Add integration tests and various fixes (#25691)
* win_share: Add integration tests and various fixes

* docs and comments updates based on PR review

* fixed up documentation issue with URL
7 years ago
Daniele Lazzari 9d932b64f0 New module: Add module to install/remove/register/unregiser windows powershell modules (windows/win_psmodule) (#23604)
* Add new windows module win_psmodule

* Add checkmode, allow_clobber parameter, integration tests

* Add aliases, replace win_raw with win_shell

* restore original test_win_group1.yml, add powershel version test

* fix var type

* add conditional on assert

* integration tests conditional tasks review

* documentation fix, test fix, adds result.change

* fix yml

* fix railing whitespace

* add nuget_changed and repository_changed in result
7 years ago
Matt Clay e56ea435f0 Skip dependency check for deleted files. (#26112) 7 years ago
Andreas Olsson 05dc76f3b2 In the git module let ssh do its own host checking
There are too many possible special cases for Ansible to be able to
precheck known_hosts files without introducing all kinds of false
failures.

* Alternative known_hosts paths
* Alternative host name aliases
* ssh host certificates
* SSHFP + DNSSEC

Fixes #24860
7 years ago
George Nikolopoulos 0bf64aa241 Add netscaler_save_config module (#25614) 7 years ago
mihu 6b76bc924f [cloud] New feature for ec2_group: allow deleting groups by id (#26022) 7 years ago
Rene Moser 3fe5de907f cloudstack: cs_host: add integration tests 7 years ago
Peter Sprygada b12ca95824 renames dict_combine to dict_merge in network_common (#26073) 7 years ago
Matt Clay 15beaed6bc Update FreeBSD pg test to use postgresql95-server.
The py-psycopg2 package now requires postgresql95-server instead of
postgresql93-server. Installing py-psycopg2 will automatically remove
postgresql93-server if it is installed, breaking integration tests.
7 years ago
Nathaniel Case 21c7fcf9c0 nxos_vxlan_vtep (#25971)
* nxos_vxlan_vtep tests

* Fix issues with nxos_vxlan_vtep
7 years ago
Trishna Guha 3482a6326b Fixes nxos_vpc_interface (#25907)
* nxos_vpc_interface fix

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

* nxos_vpc_interface unit test

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

* fix state_present

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

* add state_present unit test

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

* make ansibot happy

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

* teardown get_config

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay b82cc8e7cc Fix network integration test config. (#26057)
* Remove unsupported network tests from CI.
* Add `net` to list of network target prefixes.
7 years ago
Matt Clay 4530eea7f8 Docker image updates for integration tests. (#26054)
* Sort packages to install.
* Add python-argparse to centos6 docker image.
* Add gcc and python dev lib to docker images.
* Add python cryptography to docker images.
* Add coverage using pip instead of OS packages.
* Update old pip versions in docker images.
* Exclude */pyshared/* from coverage reporting.
7 years ago
Trishna Guha 66f9e23e43 vyos net_system implementation (#25994)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Mark Szymanski 1703db4211 Allow iam_cert to be renamed or moved without needing to specify cert or key data (#20622)
Generally Pep8 and flake8 compliant so removing from legacy-files.txt
7 years ago
David Newswanger b2d88f8b73 updated ansible-test integration to skip any files in test/integration/targets/ that aren't directories.
Fixes #26007
7 years ago
Matt Clay 75a3ac5ca5 Fix test for missing __init__.py for modules. 7 years ago
jctanner 996dcb989c Add the cloud provider script for the vcenter simulator container (#25964) 7 years ago
Ganesh Nalawade b2f46753ec Add junos_system declartive module and other related change (#25859)
* Add junos_system declartive module and other related change

*  junos_system declartive module
*  integration test for junos_system
*  integration test for net_system (junos platform)
*  pep8 fixes for junos modules
*  move to lxml from elementree for xml parsing as it support
   complete set of xpath api's
*  other minor changes

* Fix CI and doc changes

* Fix unit test failures

* Fix typo in import

* Fix import issue for py2.6

* Add missed Element in import
7 years ago
jctanner 33c61d1cdf Vcsim container (#25236)
* Add container files for vcenter simulator
* Add controller file to spin up the container during tests
7 years ago
Nathaniel Case 0296c2285b nxos_vrf fix (#25812)
* Fixes #25031

* Slight cleanup and add tests
7 years ago
Trishna Guha 947e9aba45 Add vyos_banner implementation module (#25862)
* Add vyos_banner implementation module

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

* vyos_banne integration test

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

* vyos_banner unit test

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

* minor fix on banner text

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Steffen Neubauer 759750e661 Consul: make service_port optional in service definition, like specified in Consul docs (#21737)
* Consul: make service_port optional in service definition, Fixes #21727

* Remove consul module from legacy-files.txt

* consul: Pep8 fixes
7 years ago
Jordan Borean 6d01168238 win_acl_inheritance: Added tests and formatting improvements (#25382) 7 years ago
Jordan Borean c05d3c3821 win_owner: added tests and fixed up bool handling (#25088)
* win_owner: added tests and fixed up bool handling

* explicitly gathering facts in test

* Removed manualy entry in test group
7 years ago
Dag Wieers 0aba04fdad win_uri: Add integration tests, new functionality... (#25373)
This is a cleanup of the win_uri module to make it feature-complete.

This PR includes:
- Added check-mode support
- Add as many options from the uri module as possible
  - Added creates
  - Added follow_redirects
  - Added maximum_redirection
  - Added password
  - Added removes
  - Added return_content
  - Added status_code
  - Added timeout
  - Added user
  - Added validate_certs
- Fixed list-handling for comma-separated strings
- Added basic integration tests (should come from uri module)
7 years ago
David Newswanger ca16956337 added integration tests for apt upgrade (#25670)
* added integration tests for apt upgrade

changed version number for hello to 2.6 so that it works with Ubuntu 12.04

prevent tests from checking if aptitude is installed on non ubuntu systems

changed ordering on when statements for safe and full upgrade types so that the OS check happens before the aptitude check

added integration tests for apt upgrade

changed version number for hello to 2.6 so that it works with Ubuntu 12.04

* Moved additions to tasks/main.yml to make revisions easier. Changed tasks to multiline format
7 years ago
David Newswanger 1bc5761bea added integration tests for yum repository (#25671)
* added integration tests for yum repository

* fixed escaped single quote

* extended yum_repository tests to include fedora

* removed unused variable file

* added check for return values

* replaced escaped double quotes with single quotes, switched to lookup for reading repofile
7 years ago
Abhijeet Kasurde 7348a613bb Correct usage of fail_json in hg module (#25847)
Fix adds correct usage for fail_json and also adds
testcases to verify this.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Tim Rupp 0854c0ed88 Adds refactored bigip_hostname (#25841)
This adds a refactored bigip_hostname with unit tests and code
conventions that are common across other modules.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_hostname.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_hostname/tasks
7 years ago
Ganesh Nalawade 450263e934 Add junos_banner declartive module (#25826)
* Add junos_banner declartive module

*  junos_banner implementation
*  Integration test for junos_banner
*  Integration test for net_banner (junos)
*  Minor fixes

* Minor doc change
7 years ago
John R Barker 448efdb9e5 MySQL Password updates (#25825)
* MySQL Password updates

* Disable user_password_update_test
7 years ago
John R Barker 7ee7fa7332 Use stronger password for MySQL (#25821)
Previously we were getting "Your password does not satisfy the current policy requirements"
Possibly caused by a software update on Fedora
7 years ago
Tim Rupp 59d470ae84 Adds bigip_iapp_service module (#25808)
This module allows a user to manage the iApp services on a bigip
that they created using the bigip_iapp_template module.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_iapp_service.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_iapp_service/tasks
7 years ago
John R Barker 5551e87755 RETURNS can include version_added (#25810) 7 years ago
Ganesh Nalawade 2ff464c949 Add net_interface declarative module (#25766)
* Add net_interface declartive module

*  Add net_interface module
*  Add junos_interface implementation module
*  Other minor changes

* Add integration test

*  Integration test for net_interface
*  Integration test for junos_interface

* Fix CI failures

* Documentation changes
7 years ago
Peter Sprygada 3aa41eda0b adds new common functions for declarative intent modules (#25210)
* adds new common functions for declarative intent modules

* adds Entity and EntityCollection
* adds dict_diff and dict_combine

* update for CI  PEP8 compliance

* more CI PEP8 fixes

* more PEP8 CI clean up

* refactors the lambda assignments into top level classes

this is to be in compliant the PEP8 CI sanity checks

* one last pep8 ci fix
7 years ago
Nathaniel Case a38e727380 nxos_nxapi fix (#25306)
* Add nxos_nxapi tests

* Simple changes to nxos_nxapi

* Move validation to check_args

* Don't mark protocol change unless change is requested

* Add different regex to handle HTTP{,S} ports on a different version of nxos
7 years ago
Ben Berry 1267567556 Check sysctl no name (#25041)
* add integration tests for no name on sysctl

* better error validation, add test for no value
7 years ago
Tim Rupp c51b73d800 Makes all unit tests look the same (#25762)
Just a little cleanup from an earlier patch that makes f5 unit
tests only run if the f5 sdk is installed
7 years ago
Trishna Guha 41f6f8f410 Idempotent behaviour in ios_user integration test (#25774)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha 98269888a9 iosxr_banner Implementation module (#25744)
* Add iosxr_banner implementation module

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

* Integration test for iosxr_banner

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

* Unit test for iosxr_banner

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

* remove blank line pep8

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Brian Coca fedbf3666b fixed issue with paths separator and others
finished  normalizing of path handling
removed overloaded '-p' from init_paths option, it is for role_paths
removed expand_tilde and get_opt methods as both were redundant, adjusted rest of code
updated tests to match
7 years ago
Trishna Guha 44687bb917 Add iosxr_user implementation module (#25615)
* Add iosxr_user implementation module

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

* iosxr_user Integration test

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

* iosxr_user Unit test

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

* Modify integration test with idempotent case

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha b3c22a96bd Add vyos_user implementation module (#25677)
* Add vyos_user implementation module

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

* Integration test for vyos_user

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

* Make state absent work

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

* Unit test for vyos_user

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

* Standardize user names

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

* Modify integration test with idempotent case

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

* Add role as alias to level

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha 9c6ee8d0bb Add nxos_banner implementation module (#25695)
* Add nxos_banner implementation module

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

* nxos_banner integration test

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

* nxos_banner unit test

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

* doc update

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Brian Coca 342a85d33f fixed again 7 years ago
Brian Coca 83703e3137 skip f5 tests when f5 lib not installed 7 years ago
René Moser a51d64dfe3 constants: pep8 fix (#25735) 7 years ago
Tim Rupp 8e3ef4b052 Adds virtual_address module (#25728)
This module lets users manage a number of different config options
for Virtual Addresses on a BIG-IP.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_virtual_address.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_virtual_address/tasks
7 years ago
Tim Rupp b85785bf07 Refactors irule module to conform to recent standards (#25709)
Also includes unit tests for the code
7 years ago
Tim Rupp ba12ce64b0 Adds the bigip_snmp module (#25668)
This patch adds a module for managing several snmp related settings
on a BIG-IP that are required when configuring the range of SNMP
settings on a device.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_snmp.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_snmp/tasks
7 years ago
Tim Rupp 478d364f4d Adds bigip_iapp_template module (#25630)
This module can be used to upload and manage TCL iApps on a BIG-IP.
iApps can be added, removed and updated in place as needed. iApp
files should be provided to the module via Ansible lookups.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_iapp_template.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_iapp_template/tasks
7 years ago
Tim Rupp 0c68e200d5 Adds the bigip_provision module to Ansible (#25558)
This module allows an administrator to provision new module functionality
on a BIG-IP. BIG-IP modules provide enhanced ADC and security features that
are commonly used by customers such as GTM, ASM, and AFM.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_provision.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_provision/tasks
7 years ago
Dag Wieers 1c9a570ffe win_timezone: Add diff support, integration tests (#25284)
* win_timezone: Add diff support, integration tests

This PR includes:

- Diff support
- Returns both previous_timezone and timezone
- Adds integration tests
- More examples
- Improved documentation

* Merged the changes from jborean93's PR
7 years ago
Jordan Borean d3352c5b49 win_tempfile: Added integration tests (#25069)
* win_tempfile: Added integration tests

* fixed up tests
7 years ago
Sloane Hertel dfcf43efa9 ec2: Allow EC2-VPC instances to modify security groups - fixes #18928 (#23831)
* Allow EC2-VPC instances to update SG

make ec2 pep8

* use sets instead of loop and a break

* bring things in an indentation level

* Use to_text instead of str, text_type instead of basestring, - instead of difference

* basestrings not unicode

* simplifying syntax
7 years ago
Brian Coca 74842adc07 1st part of ansible config, adds ansible-config to view/manage configs (#12797)
* Start of ansible config project

moved configuration definitions to external yaml file vs hardcoded
 * updated constants to be a data strcutures that are looped over and also return origin of setting
changed to manager/data scheme for base classes
new cli ansible-config to view/manage ansible configuration settings
 * prints green for default/unchanged and yellow for those that have been overriden
 * added list action to show all configurable settings and their associated ini and env var names
 * allows specifying config file to see what result would look like
 * TBD update, edit and view options

removed test for functions that have been removed

env_Vars are now list of dicts
allows for version_added and deprecation in future
added a couple of descriptions for future doc autogeneration
ensure test does not fail if delete_me exists
normalized 'path expansion'
added yaml config to setup packaging
removed unused imports
better encoding handling

updated as per feedback

* pep8
7 years ago
Nathaniel Case 4344132a7d nxos_vpc updates (#25452)
* Add nxos_vpc tests

* Split execute-show between get_config and run_commands
7 years ago
Ganesh Nalawade b69c7f50d0 Add junos_vlan platform agnostic module (#25652)
* Add junos_vlan platform agnostic module

*  junos_vlan implementation

*  integration test for junos_vlan

* Minor fixes

* Fix Integration test failure
7 years ago
Andrew Saraceni 91e995d691 Allow win_scheduled_task to support adding and removing task paths (#24025)
* allows win_scheduled_task to support adding and removing task paths

* fix line length for documentation

* added integration tests for path creation and removal

* removing ability to remove TaskPath if a task isn't removed.  also removed superfluous line of code in Invoke-TaskPathCheck function
7 years ago
Dag Wieers cf30b162a9 vmware_guest: Various fixes to VM customizations (from template) (#24768)
* Various fixes to VM customizations (from template)

This patch implements:
- New find_obj() function from vmware.py replacing get_obj()
- Implement proper resource_pool selection
- Fix productId implementation (was not working)
- Ensure that we are not changing anything that is not mandatory (hostName, orgName, fullName)


This is an alternative proposal to #24283
This does not fix #19860 yet though.

For our use-case, we do not want to customize the network information (or any information in fact).
What is used in the template should remain intact.

* Added find_obj() function

* Fix the returned object-list (unused yet)

* Small improvement

* Support DHCP type and fix customizations

* Small fix

* Support resource_pool also for reconfiguring VM

* Remove redundant

* Fix short hostname, specific resource_pool, PEP8

* Improve docs and examples

* Fix missing hostsystem

* Make folder absolute path

* Improve docs, add missing 'mac'
7 years ago
Adrian Likins 56b7483b85 More statvfs info for mount facts rebase 12073 (#25454)
* Add more mount point statvfs info including sizes

Based on https://github.com/ansible/ansible/pull/12073

facts.utils.get_mount_size() now returns a dict of most
of the posix statvfs data, including block_size and inode
counts.

Update the facts.hardware classes that use get_mount_size() to
use the new info by mount_info.update(mount_statvfs_inof) to merge.

* add back unit tests for LinuxHardware mount/fs facts

* add test cases for facts.utils.get_mount_size
7 years ago
Dag Wieers bf43eb92f5 win_firewall: check-mode support, integration tests (#25127)
* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests

* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests
7 years ago
Ganesh Nalawade 343a709800 Fix platform agnostic net_user integration test fail (#25649)
* Fix platform agnostic net_user integration test fail

* Fix minor issue in eos integration test
7 years ago
Matt Martz cb704a4310 If there are no DOCs provided at all, don't traceback, skip the _ensure_imports_below_docs test (#25621) 7 years ago
Sloane Hertel 3f0c47196e [cloud] s3: deleting a nonexistent bucket should not give a traceback Fixes #25445 (#25487)
* trying to delete a nonexistent bucket should not fail

* Improve error handling for deleting s3 bucket

* Allow successful deletion

* Add test for deleting a nonexistent bucket

rename integration test target from s3 to aws_s3
7 years ago
Ricardo Carrillo Cruz 9725e056bc Add missing register on openvswitch_db integration tests (#25609) 7 years ago
Ricardo Carrillo Cruz 0dbea4575c Add assertions to openvswitch_db integration test (#25600)
* Add missing delegate_to on openvswitch_db integration test runner

* Add assertions to openvswitch_db integration test
7 years ago
Abhijeet Kasurde da6f6d27e8 Add Description parameter in os_user
Fixes #18914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 081e138cf1 Add missing delegate_to on openvswitch_db integration test runner (#25597) 7 years ago
Will Thames 16b877e2b3 ec2_asg and ec2_asg_facts module improvements (#25166)
* ec2_asg and ec2_asg_facts module improvements

Return target group information for both ec2_asg and ec2_asg_facts
modules

Provide RETURN documentation for ec2_asg module

PEP8 fixes for ec2_asg_facts

* ec2_asg: use pagination when describing target groups

In case an ASG has 100s of target groups, ensure that
we get the full result using build_full_result
7 years ago
Ricardo Carrillo Cruz c296fcb0e0 [WIP] Add openvswitch_db integration tests (#23803)
* WIP Add openvswitch_db integration tests

* Add  ovs.yaml playbook entrypoint for OVS

* Add test case pattern filtering

* Clear out aliases for now

Running tests on posix group just fails, containers do not have ovs
7 years ago
Toshio Kuratomi 3f9d1ab024 Add deps for cryptography to the Docker images (#25580) 7 years ago
Abhijeet Kasurde b89cb95609 Fix spelling mistakes (comments only) (#25564)
Original Author : klemens <ka7@github.com>

Taking over previous PR as per
https://github.com/ansible/ansible/pull/23644#issuecomment-307334525

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Pilou 460d932aa8 postgresql_user: fix bugs related to 'expires' option (#23862)
* Factorize tests related to no_password_change using an include task

* Refactor: deduplicate tasks

* postgresql_user: test 'expires' parameter

* Change 'valid until' even it's the only updated field

* value is changed when another value is provided

* value isn't returned when unset

* Remove unused variable

* psycopg2.extras.DictRow is able to handle comparison

* postgresql_user: simplify helper method

* postgresql_user: define variable just before using it

* Fix comparison between user input and applied configuration

* new test: adding an invalid attribute

* Refactor, add cleaning task

* Check that using same attribute a 2nd time does nothing

* Always try to remove created user

* postgresql_user: fix pep8
7 years ago
René Moser 0a972ea6bf wait_for: add some integration tests (#25553) 7 years ago
René Moser 29817ab115 cloudstack: add tests, fix pep8 (#25518)
* cloudstack: cs_zone: fix pep8

* cloudstack: cs_zone: add tests
7 years ago
Sloane Hertel b376bde4d7 [cloud] ec2_eni module - allow attaching a new instance - fixes #19452 (#22377)
* fix bug attaching instances

* pep8
7 years ago
Tim Rupp 61684f7313 Updates gtm wide ip module to be feature complete (#25502)
This module is used to manage GTM wide ips on a bigip.
Previously, this module only included a small subset of functionality
primarily related to editing a wide ip that already existed. Additionally
it used the SOAP api for its communication. this patch completes the
feature set of wide ips and refactors the code to use the F5 python SDK
and the REST API.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_wide_ip.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_wide_ip/tasks
7 years ago
Ricardo Carrillo Cruz 72e65e4290 Platform agnostic module for VRFs (#25383)
* WIP VRF platform agnostic module

* Fixed examples refering vlans instead of vrfs

* Add integration tests
7 years ago
Ricardo Carrillo Cruz d83f254bb6 New eos_vrf module (#25427)
* New eos_vrf module

* Add CLI integration tests

* Check rd only if not None
7 years ago
Trishna Guha 91e5fce90f Add ios_user implementation module (#25413)
* Add ios_user module

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

* Integration test for ios_user

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

* Add unit test for ios_user

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Adrian Likins dde3dac9f8 Support NetBSD 7.1+ style ifconfig -a output (#25442)
* Support NetBSD 7.1+ style ifconfig -a output

network facts on NetBSD after 7.1 cvs would fail
because of format changes in 'ifconfig -a' output.

update code to support new and old format.

add unit tests for both based on
examples from Bruce V Chiarelli.

* wrap use of interfaces.keys() in list() for py3 compat
* sort interface ids for stability
7 years ago
Adrian Likins f4128746d3 Cmdline fact uefi 23647 (#25446)
* Fix ansible_cmdline initrd fact for UEFI

UEFI cmdline paths use \ path sep which would
get munged by cmdline fact collection.

* Make CmdLineFactCollector easier to test

extract the parsing of the /proc/cmdline content to
_parse_proc_cmdline()

add a wrapper method for get_file_content _get_proc_cmdline()

Add unit tests of _parse_proc_cmdline based on examples
from issue #23647

Fixes #23647
7 years ago
Jordan Borean 89caef8fb6 win_environment: Added tests and return info in document (#25064)
* win_environment: Added tests and return info in document

* fixing up some yaml issues

* some more things I should have detected

* fixing up test tag name
7 years ago
George Nikolopoulos a00089c341 New module: manage Citrix Netscaler service configuration (network/netscaler/netscaler_service) (#25129)
* netscaler_service initial implementation

* Changes as requested by reviewers

* Skip some tests if under python2.6 and importing requests library

* Change option "operation" to "state"

* Remove print statements from netscaler module utils

* Catch all exceptions during login

* Fix fail message

* Add common option save_config
7 years ago
Dag Wieers 6e98dbbfd7 wait_for: PEP8, imports, cosmetics (#24634)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)

This fixes #19781
7 years ago
Trishna Guha 36082e32b4 Add integration test for nxos_user (#25464)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha b1b68840be Add missing integration test for eos_user (#25463)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Chris Houseknecht 20bddde669 docker_service: Forward stderr-based output from docker-compose (#25456)
PR #5165 at https://github.com/ansible/ansible-modules-core/pull/5165
adds redirection and capture of stdout during execution of
docker-compose.

This doesn't necessarily catch all errors, since some are printed to
stderr and lost.

This extends the redirection to include stderr, and does minor string
processing to attempt to find a 'useful' message to present as the
final Ansible error.
7 years ago
Ricardo Carrillo Cruz b3e8c48d4b New module: Add support for Arista EOS vlan (network/eos/eos_vlan) (#25355)
* WIP Add eos_vlan module

* Fix docstrings

* Fix pep8 issues

* Add active/suspend states logic

* Add integration tests for eos_vlan

* Fix map_config_to_obj on EAPI

* Sixify iteritems

* Add platform agnostic net_vlan integration tests
7 years ago
Brian Coca 745f72916f bigip tests now skipped if missing lib 7 years ago
Matt Martz e86b00b917 Make validate-modules a .py file, and symlink back to validate-modules (#25227)
* Make validate-modules a .py file, and symlink back to validate-modules

* Set prog for argparse in valdiate-modules
7 years ago
Matt Martz 004e99316c Allow template files to be vaulted (#22951)
* Allow template files to be vaulted

* Make sure to import exceptions we need

* get_real_file can't take bytes, since it looks specifically for string_types

* Now that we aren't using open() we don't need b_source

* Expand playbooks_vault docs to include modules that support vaulted src files

* Add vaulted template test
7 years ago
Daniele Lazzari eda6a6baee New module: Add module to add/remove a network static route on windows (windows/win_route) (#23405)
* adds win_route windows module

* fix documentation indent

* fix documentation pep8 issues

* fix documentation issues

* genaral code review

* changed 'supported_by' in doc, supports_check_mode removed

* use of powershell cmdlet instead of route command, destnation in CIDR format, adds check mode support

* adds win_psmodule module

* documentation review

* documentation review

* removed files accidentatlly pushed

* add integration tests, add return in documentation

* add conditional statement in test, add os requirementes in documentation

* fix documentation

* fix os check in tests
7 years ago
Dag Wieers 4307733e6e Revert the accidental addition of python-lxml (#25432)
I inadvertedly added python-lxml to the cloudstack-simulator Dockerfile.

This PR reverts this specific change.

This relates to PR #25324
7 years ago
John R Barker a6c078c7fb Add tzdata back (#25433)
It appears that the base Docker images have removed tzdata.
We use tzdata in the debconf tests, so add it back.
7 years ago
Mike Wiebe b76acc8ce8 Fix nxos_vpc idempotence issues (#25219)
* Fix nxos_vpc idempotence issues

* Remove legacy-file pep8 now passing
7 years ago
Dag Wieers 966b5fd1a0 Add python-lxml to docker images (#25324) 7 years ago
Abhijeet Kasurde 5bd4e01533 Update documentation of pamd module (#24712)
Updated explanation and documentation of new_module*
in pamd documentation

Fixes #24516

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 65bd5c4d56 Refactor github_hook module (#24391)
* PEP8 fixes
* Refactoring for fetch_url call
* Removed un-used code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 677a6c2982 Pep8 fixes for ejabberd_user and jboss (#24586)
* PEP* Fixes
* Refactor code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
René Moser 894b86a467 cloudstack: cs_zone_facts: add tests and fix pep8 (#25407) 7 years ago
Tim Rupp 6f2c543a33 Updates and refactors the bigip pool module to use REST (#25234)
This patch updates the bigip_pool module to use F5's REST API
as well as includes unit tests.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_pool.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_pool/tasks
7 years ago
Tim Rupp 855fd98be6 Adds the bigip_config module to Ansible (#25191)
This patch adds the bigip_config module to Ansible to support
merging SCF files, saving running configs, resetting config
and validating SCF configs
7 years ago
Trishna Guha f6a4803669 New module: platform agnostic way to manage local users on network devices (network/net_user.) (#25259)
* Add net_user platform agnostic module

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

* Integration test for net_user

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

* modify eos_user module to support name param as alias to username

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

* Test collection of users

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Toshio Kuratomi be4e7a05fa remove_values could hit the recursion limit
When operating on arbitrary return data from modules, it is possible to
hit the recursion limit when cleaning out no_log values from the data.
To fix this, we have to switch from recursion to iteration.

Unittest for remove_values recursion limit

Fixes #24560
7 years ago
Nathaniel Case f52dcef7ba Actually check for equality on empty commands array (#25308) 7 years ago
Tim Rupp 0133a5a763 Adds the bigip_gtm_pool module (#25275)
This module is used to manage GTM(DNS) pools in a BIG-IP.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_pool.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_pool/tasks
7 years ago
Ganesh Nalawade 6215922889 Add support for cliconf and netconf plugin (#25093)
* ansible-connection refactor and action plugin changes
* Add cliconf plugin for eos, ios, iosxr, junos, nxos, vyos
* Add netconf plugin for junos
* Add jsonrpc support
* Modify network_cli and netconf connection plugin
* Fix py3 unit test failure
* Fix review comment
* Minor fixes
* Fix ansible-connection review comments
* Fix CI issue
* platform_agnostic related changes
7 years ago
Sloane Hertel c20285782d test conditionals work for invalid elements in list and undefined keys in dicts (#23875) 7 years ago
Michael De La Rue e28845018d [cloud] New module: AWS API Gageway module (#20230)
* Ultra basic api-gateway module based of lambda.py

* Ultra basic deployment added to api-gateway module

* ApiGateway module Allow creation of APIs, more documentation and better return value

* ApiGateway module incorporate review feedback

* ApiGateway module flake8 cleanup

* APIGateway module - more review fixes.

* slightly better messages in api_gateway module

* AWS api_gateway module - try to improve messages in case of exceptions

* rename api_gateway module to aws_api_gateway as discussed in PR 20230

* aws_api_gateway - Allow delivery of swagger either as text or dictionary.

* aws_api_gateway module - introduce 'unit' tests, improve imports using them and small fixes

* aws_api_gateway module - move path expand_user to avoid early typecheck

* aws_api_gateway - version means version of metadata not module - fix to 1.0

* aws_api_gateway module - Rely on module_utils.ec2 for imports & path type for expanduser / cleanups

* aws_api_gateway module - heavy cleanup and refactor of code + cloud retry functionality.

* api_gateway_module - failing test case for handling more than one deployment in succession and API deletion

* add TooManyRequestsException to AWSRetry exception list - makes API deployment work.

* api_gateway_module - Fixes for various review comments + errors from various linters

* api_gateway_module - Fixes for more review comments + linter error

* api_gateway_module - Major refactor into sensible functions - create_response becomes configure_response

* api_gateway_module - should be working under python3; remove test exclusion

* api_gateway_module - finish off remaining review fixes - use ansible defaults and fix mutually exclusive

* api_gateway_module - attempt to improve handling of botocore errors in python3

* api_gateway_module - implement state=absent / API deletion
7 years ago
Robin Roth 8f7c8ef3a5 Reenable git tests (#25341)
* Revert "Temporarily disable failing git test."
* Use correct hash for depth=1 test
7 years ago
Matt Clay dab1b1fe5b Temporarily disable failing git test. 7 years ago
René Moser 53c46df323 cloudstack: new module cs_network_acl_rule (#25325)
* cloudstack: new module cs_network_acl_rule
* fix doc errors
7 years ago
René Moser 3e02b19b98 cloudstack: fix pep8 cs_project (#25322) 7 years ago
Will Thames 84eea2a7e3 Support check_mode in ec2_vpc_nacl (#23112)
* Support check_mode in ec2_vpc_nacl

Ensure that all API calls that make changes are guarded by
`if not module.check_mode`.

* Update ec2_vpc_nacl_facts to latest pep8 standards
7 years ago
Trishna Guha e90f1d6449 net_command platform agnostic module (#25249)
* net_command platform agnostic implementation

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

* Add net_command platform agnostic module

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

* Add integration test for net_command module

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

* fix yaml issue
7 years ago
Dag Wieers 8cbed3c534 unarchive: PEP8, imports, cosmetics (#24654)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Ricardo Carrillo Cruz 955dc6e250 Add net_banner platform agnostic module (#25245)
* Add net_banner platform agnostic module

* Add integration tests for net_banner

* Remove default from required param

* Remove skip/python3 from net_banner aliases
7 years ago
Ricardo Carrillo Cruz ffc74fdca2 Add missing provider on basic-motd IOS test (#25307)
Without this it fails, as it needs elevated privs.
7 years ago
Ricardo Carrillo Cruz 64add28657 Platform agnostic net_system module (#24953)
* Platform agnostic net_system module

Also refactor the action network plugins for better code re-use

Still more refactoring to do once the connection plugin work is complete

* Replace importlib for imp

importlib is not available on 2.6, so we need to stick to imp

* Load action plugin via module metadata

* Better error message if no implementation is found

Now the plugin will show the module name and the network OS in the
error message

* Fix typo on documentation author line

* Fix pep8 issues

* Add missing options key on doc string and stringify version

* Return None in case module has no metadata

* Read module metadata only if it's a python module

Check for module suffix, if it's .py then read metadata.
Otherwise this fails on non-python modules, like Windows PS for example.

* Read metadata variable only if it's a python module

Fix referencing a variable before assignment

* Add action_handler to validate_modules metadata schema

* Pull metadata with plugin_docs get_docstring

Using load_source from PluginLoader is troublesome, it is not guaranteed
a module may be importable at the controller, e.g. if a module depends
on module_utils functions it won't work, because module_utils is not
in the sys path.
Rather than putting that module dependencies introspection, just
use plain parsing like plugin_docs get_docstring does as we only care
about reading ANSIBLE_METADATA.

* Add platform agnostic group of groups for integration tests

This will be the target for platform agnostic integration tests.

* Add integration tests for net_system

* Switch to action plugin inheritance from metadata driven action handler

As the metadata action driven action handler work is being worked on
on its standalone proposal+PR, let's just go back to have one
action handler per platform agnostic module.
Those action plugins will inherit from net_base.

* Add blank line to fix pep8

* Add aliases file to net_system integration test

This will avoid CI failure

* Fix integration tests for net_system

* Give more precedence to task network_os over inventory network_os
7 years ago
Brandon Davidson 0e0c5328fa amazon/ec2_vpc_igw: Allow internet gateways to be tagged (#23782) 7 years ago
Dag Wieers 5553b20828 Collated PEP8 fixes (#25293)
- Make PEP8 compliant
7 years ago
Dag Wieers 2f33c1a1a1 find: PEP8, imports, cosmetics (#24646)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 91ee93ce13 patch: PEP8, imports, cosmetics (#24649)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Ganesh Nalawade 85219dfdf3 Add support to fetch old style junos facts (#25250)
* Add support to fetch old style junos facts

Fixes #25050

Add support to fetch old style facts supported in Ansible <= 2.2
To fetch old style facts value `gather_subset` value shoule be `all`
and `junos-eznc` is required to be installed on control node as a
prerequisite.

* Remove unwanted import
7 years ago
Sloane Hertel 7160a491c2 elasticache: add requirements to parameter_group and snapshot (#24904)
* Add requirements to elasticache parameter group

* add requirements for elasticache_snapshot

* pep8 elasticache_snapshot

* remove elasticache_snapshot from legacy files
7 years ago
Trond Hindenes 055fd6f5f5 New module: win dsc (#24872)
* Added win_dsc module file

* mute output and track reboot requirements

* added tests

* proper conditionals for test

* Added moar conditionals for test

* ci fixes

* Added metadata

* fixed integration test yaml

* ci fix

* ci fix

* added module_version param and output, no longer chokes on multiple versions found.

* ci fix

* code review improvements, make return vars more pythonic, cleanup
removed reference to handles in commit message

* Fixed tests, clearer documentation

* fixed trailing whitespace
7 years ago
Adrian Likins 45a9f96774 Facts Refresh (2.4 roadmap) (#23012)
Facts Refresh (2.4 roadmap)

This commit implements most of the 2.4 roadmap 'Facts Refresh'
- move facts.py to facts/__init__.py
- move facts Distribution() to its own class
- add a facts/utils.py
- move get_file_content and get_uname_version to facts/utils.py
- move Facts() class from facts/__init__ to facts/facts.py
- mv get_file_lines to facts/utils.py
- mv Ohai()/Facter() class to facts/ohai.py and facter.py
- Start moving fact Hardware() classes to facts/hardware/*.py
- mv HPUX() hardware class to facts/hardware/hpux.py
- move SunOSHardware() fact class to facts/hardware/sunos.py
- move OpenBSDHardware() class to facts/hardware/openbsd.py
- mv FreeBsdHardware() and DragonFlyHardware() to facts/hardware/
- mv NetBSDHardware() to facts/hardware/netbsd.py
- mv Darwin() hardware class to facts/hardware/darwin.py
- pep8/etc cleanups on facts/hardware/*.py
- Mv network facts classes to facts/network/*.py
- mv Virtual fact classes to facts/virtual
- mv Hardware.get_sysctl to facts/sysctl.py:get_sysctl

- Also mv get_uname_version from facts/utils.py -> distribution.py
  since distribution.py is the only thing using it.

- add collector.py with new BaseFactCollector
- add a subclass for AnsibleFactCollector
- hook up dict key munging FactNamespaces
- add some test cases for testing the names of facts
- mv timeout stuff to facts.timeout

- rm ansible_facts()/get_all_facts() etc

- Instead of calling facts.ansible_facts(), fact collection
  api used by setup.py is now to create an AnsibleFactCollector()
  and call it's collect method.

- replace Facts.get_user_facts with UserFactCollector
- add a 'systems' facts package, mv UserFactCollector there
- mv get_dns_facts to DnsFactCollector
- mv get_env_facts to EnvFactCollector
- include the timeout length in exception message

- modules and module_utils that use AnsibleFactCollector
  can now theoretically set the 'valid_subsets'

  May be useful for network facts module that currently have
  to reimplement a good chunk of facts.py to get gather_subsets
  to work.

- get_local_facts -> system/LocalFactCollector
- get_date_time -> system/date_time.py
- get_fips_facts -> system/fips.py
- get_caps_facts() -> system/caps.py
- get_apparmor_facts -> system/apparmor.py
- get_selinux_facts -> system/selinux.py
- get_lsb_facts -> system/lsb.py
- get_service_mgr_facts -> system/service_mgr.py
- Facts.is_systemd_managed ->  system/service_mgr.py
- get_pkg_mgr_facts -> system/pkg_mgr.py
- Facts()._get_mount_size_facts() -> facts.utils.get_mount_size()

- add unit test for EnvFactCollector
- add a test case for minimal gather_subsets
- add test case for collect_ids
- Make gather_subset match existing behavior or '!all'

    If 'gather_subset' is provided as '!all', the existing behavior
    (in 2.2/2.3) is that means 'dont collect any facts except those
    from the Facts() class'. So 'skip everything except
    'apparmor', 'caps', 'date_time', 'env', 'fips', 'local', 'lsb',
    'pkg_mgr', 'python', 'selinux', 'service_mgr', 'user', 'platform', etc.

    The new facts setup was making '!all' mean no facts at all, since
    it can add/exclude at a finer granularity. Since that makes more
    sense for the ansible collector, and the set of minimal facts to
    collect is really more up to setup.py to decide we do just that.

    So if setup.py needs to always collect some gather_subset, even
    on !all, setup.py needs to have the that subset added to the
    list it passes as minimal_gather_subset.

    This should fix some intg tests that assume '!all' means that
    some facts are still collected (user info and env for example).

    If we want to make setup.py collect a more minimal set, we can do that.

- force facts_dicts.keys() to a list so py3 works
- split fact collector tests to test_collectors.py

- convert Facter(Facts) -> other/facter.py:FacterFactCollector

- add FactCollector.collect_with_namespace()

    regular .collect() will return a dict with the key names
    using the base names ('ip_address', 'service_mgr' etc)

    .collect_with_namespace() will return a dict where the key names
    have been transformed with the collectors namespace, if there is
    one. For most, this means a namespace that adds 'ansible_' to the
    start of the key name.

    For 'FacterFactCollector', the namespace transforms the key to
    'facter_*'.

- add test cases for collect_with_namespace

- move all the concrete 'which facts does setup.py' stuff to setup.py

    The caller of AnsibleFactCollector.from_gather_subset() needs to
    pass in the list of collector classes now.

- update system/setup.py to import all of the fact classes and pass
  in that list.
- split the Distribution fact class up a bit

    extracted the 'distro release' file handling (ie, linux
    boxes with /etc/release, /etc/os-release etc) into its
    own class.
- extract get_cmdline_facts -> cmdline.py
- extract get_public_ssh_host_keys -> system/ssh_pub_keys.py
- extract get_platform_facts -> system/platform.py

  platform.py may be a good candidate for further splitting.

- rm test for plain Facts() base class
- let the base class for Collector unit tests provide collected_facts

    some Collectors and/or their migrated Facts() subsclasses need
    to look at facts collected by other modules ('ansible_architecture'
    the main one...).

    Collector.collect() has the collected_facts arg for this, so add
    a class variable to BaseFactsTest so we can specify it.

- mv Ohai to other/ohai.py and convert to Collector
- update hardware/*.py to return facts (no side effects)

- mv AnsibleFactCollector to setup.py
- extra collector class gathering to module method in
  facts/__init__.py (collector_classes_from_gather_subset)
- add a CollectorMetaDataCollector collector used to provide
  the 'gather_setup' fact
- add unit test module for 'setup' module
  (test/units/modules/system/setup.py)

- Collector init now doesnt need a module, but collect does

    An instance of a FactCollector() isnt tied to a AnsibleModule
    instance, but the collect() method can be, so optionally pass
    in module to FactCollector.collect() (everywhere)

- add a default_collectors for list of default collectors

  import and use it from setup.py module

  eventually, would like to replace this with a plugin loader
  style class finder/loader

- unit tests for module_utils/facts/__init__.py
- add unit tests for ohai facts collector
- remove self.facts side effect on populate() in hardware/sunos.py
- convert OpenBSDHardware() to rm side effects on self.facts
- try to rm some self.facts side effects in Network()

    plumb in collected_facts from populate() where it is needed.

    stop passing collected_facts into Network() [via cached_facts=,
    where it eventually becomes self.facts]

- nothing provides Fact() cached_facts arg now, rm it

    Facts() should be internal only implementation so nothing
    should be using it.

    Of course, now someone will.

- add a Collector.name attr to build a map of name->_fact_ids

    To properly exclude a gather_subset spec like '!hardware', we
    need to know that 'hardware' also means 'devices', 'dmi', etc.
    Before, '!hardware' would remove the 'hardware' collector name
    but not 'devices'. Since both would end up in id_collector_map,
    we would still end up with the HardwareCollector in the collector
    list. End result being that '!hardware' wouldn't stop hardware
    from being collected.

    So we need to be able to build that map, so add the Collector.name
    attribute that is the primary name (like 'hardware') and let
    Collector._fact_ids be the other fact ids that a collector is
    responsible for.

    Construct the aliases_map of Collector.name -> set of _fact_ids
    in fact/__init__.py get_collector_names, and use it when we are
    populating the exclude set.

- refactor of distribution.py

    make the big OS_FAMILY literal a little easier to read
    Also keys can now be any string instead of python literals

    99% sure the test for 'KDE Neon' was wrong
    I don't see how/where it should or could get 'Neon' instead
    of 'KDE Neon' as provided in os-release NAME=

    Use 'distribution' string for key to OS_MAP

    ie, we dont need to make it a valid python label anymore so dont.

    move _has_dist_file to module as _file_exists
    easier to mock without mucking with os.path

    mv platform.system() calls to within get_distribution_facts() instead
    of Distribution() init.

- remove _json compat module

    The code in here was to support:

      -a 'json' python module that was not the standard one included
      with python since 2.6.

      - potentially fallback to simplejson if 'json' was not available.

    'json' is available for all supported python versions now so
    no longer needed.

- mv get_collector_names -> facts.collector
- mv collector_classes_from_gather_subset -> facts.collector
- mv collector tests from test_facts -> test_collector

- Use six's reduce() in sunos/netbsd hardware facts

- rm extraneous get_uname_version in utils

  only system/distribution.py uses it

- Remove Facts() subclass metaclass usage

  - using fact_id and a platform id for matching collectors

    gut most of Facts() subclasses

    rm Facts() subclasses with weird metaclass

    only add collectors that match the fact_ids and the platform_info
    to the list of collectors used.

    atm, a collectors platform_id will default to 'Generic', and
    any platform matches 'Generic'

    goal is to select collector classes including matching the
    systems platform in collector.py, instead of relying on
    metaclasses in hardware/*. To finish this, the various
    Facts() subclasses will need to be replaced entirely with
    Collector() subclasses.

    use collector classmethod platform_match() to match the platform

    This lets the particular class decide if it is compatible with
    a given platform_info. platform_info is a dict like obj, so it could be
    expanded in the future.

    Add a default platform_match to BaseFactCollector that matches
    platform_info['system'] == cls._platform

    They were needed previously to trigger a module
    load on all the collector classes when we import
    facts/hardare so that the Hardware() and related
    classes that used __new__ and find_all_subclasses()
    would work.

    Now that is done in collectors based on platform matching
    at runtime we dont need to do it py module import/parse
    time. So the non empty __init__.pys are no longer needed
    and their is a more flexible mechanism for selection
    platform specific stuff.

    facts/facts.py is no longer used, rm'ed

- if we dont find an implement class for gather spec.. just ignore it.

  Would be useful to add a warn to warn about this case.

- Fix SD-UX typo (should be HP-UX)

- Port fix for #21893 (0 sockets) to this branch

    This readds the change from 8ad182059d
    that got lost in merge/rebase

    Fixes #21893

- port sunos fact locale fix for #24542 to this branch

    based on e558ec19cd

    Fixes #24542

    Solaris fact fix (#24793)

    ensure locale for solaris fact gathering

    fixes issue with locale interfering with proper reading of decimals

- raise exceptions in the air like we just dont care.

    Pretty much ignore any not exit exception in facts
    collection. And add some test cases.

- added new selinux fact to clarify python lib

    the selinux fact is boolean false when the library is not installed,
    a dictionary/hash otherwise, but this is ambigous
    added new fact so we can eventually remove the type dichtomy and normalize it as a dict

    Re-add of devel commit 85c7a7b844 to
    the new code layout, since it got removed in merge/rebase
7 years ago
Matt Clay 9d8aa43c67 Temporary work-around for setuptools 36.0.0 bug. (#25243)
* Temporary work-around for setuptools 36.0.0 bug.
* Use older setuptools for pip integration test.
* Limit isort version to avoid new test failures.
7 years ago
Trishna Guha 343b83041e nxos_feature fix and unit test (#25200)
* nxos_feature fix

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

* nxos_feature unit test

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

* remove from pep8/legacy-file

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha fb87680046 fix state present nxos_evpn_vni (#25212)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Dag Wieers c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
7 years ago
Chris Alfonso b937bad52e Narrowing the match for python 3 cmp check (#25220)
Allowing the yaml examples in python documentation.
7 years ago
Sloane Hertel 75bdcce072 s3 integration tests (#22920)
* s3 integration tests

* Make s3 integration tests work in standard integration setup and with fish as current shell
see also https://github.com/ansible/proposals/issues/62 if you don't like this much

* test_s3 integration test - substitute command instead of shell where simple

* test_s3 integration test - random contents + complete elimination of use of shell module by moving to tempfile

* move s3 to integration test targets

* Add a couple more test for . in bucket names

Tidy syntax

remove reference to legacy credentials.yml

remove posix/cli/cloud/aws

* remove from legacy testing

* remove dependencies that aren't used
7 years ago
Dag Wieers d958440bcb win_firewall_rule: Implement idempotency, check-mode and diff support (#23162)
* win_firewall_rule: Small idempotency fix

This PR includes the following changes:
- an idempotency fix when `profile: any`
- better difference output to debug idempotency issues
- documentation fixes (remove `required: false`)
- Parameter handling fixes
- RDP example that matches default RDP rule
- Renamed parameter 'enable' to 'enabled' (kept alias)
- Renamed parameter 'profile' to 'profiles' (kept alias)

* Rewrite module completely

The logic is still intact, but various changes with a single goal:

- Make the module idempotent
- Implement check-mode
- Implement diff-mode
- Adapted integration tests

This fixes #18807 and #23455.

* Change casing to lowercase

* Improve the logic wrt. diff
7 years ago
Dag Wieers 0e160d5c7e Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a
successful run, similar to #24865 for Windows fixing **win_chocolatey**.

We also disable the dependency on `rc` value only, even if `failed` was
set.

Adapted unit and integration tests to the new scheme.
Updated raw, shell, script, expect to take `rc` into account.
7 years ago
Evgeni Golov 1f78715848 apt: include arch in check for installed packages on multi-arch systems (#24846)
* apt: include arch in check for installed packages on multi-arch systems

Thanks: Stefan Löwen <stefan.loewen@gmail.com>

Fixes: #24673

* add an integration test for apt's multi-arch handling
7 years ago
Dag Wieers 758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
7 years ago
Ricardo Carrillo Cruz 69efb61008 Add provider param to prepare_iosxr_tests role tasks (#25163)
This will avoid passing -u -k to ansible-playbook
7 years ago
Nathaniel Case 53837c2ab0 Assorted nxos_bgp_* fixes (#25080)
* Simplify apply_key_map

* Fix nxapi

* Clean up get_value

* Fix missing non-values

* Add test for existing bgp_af case

* Fix small issues with bgp_neighbor_af
7 years ago
Pierre-Louis Bonicoli a4131197e0 PostgreSQL tests: enforce UTF8
By default, client encoding is determined either from the LANG_*/LC_*
environment variables or using encoding of the database.

Containers used in the CI don't define a default locale, then encoding
of default databases was SQL_ASCII.
7 years ago
Pierre-Louis Bonicoli fb1e7aaa81 Creates cluster the same way Debian package does
This task is only executed when the playbook has already been executed
once, for example using 'ansible-test integration' with '--retry-error'
switch when the first run fails.

This modification allows to recreate default databases (postgres,
template0 and template1) using the same encoding that the one used by
the Debian package.

Default encoding is 'SQL_ASCII' when default locale is not set in
/etc/default/locale.
7 years ago
Pierre-Louis Bonicoli ce856c2123 postgresql_user: add tests with hashed password 7 years ago
Dag Wieers 09ba70f7c4 stat: PEP8, imports, cosmetics (#24653)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 8d962209f4 mod_utils/cloudengine: PEP8 compliancy (#24659)
- Make PEP8 compliant
7 years ago
Dag Wieers b3b11fbce2 get_url: PEP8, imports, cosmetics (#24676)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers 630185cb20 ansible/executor: PEP8 compliancy (#24695)
- Make PEP8 compliant
7 years ago
Dag Wieers 51b595992b ansible/utils/: PEP8 compliancy (#24686)
- Make PEP8 compliant
7 years ago
Dag Wieers 47738eb1dd docs: PEP8 compliance (#24681)
- Make PEP8 compliant
7 years ago
Dag Wieers 4efec414e7 test/: PEP8 compliancy (#24803)
* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
7 years ago
Trishna Guha 31c59ad5f9 nxos_portchannel fix and unit test (#25019)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Ricardo Carrillo Cruz fd5db52fd9 Add provider to prepare_ios_tests role tasks (#25162)
This avoids passing -u <user> -k, as it will just consume
the credentials from group_vars
7 years ago
Rene Moser 9cbae80c3b cloudstack: fix pep8 cs_pod 7 years ago
Rene Moser 3ef37e88fe cloudstack: fix pep8 cs_facts 7 years ago
Rene Moser 439f0beca5 cloudstack: fix pep8 cs_domain 7 years ago
Rene Moser 1778e23fad cloudstack: fix pep8 cs_account 7 years ago
Rene Moser e3f75227bc cloudstack: fix pep8 cs_affinitygroup 7 years ago
Rene Moser 9fe3891d65 cloudstack: fix pep8 cs_cluster 7 years ago
Reilly Herrewig-Pope 723c8f06ab Allow setting/unsetting BYPASSRLS Postgres role attribute (#24625)
* Allow setting/unsetting BYPASSRLS role attr

* Build valid role attrs against version

* Add integration tests
7 years ago
René Moser d5b04aa1f1 cloudstack: add check mode tests (#24908)
* cloudstack: test: cs_network_acl: add check_mode tests

* cloudstack: test: cs_pod: add check_mode tests

* cloudstack: test: cs_user: add check_mode tests

* cloudstack: test: cs_sshkeypair: add check_mode tests

* cloudstack: test: cs_project: add check_mode tests

* cloudstack: test: cs_vpc: add check_mode tests

* cloudstack: test: cs_vpn_gateway: add check_mode tests

* cloudstack: test: cs_volume: add check_mode tests

* cloudstack: test: cs_vmsnapshot: add check_mode tests

* cloudstack: test: cs_account: add check_mode tests

* cloudstack: test: cs_affinitygroup: add check_mode tests

* cloudstack: test: cs_cluster: add check_mode tests

* cloudstack: test: cs_domain: add check_mode tests

* cloudstack: test: cs_instancegroup: add check_mode tests

* cloudstack: test: cs_iso: add check_mode tests

* cloudstack: test: cs_loadbalancer_rule: add check_mode tests

* cloudstack: test: cs_portforward: add check_mode tests

* cloudstack: test: cs_resourcelimit: add check_mode tests

* cloudstack: test: cs_securitygroup: add check_mode tests

* cloudstack: test: cs_securitygroup_rule: add check_mode tests

* cloudstack: test: cs_configuration: add check_mode tests

* cloudstack: test: cs_firewall: add check_mode tests

* cloudstack: test: cs_instance: add check_mode tests

* cloudstack: query current tags from API

Fixes unexpected tags returned in check mode.
7 years ago
Brendan Almonte 2af5556901 Added autoclean/autoremove for the apt module
- Removed alias autoclean from autoremove.
- Added independent execution of apt-get autoclean/autoremove
- Continued to support --auto-remove as a flag to install/remove

Fixes #22222 #24718
7 years ago
Robin Roth 8fca263560 Refactor zypper version parsing and handling (#24056)
Fixes #23516
7 years ago
Nathaniel Case 8985f7c930 nxos_static_route updates (#24992)
* Add static_route tests
* Add VRF tests
7 years ago
Trishna Guha 6a3ce18e4b add more testcases for nxos_evpn_vni (#24996) 7 years ago
Brendan Almonte b820d024fc Add alternative syntax for upgrading all installed packages via apt (#25007)
syntax: 'apt: name=* state=latest'

feature #24189
7 years ago
kkjang 5c43bd3bae Cmp python3 compat (#25008)
* Use double-quotes for expect integration tests

* Cast user input to string for expect integration tests

* Remove usage of cmp() for python3 compatibility

- Add code smell test to look for cmp usage

- Fixes #24756
7 years ago
Tim Rupp 6ef022b034 Adds the bigip_snmp_trap module to Ansible (#24848)
This patch adds the bigip_snmp_trap module to Ansible to support managing
SNMP trap destinations on an F5 BIG-IP.
7 years ago
Ganesh Nalawade 825d9df5ea Add eos changes for Python3 (#24600)
* eos python3 changes

* changes to convert response from byte to text

* Add dellos6 python3 changes
Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix py3 prompt issue for invalid show command
* Fix review comments
* Add generic fix for error prompt in py3
* Fix CI issue
* Fix network_cli unit test failure
7 years ago
bengerman13 4b6db5db7c add xattr integration tests to ci (#24950)
* add xattr integration tests to ci

* fix package syntax

* remove unnecessary become, disable xattr for bsd and osx
7 years ago
kkjang daada2000c Fix expect for python 3 (#24912)
* Fix expect for python 3

- Change generator next to python 3 compatible
- Added tests for expect

* Add pexpect to integration.txt

- add pexpect library to requirements for integration tests

* Use ansible_python_interpreter in integration tests for expect

* Use double-quotes for expect integration tests

* Cast user input to string for expect integration tests

* Cast user input to string earlier in expect integration tests

* Use ansible.module_utils.six.moves input for expect integration tests

* Fix yamllint errors in the expect test

* Use cat to trigger timeout for expect integration tests

* Use realpath filter in expect integration tests
7 years ago
Dag Wieers 66355df917 module_utils/six: PEP8 compliancy
- Make PEP8 compliant
7 years ago
Brian Coca 8f97aef1a3 Transition inventory into plugins (#23001)
* draft new inventory plugin arch, yaml sample

 - split classes, moved out of init
 - extra debug statements
 - allow mulitple invenotry files
 - dont add hosts more than once
 - simplified host vars
 - since now we can have multiple, inventory_dir/file needs to be per host
 - ported yaml/script/ini/virtualbox plugins, dir is 'built in manager'
 - centralized localhost handling
 - added plugin docs
 - leaner meaner inventory (split to data + manager)
 - moved noop vars plugin
 - added 'postprocessing' inventory plugins
 - fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them
 - grouphost_vars loading as inventory plugin (postprocessing)
 - playbook_dir allways full path
 - use bytes for file operations
 - better handling of empty/null sources
 - added test target that skips networking modules
 - now var manager loads play group/host_vars independant from inventory
 - centralized play setup repeat code
 - updated changelog with inv features
 - asperioribus verbis spatium album
 - fixed dataloader to new sig
 - made yaml plugin more resistant to bad data
 - nicer error msgs
 - fixed undeclared group detection
 - fixed 'ungrouping'
 - docs updated s/INI/file/ as its not only format
 - made behaviour of var merge a toggle
 - made 'source over group' path follow existing rule for var precedence
 - updated add_host/group from strategy
 - made host_list a plugin and added it to defaults
 - added advanced_host_list as example variation
 - refactored 'display' to be availbe by default in class inheritance
 - optimized implicit handling as per @pilou's feedback
 - removed unused code and tests
 - added inventory cache and vbox plugin now uses it
 - added _compose method for variable expressions in plugins
 - vbox plugin now uses 'compose'
 - require yaml extension for yaml
 - fix for plugin loader to always add original_path, even when not using all()
 - fix py3 issues
 - added --inventory as clearer option
 - return name when stringifying host objects
 - ajdust checks to code moving

* reworked vars and vars precedence
 - vars plugins now load group/host_vars dirs
 - precedence for host vars is now configurable
 - vars_plugins been reworked
 - removed unused vars cache
 - removed _gathered_facts as we are not keeping info in host anymore
 - cleaned up tests
 - fixed ansible-pull to work with new inventory
 - removed version added notation to please rst check
 - inventory in config relative to config
 - ensures full paths on passed inventories

* implicit localhost connection local
7 years ago
Brian Coca 6fa5dbdb5c fixed pep8 issues 7 years ago
bengerman13 25aac6151f add integration tests for xattr module (#24947)
* add integration tests for xattr module

* fix whitespace
7 years ago
jhawkesworth b46c098581 Added win_copy recursive integration test with trailing path separator. (#24523)
This is a reproducer for https://github.com/ansible/ansible/issues/23559

Tests will fail until https://github.com/ansible/ansible/pull/23581 is merged

Note that I believe another commit is also needed for this to work,
specifically the change from: https://github.com/ansible/ansible/pull/23326
7 years ago
Nathaniel Case dd4a79d7d3 Clean up nxos_bgp_neighbor_af (#24890)
* Fix pep8 in bgp_neighbor_af
* Remove WARNINGS
* Rewrite command detection
* Add bgp_neighbor_af test
* Finally kill invoke
7 years ago
Brian Coca e0e94a4d02 reinstated to legacy
(cherry picked from commit a6484da0f11d03056b446526ef1cf78f968ae3ee)
(cherry picked from commit f23e766efa859b25557537d5098de557e85120cf)
7 years ago
Trishna Guha 4066b03a4c nxos_evpn_global refactor (#24919)
* nxos_evpn_global refactor

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

* ansibot told me to do this

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
pdasilva f8e47e2204 Changed assemble_from_fragments to use os.path.join (#24909)
Fixes #19437
7 years ago
pdasilva 3b45a9eb58 Test for _get_url_data in jenkins_plugin.py (#24905)
* Test for _get_url_data in jenkins_plugin.py

* PEP8 fix
7 years ago
Tim Rupp 4fc40304d5 Adds the bigip_command module to Ansible (#24850)
This patch adds the bigip_command module to Ansible to support arbitrary
tmsh command to a F5 BIG-IP.
7 years ago
Ricardo Carrillo Cruz b12beca3ed Refactos nxos_ip_interface module (#24885) 7 years ago
René Moser d96195131f cloudstack: test: improve startup time, fix network dependency on run (#24876) 7 years ago
Ganesh Nalawade 7563d93901 Add nxos changes for Python3 (#24602)
* Add nxos changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix CI issues

* Fix review comment

Replace surrogate_or_strict with
surrogate_then_replace as per review
comment os PR #24601
7 years ago
Trishna Guha 1e5a0982b9 Fix nxos_hsrp and add unit test (#24770)
* nxos_hsrp fix

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

* unit test nxos_hsrp

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

* ansibot told me to do this

* revert apply_key_map and simplify method
7 years ago
Trishna Guha 4782a4e62f Make host required field and minor refactor (#24534)
* Make host required field and minor refactor

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

* ansibot pep8 legacy file

* example doc update
7 years ago
Tim Rupp 22e096f911 Changes skip test for bigip user (#24799)
All of the F5 Ansible modules will come to require the same major
dependencies over time. This mentions that.
7 years ago
Trishna Guha 998305a493 nxos_ospf_vrf fix and unittest (#24495) 7 years ago
Tim Rupp c1397626fc Adds the bigip_user module to Ansible (#24753)
The patch adds the bigip_user module to Ansible to support managing
users on an F5 BIG-IP.

Unit tests are provided. Integration tests can be found here

  * https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_user.yaml
  * https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_user/tasks
7 years ago
Tom Melendez 13f2d9222f [GCP] Global Load Balancer Integration Test (#24704)
* Revert to using url_map internal to the module to allow parameter generation to work. module parameter is still url_map_name.

* [GCP] Cross Region Load Balancer Integration Test
7 years ago
Matt Clay 53180ebb57 Fix Shippable BASE_BRANCH lookup on merges. 7 years ago
Dag Wieers c4a7f64c02 ansible/galaxy: PEP8 compliancy (#24696)
- Make PEP8 compliant
7 years ago
Dag Wieers 6f6bdf7914 ansible/parsing: PEP8 compliancy (#24701)
- Make PEP8 compliant
7 years ago
Matt Clay 5babe2daea Increase python version coverage for tests. (#24762)
* Improve ansible-test inventory handling.
* Fix python 3 re-raise of exception from thread.
* Fix python 3 encoding for windows-integration.
* Run network tests on multiple python versions.
* Run windows tests on multiple python versions.
* Support Shippable delegation using --tox.
* Skip vyos_command on python 3 tests until fixed.
* Add python 3 filtering to local and tox.
* Fix tests to support back to back runs.
* Temporarily test networking with python 2.7 only.

Running the tests back to back causes intermittent test failures
which need to be addressed before we can test multiple versions
in a single test run.
7 years ago
Tom Melendez c99c3b2b5d [GCP] Healthcheck module (#24564)
* [GCP] Healthcheck module

* fix return YAML block

* removed update_ return value; removed python26 check; typos and docs updates

* doc fix

* Updated int test for no-update conditions

* added filter_gcp_fields test

* fixed bug in update where dictionary wasn't built correctly and port was not being set.

* added default values to documentation block
7 years ago
Tom Melendez 3fbf3b51ff [GCP] remove ansible.utils.display for deprecations (#24738)
* [GCP] remove ansible.utils.display for deprecations, use module.deprecate instead.

* removed test file from legacy files
7 years ago
Dag Wieers ac1017b7ad ansible/constants: PEP8 compliancy (#24692)
- Make PEP8 compliant
7 years ago
Dag Wieers 37bfca23c9 slurp: PEP8, imports, cosmetics (#24677)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Dag Wieers ea27baf7ff examples/: PEP8 compliancy (#24682)
- Make PEP8 compliant
7 years ago
Dag Wieers de907a8e36 ansible/compat/: PEP8 compliancy (#24689)
- Make PEP8 compliant
7 years ago
Dag Wieers ac27c54c2e ansible/errors: PEP8 compliancy (#24693)
- Make PEP8 compliant
7 years ago
Matt Clay f5332de83d PEP 8 fixes. 7 years ago
Ganesh Nalawade 38eeeb755d Add ios changes for Python3 (#24601)
* Add ios changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
pep8 fixes

* Fix CI issues

* Fix review comment
7 years ago
Matt Clay c4a2deda9d Restore disabled opensuse integration tests. 7 years ago
Abhijeet Kasurde ad41d0e88f Pep8 fixes for parted (#24713)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 036ba7eeec Clean up Shippable tools and update job handling.
- Tools are now in a tools subdirectory.
- Removed obsolete ansible-core-ci tool.
- Added run.py for starting new CI runs.
- Improved handling of run IDs and URLs.
- General code cleanup and docs updates.
- Nightly CI runs use complete coverage.
7 years ago
Trishna Guha 8937246f8f Fix nxos ospf and Unit test (#24613)
* nxos_ospf fixes refactor

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

* unit test nxos_ospf

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 6e160650e9 Fix run filter on Shippable downloader. 7 years ago
Daniel Shepherd cf4806d29d [cloud] Update AWS CloudTrail module to use boto3 and updated/new CT parameters (#22884)
remove cloudtrail.py from legacy-files as it passes pep8 tests now

update return values to use snake case per coding guidelines

update boto3 exception handling to use method outlined in coding guidelines

update parameter spec and return value code per PR code review
7 years ago
Tom Melendez 07c55b855a [GCP] Forwarding Rule module (#24627)
* [GCP] Forwarding Rule module

* pep8 formatting for tests

* remove py26 check and updated_ key; docs and typo fixes
7 years ago
Ganesh Nalawade a3c689bf0d Add sros changes for Python3 (#24604)
* Add sros changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

Code cleanup
pep8 fixes

* Fix CI issue
7 years ago
Ganesh Nalawade 16d610c1de Add vyos changes for Python3 (#24603)
* Add vyos changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
pep8 fixes

* Fix CI issues
7 years ago
Ganesh Nalawade f4e1dc503b Add iosxr changes for Python3 (#24605)
* Add iosxr changes for Python3

Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431

* Fix CI issue
7 years ago
Dag Wieers 9a5a61bdca hacking/: PEP8 compliancy (#24683)
- Make PEP8 compliant
7 years ago
Dag Wieers 4f29662a9e ansible/vars/: PEP8 compliancy (#24685)
- Make PEP8 compliant
7 years ago
Matt Clay 9178e176b5 Limit sphinx version on python 2.6. (#24678)
* Limit sphinx version on python 2.6.
* Fix issues identified by rstcheck.
7 years ago
Will Thames 9a958da57e [cloud] Make ec2_vpc_nat_gateway results consistent (#24042)
Ensure newly created NAT gateways get converted to snake dict
Remove custom code, and associated test, for generating snake
dict and use `camel_dict_to_snake_dict`
Make use of `required_if` rather than bespoke parameter checks
Remove ec2_vpc_nat_gateway from pep8 legacy files list
7 years ago
Ganesh Nalawade f5d865a208 Fixes #24251 save config only if it is changed (#24345)
* Fixes #24251 save config only if it is changed

Save to startup configuration only when it is different
from running configuration.

* Fix unit test issue
7 years ago
Dag Wieers c6533d4da9 utils/unicode: PEP8 compliancy (#24668)
- Make PEP8 compliant
7 years ago
Nathaniel Case f240ba6b60 nxos_bgp_neighbor cleanup (#24446) 7 years ago
Dag Wieers 61d68275e8 module_utils/asa: PEP8 compliancy (#24655)
- Make PEP8 compliant
7 years ago
Matt Clay 4daa16f9ce Add --all and --stub coverage options.
ci_coverage
ci_complete
7 years ago
Rene Moser e34fd20452 cloudstack: test: fix setup cs_vpc not using zone 7 years ago
Abhijeet Kasurde 764b4b20ec Fix UnboundLocalError in basic.py
* Fix for UnboundLocalError while accessing deprecations
  in result
* Add Unit test

Fixes #24592

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 6a2a7a2392 Enable codecov.io and add coverage grouping. 7 years ago
Matt Clay a23f503286 Temporarily disable cs_network_acl test in CI.
This test currently conflicts with cs_vpc, causing it to fail if
both tests are run together.
7 years ago
René Moser 3ca3163af1 cloudstack: add new module cs_network_acl (#24609) 7 years ago
Matt Clay fdcad0f44d Improve on-demand coverage for Shippable. 7 years ago
Matt Clay 5cb5228cde Implement on-demand coverage on Shippable. (#24535) 7 years ago
Toshio Kuratomi d834412ead Fix for persistent connection plugin on Python3 (#24431)
Fix for persistent connection plugin on Python3.  Note that fixes are also needed to each terminal plugin.  This PR only fixes the ios terminal (as proof that this approach is workable.)  Future PRs can address the other terminal types.

* On Python3, pickle needs to work with byte strings, not text strings.
* Set the pickle protocol version to 0 because we're using a pty to feed data to the connection plugin.  A pty can't have control characters.  So we have to send ascii only.  That means
only using protocol=0 for pickling the data.
* ansible-connection isn't being used with py3 in the bug but it needs
several changes to work with python3.
* In python3, closing the pty too early causes no data to be sent.  So
leave stdin open until after we finish with the ansible-connection
process.
* Fix typo using traceback.format_exc()
* Cleanup unnecessary StringIO, BytesIO, and to_bytes calls
* Modify the network_cli and terminal plugins for py3 compat.  Lots of mixing of text and byte strings that needs to be straightened out to be compatible with python3
* Documentation for the bytes<=>text strategy for terminal plugins
* Update unittests for more bytes-oriented internals

Fixes #24355
7 years ago
Ilya Drey 62b8813873 Improving nxos_ip_interface module (#21353)
* Improving of nxos_ip_interface module

Added features:

  * Route tags for an IP address at interface level with 'tag' option
  * Support of IPv4 secondary addresses if option 'allow_secondary' is
true (false by default). If option 'allow_secondary' is true primary
IPv4 address will be replaced

All features support NXAPI and CLI transport, but only with text/raw
output. Currently not possible to get route tags for secondary IPv4/IPv6
addresses from JSON output.

Other changes:
  * Module return state 'changed' only when configuration commands were
executed
  * Module result includes multiple prefixes if IPv4 addresses were
found

* Fix PEP8 issues

* Addition fix of PEP8 issues

* Remove unused variable from main()

* Fix "proposed" sample in RETURN variable

* Fix "existing" sample in RETURN variable

* Update RETURN variable

Add 'secondary' for every element of 'addresses' list.

* Restore old version number

* Added exception when ipaddress module is imported

* DOCUMENTATION string was updated

  * Added 'version_added' for new features
  * Added 'requirements' for module

* Added compatibility with latest commit in devel branch

* DOCUMENTATION was fixed
* Improve changes of route tag for existing ip addresses
* Added compatibility with core code

* Fixed mistypes in the DOCUMENTATION variable

* argument_spec fixed

allow_secondary argument type was changed according to allowed choices.
7 years ago
John R Barker e9e2d67035 Run vyos_command Network tests in Shippable (#24514)
* Run VyOS Network tests in Shippable

* net_command no longer exists

* network/ci

* Disable other network tests

* pep8 fix

* Fix PEP 8 issue.
7 years ago
Matt Clay 771b467941 Disable unstable win_psexec integration test. 7 years ago
Matt Clay af5db3e4a9 Revert "Add support for on-demand coverage on Shippable."
This reverts commit 7b3f0b8870.
7 years ago
Matt Clay 7b3f0b8870 Add support for on-demand coverage on Shippable.
Triggered by setting the COVERAGE environment var to a non-empty value.
Alternatively the string `ci_coverage` can be added to a commit message.
7 years ago
Matt Clay dfd19a812f Miscellaneous bug fixes for ansible-test.
- Overhauled coverage injector to fix issues with non-local tests.
- Updated integration tests to work with the new coverage injector.
- Fix concurrency issue by using random temp files for delegation.
- Fix handling of coverage files from root user.
- Fix handling of coverage files without arcs.
- Make sure temp copy of injector is world readable and executable.
7 years ago
Brian Coca c50cf22d52 deal with null/none connections
fixes #23621
pushed 'connection resolution' to play_context
override fieldattribute getter
7 years ago
Tom Melendez 4a5cf0b5c1 [GCE] [GCP] UrlMap module (#24422)
* [GCP] UrlMap module

This module provides support for UrlMaps on Google Cloud Platform.  UrlMaps allow users to segment requests by hostname and path and direct those requests to Backend Services.

UrlMaps are a powerful and necessary part of HTTP(S) Global Load Balancing on Google Cloud Platform.

UrlMap takes advantage of the python-api so the appropriate infrastructure has been added to module_utils.

More about UrlMaps can be found at:
https://cloud.google.com/compute/docs/load-balancing/http/url-map

UrlMap API:
https://cloud.google.com/compute/docs/reference/latest/

Google Cloud Platform HTTP(S) Cross-Region Load Balancer:
https://cloud.google.com/compute/docs/load-balancing/http/

* updated documentation, remmoved parens

* fixed tabs
7 years ago
Abhijeet Kasurde 728d3e6c84 Pep8 fixes for web_infra/ansible_tower (#24479)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay fb9efd3c7e Add `--remote-terminate` option to ansible-test.
Set `--remote-terminate success` for osx tests.
7 years ago
Jon Hadfield eb4cc31ae5 [cloud] migrate ec2_asg to boto3 and support application ELB target groups. (#19667)
* switch to boto3 and add support for application ELBs with target groups.

* use py23 compatible dict iterator.

* removing commented out fail_json calls

utilize sets to simplify logic

remove setting a redundant variable

add bounds checking in two places

add AWSRetry decorator - do we want this for other functions too?

change xrange to range so python3 doesn't fail

remove sorting lists of dicts; in python2 this returns None, in python3 this fails

* remove error variable from traceback.format_exc

* Remove boto2-style calls brought in by rebase

Old boto-style calls to `as_group` attributes break in boto3

Also remove module from legacy-PEP8 list

* Add  parameter to target_group_arn option

* Fix HAS_BOTO3 check

* use tags.items() instead of iteritems

* import botocore

* Fixed bugs in deleting autoscaling groups

* make changes in deleting autoscaling groups pep8

* more pep8

* fix version

* fix bugs so local integration tests run

* fix launch config check

* reflect changed status for ASG updates

* Fix existing exception handling and use traceback.

Fix imports

* line length

* Fix notification setup

* Fix mutually exclusive arguments
Only one of the AvailabilityZones and VPCZoneIdentifier arguments should be provided to the CreateAutoScalingGroup call.

* Allow desired_capacity, min_size, max_size, launch_config_name to be derived from the existing ASG if not specified

Remove code updating dict after ASG already uses it
7 years ago
Matt Clay 496280858d Revert "Temporarily disable test which fails in group run."
This reverts commit 99d328976d.
7 years ago
Matt Clay b8cb3f519b Detect and fix environment tampering in tests. 7 years ago
Matt Clay 99d328976d Temporarily disable test which fails in group run. 7 years ago
Abhijeet Kasurde 3d51081a59 Refactor nxos_reboot module (#24484)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Trishna Guha b2a2f69a6e nxos_vrf_af fix and unit test (#24399)
* nxos_vrf_af fix and unit test

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

* ansibot told me to do this

* use sorted() as the test list elements differ in order for python2.x and 3.x
7 years ago
Trishna Guha 62eafa8837 fixes nxos_evpn_vni and unittest (#24372)
* fixes nxos_evpn_vni

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

* fixes pep8 issue and syntax error

* ansibot tole me to do this

* Unit test
7 years ago
Dag Wieers e855274dc8 win_psexec: Enable -nobanner option by default (#23422)
* win_psexec: Enable -nobanner option by default

PR also includes:
- Option `nobanner:` to remove this flag
- Improvements to Examples
- Improvement to Return Value
- Add types to all parameters now
- Add (limited) integration tests

* Move sysinternals into C:\Windows\Temp
7 years ago
Nathaniel Case 09b2964dee nxos_bgp_af updates (#24171)
* update docs
* clean up nxos-bgp_af
* Remove useless params from bgp_af
* Add bgp_af tests
7 years ago
Abhijeet Kasurde 2f26c5285a Refactor nxos_file_copy module (#24314)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
jctanner e9c2546ffe Add integration test targets for core supported modules (#24217)
A preliminary set of test targets for "core" supported module that had no independent tests. These will also help us ensure python3 compatibility for those modules and prevent future regressions.
7 years ago
René Moser 2ef6713abb cloudstack: new module cs_vpn_gateway (#23954)
* cloudstack: new module cs_vpn_gateway
* add integration tests for cs_vpn_gateway
7 years ago
Matt Martz d3249e7875 pep8 fixes for contrib (#24344) 7 years ago
Matt Davis ead23783be slightly increase win_async_wrapper fire and forget sleeptime
* should fix Shippable timeouts when AWS CPU credits are low- right on the bubble of failure w/ 5s execution
7 years ago
Martin Kopta e1d896052d unit test for #24330 (#24346) 7 years ago
Dag Wieers bc806ff479 Windows: Small fix to Add-Warning and Add-DeprecationWarning (#23520)
Simplified the logic, and fix the issue of having a nested list as
entry.

Also indicate that we deliberately want to retain $null values
(and i.e. do not want them to be turned into a boolean).
7 years ago
Ganesh Nalawade 5b3ea6562b Add junos integration test (#24404) 7 years ago
Benjamin Jolivot e99815e9f5 Fortios file only mode + integration tests (#23275)
* WIP file_mode

* WIP

* Add file_mode + integration tests

* fix pep8

* Update doc fragments
Create mutualy_exclusive param
Fix yamllint problem in tests

* Add aliases file + main playbook for fortios

* Install pyfg before running tests

* Install pyfg before running tests in role

* Remove pre_task as it's done in roles

* Force pyFG minimal version for python3

* role_path not role_dir :(

* Change requirements

* Specify Error type when error on import

* Bug in pygf library with python 2.5 (PR is waiting https://github.com/spotify/pyfg/pull/19)

* Bad requirement format

* still bad format -_-'

* remove test/integration/fortios.py (auto generated by tests)
missing new lines at end of file

* pyFG is now fixed in 0.50
7 years ago
Abhijeet Kasurde e342b281d8 Check if api_key and app_key before proceeding (#24336)
Fix adds check if app_key and api_key provided by
user is correct or not. If this combination is wrong
then fail with appropriate error message given by
Datadog server

Fixes https://github.com/ansible/ansible/issues/24325

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay d999d613cb Python 3 fixes for CloudStack modules and tests. (#24400) 7 years ago
Matt Clay e6934e42be Update ansible-test change handling and CS plugin. (#24395)
* Use CloudStack simulator from Ansible repo.
* Recognize cloud specific ansible-test changes.
* Hide ansible-test cs notice in explain mode.
7 years ago
René Moser aaf4f04574 automated integration tests for cloudstack (#20552) 7 years ago
Nathaniel Case 830f19d444 nxos_bgp updates (#24270)
* Remove invoke from nxos_bgp
* Try to simplify get_existing
* Streamline state_present
* More testing, squash & compact get_value & get_custom_value
* Streamline main
* nxapi has problems reading CustomNetworkConfig directly
7 years ago
Abhijeet Kasurde 2425143cf2 Pep8 fixes for digital_ocean_*
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 9c5b55232c Pep8 fixes for Windows module (#24349)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 86bf27511c Migrate cs_sshkeypair test to ansible-test. 7 years ago
Matt Clay 0573b8bcd2 Fix ansible-test cloud integration bugs. 7 years ago
Matt Clay 17e07a27b2 Enable cloud tests for use with ansible-test. 7 years ago
Matt Clay ac72fd9d2c Add missing return statements. 7 years ago
Matt Clay 201242f302 Fix call to wrong method in ansible-test. 7 years ago
Trishna Guha ad0a01ffb5 nxos_vrf refactor (#24280)
* nxos_vrf refactor

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

* Unit test for nxos_vrf
Remove unnecessary keys() method
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 1582e9bf7d Fix handling of Shippable env vars. 7 years ago
Matt Clay a07d42e16d Add support for cloud tests to ansible-test. (#24315)
* Split out ansible-test docker functions.
* Add cloud support to ansible-test.
7 years ago
Ganesh Nalawade 0e756a1cf9 Add junos unit test case (#24249)
* Add junos modules unit test case

* Fix CI issues
7 years ago
Toshio Kuratomi a0dfa8616a Make fetch default to fail on errors
Fixes #23501
7 years ago
Toshio Kuratomi 36d7c0c403 Fix places where path needs to be bytes on python3
These were discovered on python3 with fetch code that fails on errors.  Probably could be
provoked with particular sets of arguments to stat as well.
7 years ago
Sloane Hertel ad8cb903f4 rds: do not update multi-az unless specified - fixes #23385 (#23498)
* allow multi_az to be unmodified if not explicitly specified

* fix pep8 and remove from legacy files
7 years ago
Matt Martz 2fbfba0ef3 Make Reporter class hold all results, move line/col into results, and out of message (#24127)
* Make Reporter class hold all results, move line/col into results, and out of message

* Move line/col out of message for YAML parser errors

* We have lineno for the DOC var, use it for YAML parser errors

* Remove valdiate-modules files from legacy-files

* pep8 indentation fixes

* Add todo for line/col in _validate_docs_schema
7 years ago
Matt Clay 6522d703a1 Fix ansible-test pylint and pep8 issues. (#24245)
* Fix pylint useless-super-delegation issues.
* Fix miscellaneous pylint issues.
* Fix PEP 8 issues.
* Fix warnings reported by PyCharm.
7 years ago
Matt Clay 00f8e3d360 Fixes for EC2 module integration tests. 7 years ago
Ganesh Nalawade a42b892f70 Fix junos_rpc and junos_user broken issues (#24238)
* Fix junos_rpc and junos_user broken issues

Add persistent connection related changes.

* Fix CI issues
7 years ago
Abhijeet Kasurde 465c12ccdb Pep8 fixes for deploy_helper (#24237)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 7195c31753 Refactor openvswitch_port module (#24205)
Use current patterns from other network modules for better
maintainability.
7 years ago
Abhijeet Kasurde 53f0cd197e Pep8 fixes for jira (#24229)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde b6b3f84990 Pep8 fixes for htpasswd (#24230)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde fbb924ff24 Pep8 fixes for letsencrypt module (#24144)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde df5be2b8ea Pep8 fixes for django_manage (#24198)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Robin Roth 0cf00db750 Make git module pep8 compliant (#24196) 7 years ago
Sloane Hertel e13fc5d6bd elasticache_parameter_group: fix documentation and exception handling - fixes #23709 (#23718)
* fix documentation and correct exception handling

* follow AWS exception guidelines

* fix parameter_group_family req; only needed when creating cache parameter group

make pep8 and remove from legacy files
7 years ago
Sloane Hertel fcaa49b536 sns: move from notification directory to cloud/amazon directory - fixes #11874 (#23805)
* move sns to cloud directory

* make sns pep8 and remove from legacy files
7 years ago
Abhijeet Kasurde 9d9e9a79e2 Pep8 fixes for apache2 module (#24185)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Andrea Tartaglia 4e4fc9cb4c Added test for 'RETURN' field in validate-modules (#23322)
* Added test for 'RETURN' field in validate-modules

* print the field being tested.

Useful when the RETURN structure is complex.

* Fixed schema after CI traceback fail

* Fixed list_string_types

* Fixed line in 319 code for RETURN
7 years ago
Toshio Kuratomi 3428f42120 Add integration test that modules are loaded from the expected locations (#24170)
* Add integration test that modules are loaded from the expected locations
* Fix ping module to pass PEP8
7 years ago
Matt Martz 040fb4435a Fix password prompt matching (#24081)
* Fix password prompt matching

* Add some tests for check_password_prompt

* Prevent pep8 line ends with a space error
7 years ago
Abhijeet Kasurde d8f76bed97 Misc fixes and Pep8 fixes for proxmox_* modules (#24162)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde cdca648f15 Pep8 fixes for jenkins_* module (#24154)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Toshio Kuratomi d088030fa6 Facts Timeout was not settable via ansible.cfg
The timeout for gathering facts needs to be settable from three places
(highest precedence to lowest):

* programmatically
* ansible.cfg (equivalent to the user specifying it explicitly when
  calling setup)
* from the default value

The code was changed in b4bd6c80de to
allow programmatically and the default value to work correctly but
setting via ansible.cfg/parameter was broken.

This change should fix setting via ansible.cfg and adds unittests for
all three cases

Fixes #23753
7 years ago
Abhijeet Kasurde 806506c032 Pep8 fixes for taiga_issue module (#24143)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
René Moser 594d7d5d9d cloudstack: cs_region: fix pep8 (#24134) 8 years ago
Toshio Kuratomi 1c05ed7951 Fix circular import with unsafe_proxy, template, and vars
template/__init__.py imported unsafe_proxy from vars which caused
vars/__init__.py to load.  vars/__init__.py needed template/__init__.py
which caused issues.  Loading unsafe_proxy from another location fixes
that.
8 years ago
Toshio Kuratomi 500de1f557 Remove hack for backwards compatible v2_playbook_on_start callback
Just after release of 2.0.0 (in 2.0.0.1) we had a change to the API of
callbacks without bumping the API version.  We added the playbook to the
arguments passed to the callbacks.

This wasn't in the Tower callback at the time.  In order to prevent
breaking that callback we added a temporary hack to inspect the
callback's API to decide if we needed to call it with arguments or not.

We scheduled the hack for removal in January 2017.  Since that's now
past, removing the hack.

Change signed off by matburt on the Tower side.
8 years ago
Ricardo Carrillo Cruz 467a9bdd4e Refactor openvswitch_bridge (#24014)
Use common patterns from other network modules for better
maintainability.
8 years ago
SesquipedalianDefenestrator 3f321e7591 Add check_mode to get_url (#20532)
* Add check_mode to get_url that does a HEAD request to make sure the URL exists, but doesn't write the real file

* Add info about new --check behavior to docs.  Add tests for the new behavior.  Populate res_args with the info the tests are looking for.

* Add trailing comma

* Change nonexistent test URL to http://{{httpbin_host}/DOESNOTEXIST.  Fix spacing while I'm at it

* Further spacing cleanup

* State that this functionality is in Ansible 2.4+
8 years ago
Abhijeet Kasurde ca7616b4a1 Pep8 fixes for ha_proxy module (#24090)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
8 years ago
John R Barker ecbf8e933a Docs how to test (2nd) (#24094)
* Big testing doc refactor
* Combine all the testing documentation in to one place to make it easier to find
* Convert everything to RST
* Create testing_network guide
* Create testing landing page
* For each section detail "how to run" and "how to extend testing"
* More examples
* Lots more detail
8 years ago
Pierre-Louis Bonicoli a13d89da68 Debian: really generate locales
/usr/sbin/locale-gen differs between Debian and Ubuntu. With Debian,
locales must be added to /etc/locale.gen before calling locale-gen
command. With Ubuntu, /etc/locale.gen is updated by
/usr/sbin/locale-gen.

Use the locale-gen module which handles both distributions.
8 years ago
Pilou bf5d87af07 PostgreSQL Integration test suite: improvements (#23631)
* PostgreSQL tests: use package module
* PostgreSQL tests: use ansible_service_mgr in order to test init system
* PostgreSQL tests: fix a typo
* PostgreSQL tests: install only required packages
* PostgreSQL tests: use role default value when unchanged
8 years ago
Matt Clay 9f56f87770 Fix PEP 8 issue. 8 years ago
Trishna Guha 2741907cba Refactor nxos_interface and add unit test (#24008)
* [WIP] Refactor nxos_interface

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

* Modification in refactor
Unittest for nxos_interface
8 years ago
Nathaniel Case 689b93bf14 Junos_config unicode (#23369)
* Try to handle unicode output more sensibly

* Appears I'm getting latin1 instead

Ugh.
8 years ago
John R Barker 1c61b9bae7 Split modules/network into two parts (#24024)
* Split modules/network into two parts

Given the dedicated team we we have working on Ansible Networking a
clearer split is needed between Networking modules and "things that
happen to use the network"

* nmcli to net_tools

* nmcli moved
8 years ago
Colin Chan 2d9d1762ba Improve parsing of 'systemctl show' output 8 years ago
Nathaniel Case fc0bf87c20 Run `save` inside config mode. (#23977)
* Run `save` before exiting config mode.

* Fix unit tests for `save`

* Allow `save` to be on its own again and introspect success

* Introspecting `compare running` makes this a lot harder.

Move `save` tests to integration tests
8 years ago
Ganesh Nalawade 9c4daded94 Add junos_config unit test (#24005) 8 years ago
Ricardo Carrillo Cruz 2716fad38f Return commands instead of command (#24061)
Ok, so for openvswitch_db in particular we just return one command
but in the sake of consistency and code re-use, let's return a list
of "commands", even if it's just one.
8 years ago
Abhijeet Kasurde 9456f93ea8 Pep8 fixes for known_hosts.py (#24029)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
8 years ago
Ricardo Carrillo Cruz 7c1b8da1a1 Refactor openvswitch unit tests (#24055)
Rather than passing a file to load fixture, build a matrix containing
the run_command side_effect per test.
This will allow more code-reuse for other ovs modules unit tests.
8 years ago
Senthil Kumar Ganesan ce99ffe205 Fixed PEP8 issues (#24030) 8 years ago
Matt Clay d662f6f0db Fix bugs in ansible-test units command. (#24044)
* Handle old versions of coverage.
* Handle old versions of setuptools.
* Detect python version for docker/remote units.
* Add sanity override for test constraints.
8 years ago
Nathaniel Case 0d67a49d5a nxos_bgp fixes (#23927)
* Pre-emptively fix sanity/pep8

* fix for commands

* Quick unit test
8 years ago