Commit Graph

4150 Commits (dc85176512d5612f9a668c4adcec9342b7e32b72)

Author SHA1 Message Date
Nathaniel Case 2425374fdd
Actually move vyos tests to network_cli (#33710)
* Fix vyos on network_cli on python3

bytes do not have format() in Python3

* Push connection to tasks, with bonus connection=local test

* Run tests without explicit connection set

* Add/update START messages where appropriate
7 years ago
John R Barker cfb15b0272 Revert "YAML inventory unit test: fix test inventory format (#33828)" (#33869)
This reverts commit dfb2f346d8.

https://github.com/ansible/ansible/pull/33828
7 years ago
tchernomax 29bed12cdd vmware_host: add reconnect and add_or_reconnect states (#30582)
* vmware_host: add reconnect and add_or_reconnect states

Add "reconnect" and "add_or_reconnect" choices for "state".

* reconnect: reconnect an esxi to a vcenter (imply it is present).
* add_or_reconnect: do the same but add the esxi if absent.

Also:
* tag the cluster_name as required (because it is).
* tag esxi_username and esxi_password as not required because
    they aren't when the esxi isn't added.

* vmware_host: add + prepare/document integration tests

vmware_host module

Add integration test for the add part of "add_or_reconnect" state.

Prepare and document integration tests for the reconnect part
of "add_or_reconnect" state and "reconnect" and "absent" states.

Currently we can't test those states as ReconnectHost_Task (for
"reconnect") and EnterMaintenanceMode_Task (for "absent") aren't
implemented yet in vcsim (from vmware/govmomi)
7 years ago
Pilou dfb2f346d8 YAML inventory unit test: fix test inventory format (#33828)
* Fix YAML inventory unit test

* YAML inventory unit test: add checks

* YAML: add hosts without any group to ungrouped
7 years ago
Pilou 7c187cae93 Fix playbook cli unit test (#33767)
* TestPlaybookCLI: '--flush-cache' were ignored

Check that using '--flush-cache' does something

* check that '_flush_cache' does something

There isn't any fact by default: the assertion was true even if
'cli._flush_cache()' isn't called.
7 years ago
James Mighion 3a9083cf48 ios_config save (#33791)
* Fixing save so it still works. Adding changed as an option for save_when.

* Updating unit tests.

* Updating description to state that changed was added in 2.5.
7 years ago
Pilou 02e965ba20 maven_artifact: fix broken import (#33749)
* Fail when lxml isn't available

* whole project requires Python >= 2.6
7 years ago
Ganesh Nalawade ea18b9021a
Revert "Deprecate Entity, EntityCollection and use subspec in network modules (#33575)" (#33849)
This reverts commit 4349b56643.
7 years ago
Pilou b6528ea19f ovirt_disk: fix Python 3 compatibility (use six) (#33730) 7 years ago
Tim Rupp 9a807e6316
Adds bigip_security_port_list module (#33845)
This module can be used to manage port lists in an AFM configuration.
7 years ago
Zim Kalinowski eb5ffa0d4e [new module] Added Azure SQL Servers support - cloud/azure/azure_rm_sql_servers (#33077)
* Added new module: Azure RM SQL Servers

* fixed sanity issues

* enabled integration test

* disabling test as Microsoft.Sql namespace not available

* renamed servers -> server

* updates as requested in the review

* udpates to sql server

* renamed module

* replaced has_key by in

* flattened results

* final updates to sql server

* updates as requested in the review

* added more tests

* deleting unexisting instance up front

* more tests

* another round of test changes

* removed uneeded test
7 years ago
Tim Rupp cb026bb660
Adds bigip_profile_client_ssl module (#33844)
This module can be used to manage client ssl profiles on a BIG-IP
7 years ago
Toshio Kuratomi 155f36bbd8
Rekey on member (#33836)
* Change cast_list_to_dict to more generic rekey_on_member

cast_list_to_dict was taking an arbitrary data format in and returning
an arbitrary data format out.  Rework this to be a more generic function
which creates a dict of dicts based on a member of the dict.

Remove cast_dict_to_list since rekey_on_member handles the use cases we
know about and cast_dict_to_list suffers from the same problems as
cast_list_to_dict.  If this is still needed we could think about filters
we could add to do this in a short jinja2 pipeline.

* Fix bare excepts (bare excepts even catch sys.exit())
7 years ago
Matt Martz 5c63bb0090 Add test for clean_copy preservation of keys 7 years ago
Pilou 58fdbe7415 rhn_channel/register: Porting tests to pytest (#33719)
* rhn_channel/register: Porting tests to pytest

Related: #33387

* rhn unit tests: use mock_request as a fixture
7 years ago
MarkusTeufelberger 9ea1b18ff7 Allow multiple values per key in name fields in openssl_certificate/csr (#30338)
* allow multiple values per key in name fields in openssl_certificate

* check correct side of comparison

* trigger only on lists

* add subject parameter to openssl_csr

* fix key: value mapping not skipping None elements

* temporary fix for undefined "subject" field

* fix iteration over subject entries

* fix docs

* quote sample string

* allow csr with only subject defined

* fix integration test

* look up NIDs before comparing, add hidden _strict params

* deal with empty issuer/subject fields

* adapt integration tests

* also normalize output from pyopenssl

* fix issue with _sanitize_inputs

* don't convert empty lists

* workaround for pyopenssl limitations

* properly encode the input to the txt2nid function

* another to_bytes fix

* make subject, commonname and subjecAltName completely optional

* don't compare hashes of keys in openssl_csr integration tests

* add integration test for old API in openssl_csr

* compare keys directly in certificate and publickey integration tests

* fix typo
7 years ago
Jacob McGill 9ff5c15f57 ACI Encap pool: New module for support layer2 encap pools (#33219)
* ACI Encap Pool: Add new module to support VLAN, VXLAN, and VSAN Pools

* update logic for allocation_mode

* update docstring and tests

* Update filter_target since url method has been updated
7 years ago
jglf 74a7cc7130 vmware_guest: option to enable nested virtualization (#28149)
Signed-off-by: Julien Le Foll <jlefoll@percallgroup.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Jordan Borean e3f44b74bd
win_stat: better support for links (#33005) 7 years ago
Adrian Likins a57d6a4206 Use pop in cb clean results (#33779)
* Fix _clean_result for debug callback with 1 char var names

The check in _clean_results was removing any keys that happened
to be one of the chars in ('invocation') instead of the string
'invocation'. This was meant to be a tuple but there was no comma
so the for iterated the string instead of the tuple.

Introduced in 9dba580204

Update unit test to catch this.

Fixes #33723

* Use .pop() to remove invocation from results dict

In base callback _clean_results, simplify the way the
'invocation' item is removed.

Add some more unit tests.
7 years ago
Trishna Guha c2b4fd7f1e
Convert non-DI module to DI nxos_user (#33770) 7 years ago
jctanner 8a4e761814
Enable the pull target to work in vvvv mode (#33755) 7 years ago
Ganesh Nalawade 4349b56643
Deprecate Entity, EntityCollection and use subspec in network modules (#33575)
* Deprecate Entity, EntityCollection and use subspec in network modules

*  As per proposal https://github.com/ansible/proposals/issues/76
   deprecate use of Entity, EntityCollection, ComplexDict, ComplexList
   and use subspec instead.
*  Refactor ios modules
*  Refactor eos modules
*  Refactor vyos modules
*  Refactor nxos modules
*  Refactor iosxr modules
*  Add support for key in suboptions handling

* Fix CI issues
7 years ago
Gaudenz Steinlin a23da23491 cloudscale_floating_ip module (#33181)
* Refactor cloudscale API code

Move code common to all cloudscale cloud modules into a common base
class.

This is needed as a prepartion of the cloudscale_floating_ip module.

* cloudscale_floating_ip module

New cloud module to manage floating IPs on the cloudscale.ch IaaS
service.
7 years ago
Eike Frost d84e0861ef zabbix_host ipmi_*-tests (#33717)
* zabbix_host ipmi_*-tests

* oops, double assert fixed
7 years ago
Tim Rightnour 51475cd623 Add a vmware_datastore_facts module (#30815)
Fix a bunch of things mentioned in the review.

Delete commented code from module.  Add fix for vcsim not returning
uncommitted.
Add integration test.

Add changes suggested
7 years ago
Tim Rupp 7b76124c07
Fixes for gtm wide ip (#33725)
Adds pools argument. Refactors code to support new conventions.
Adds more unit tests
7 years ago
Prasad Katti 5d579e1e66 [cloud] Port ec2_key module to boto3 (#33075)
* port ec2_key to boto3

* update tests for ec2_key
7 years ago
Sloane Hertel 7bb35e8781
Fix using loops with environment and add tests (#32796) 7 years ago
Toshio Kuratomi b455901904
Fix shebang. shebang and interpreter path weren't being templated (#33698)
* Fix shebang.  shebang and interpreter path weren't being templated

Fixes #18665
Fixes #33696
7 years ago
Claes Nästén c8a5e689e3 Fix issue with setting values in choices (#33574) 7 years ago
Matt Clay ad4975d3e7 Update Azure module test infrastructure.
- Use new Azure direct API implementation.
- Enable Azure tests to clean up on exit.

ci_complete
7 years ago
John R Barker 18529a275b Bulk pep8 fixes - hand crafted (#33690)
* Bulk pep8 fixes - hand crafted

Fix by hand the remaining issues that autopep8 couldn't

* Next batch of hand crafted pep8 fixes

* Ignore W503

https://github.com/PyCQA/pycodestyle/pull/499

* Revert more of W503
7 years ago
Nathaniel Case 551847beea
Fix issues with net_user tests on eos (#33691)
* Fix net_user/eos and also the horribly broken cleanup there

* The rest of net_user/eos has the same problem
7 years ago
John Barker 10cd2cd1b7 Manually fix issues that autopep8 introduced
* iam.py 161 -> 160 chars
* lamba -> single line function -> multiline function

Avoid redefining key

iam line length

iam.py now clean
7 years ago
John Barker c57a7f05e1 Bulk autopep8 (modules)
As agreed in 2017-12-07 Core meeting bulk fix pep8 issues

Generated using:
autopep8 1.3.3 (pycodestyle: 2.3.1)
autopep8 -r  --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules

Manually fix issues that autopep8 has introduced
7 years ago
ZhijunZhao f8d7e477f0 fix azure test case failure for function apps module (#33658) 7 years ago
Eike Frost 31e3b8197f zabbix_host: fix integration tests only working individually (#33630)
* remove mod_evasive which is potentially installed by apache2_module
integration test and add zabbix_host to CI
7 years ago
Matt Martz 28373e1fe0
Address recent changes to tests to fix jinja tests as filters (#33679) 7 years ago
Kedar Kekan 012a96dabd
code cleanup for `--diff` and `--check` modes (#33665)
* code cleanup for `--diff` and `--check` modes

* fixes UT to remove exec_command
7 years ago
Matt Davis b91117dac8
azure_rm_containerservice (#33597)
* add acr

* acr

* acr

* fix a minor error

* add tests and fixes as suggested

* use get_mgmt_svc_client to enable bi

* fixes as zim suggested

* code refinement

* get acr instance before update

* fix a bug

* remove Classic sku as it's going to deprecate

* pass sanity test

* fix sanity

* fixes based on comments

* fix broken namespace unregistered error

* fix a bug

* fix a bug

* fix

* add register namespace

* fixes tests

* remove pdb

* add ci azure test

* removed required: false

* renamed acr -> containerregistry

* fixed spelling mistake

* fixed idempotence

* fix for idempotence was wrong

* fixed a few issues

* different log when exception different than ResourceNotFound

* self.fail instead of log

* updated sample return value

* added login server in results

* fixed else

* fixed line too long

* cmp -> __ne__

* fixed trailing whitespace

* output.changed is false when instance updated

* fix for state change

* one more update

* update instance only when location or sku has changed

* fixed syntax error

* fixed acr test

* just removed unnecessary comment to trigger ci

* update return value shape

* flatten `state`
* change credential dictionary state
* add credentials to integration tests
7 years ago
Alexey Shumkin 6f719ea848 fixed: win_copy: typo "file file" (double "file") (#33620)
* fixed: win_copy: typo "file file" (double "file")

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>

* Add quotes around filenames/directories

* Fix tests for new quotes

* Fix tests for new quotes

* One more ?

* Another one...
7 years ago
Kedar Kekan 2bc4c4f156
IOS-XR NetConf and Cliconf plugin work (#33332)
*  - Netconf plugin addition for iosxr
 - Utilities refactoring to support netconf and cliconf
 - iosx_banner refactoring for netconf and cliconf
 - Integration testcases changes to accomodate above changes

* Fix sanity failures, shippable errors and review comments

* fix pep8 issue

* changes run_command method to send specific command args

* - Review comment fixes
- iosxr_command changes to remove ComplexDict based command_spec

* - Move namespaces removal method from utils to netconf plugin

* Minor refactoring in utils and change in deprecation message

* rewrite build_xml logic and import changes for new utils dir structure

* - Review comment changes and minor changes to documentation

* * refactor common code and docs updates
7 years ago
Evgeny Fedoruk e73d3dfe20 Fixing bug when returned 404 status code considered as invalid (#33530)
In case of workflow delete action, the returned 404 status code
considered as invalid although it's a valid code for not found (deleted)
entity.
Removed verification of the status. Only success should be verified.

Fixes #33524
7 years ago
Nathaniel Case 425537861a Fix some net_* tests (#33593)
* Fix typo in net_logging/eos

* This seems to be required to use eos_user in this way

* Fix indentation in net_static_route/eos

* Rework interface check in eos_vrf

This should do the right thing.
7 years ago
Matt Clay 1b5c4b72bd Add Azure provider support to ansible-test and CI.
ci_complete
7 years ago
Matt Clay 58286ef93b Limit pytest < 3.3.0 for python 2.6. 7 years ago
Matt Clay 73132d3906 Update FreeBSD completion for ansible-test. 7 years ago
Matt Clay b107635aeb Disable zabbix_host tests in CI.
The tests pass when run in isolation, but when run as part of the
posix/ci/group1 tests they fail.
7 years ago
Matt Clay 90ac38bd4c Fix module validator handling of empty options. 7 years ago
Jordan Borean a55496553a fix for win_fetch tests (#33601) 7 years ago
Sloane Hertel f5471b3dcb [cloud] ec2_vpc_net integration tests (#33111)
* Add some integration tests for ec2_vpc_net module

* Add a couple tests for check mode

fix typo

ensure the DHCP option set is cleaned up

* Add permissions to test policy
7 years ago
Jordan Borean 38de7c4bb1
win_whoami: new module to emulate whoami executable (#33295) 7 years ago
Toshio Kuratomi cd36164239
Porting tests to pytest (#33387)
* Porting tests to pytest

* Achievement Get: No longer need mock/generator.py
  * Now done via pytest's parametrization
  * Port safe_eval to pytest
  * Port text tests to pytest
  * Port test_set_mode_if_different to pytest

* Change conftest AnsibleModule fixtures to be more flexible
  * Move the AnsibleModules fixtures to module_utils/conftest.py for sharing
  * Testing the argspec code requires:
    * injecting both the argspec and the arguments.
    * Patching the arguments into sys.stdin at a different level

* More porting to obsolete mock/procenv.py
  * Port run_command to pytest
  * Port known_hosts tests to pytest
  * Port safe_eval to pytest
  * Port test_distribution_version.py to pytest
  * Port test_log to pytest
  * Port test__log_invocation to pytest
  * Remove unneeded import of procenv in test_postgresql

* Port test_pip to pytest style
  * As part of this, create a pytest ansiblemodule fixture in
    modules/conftest.py.  This is slightly different than the
    approach taken in module_utils because here we need to override the
    AnsibleModule that the modules will inherit from instead of one that
    we're instantiating ourselves.

* Fixup usage of parametrization in test_deprecate_warn

* Check that the pip module failed in our test
7 years ago
Eike Frost ed376abe42 zabbix_host integration tests (#33184)
* Integration tests for zabbix_host using Zabbix on Ubuntu 14.04.

* fix duplicate yaml key in test

* .changed -> is changed, |failed -> is failed, trim configfile

* zabbix_host integration test does not need BOTMETA entry, inherited from module
7 years ago
Kaz Cheng 60b5c6890a [cloud] Add template_body parameter to cloudformation module to allow lookups (#33485) 7 years ago
Nathaniel Case 8679d2e396
Port integration tests to network_cli (#33583)
* network_cli needs network_os

* Work around for Python 3.x < 3.6
7 years ago
Abhijeet Kasurde 09b3b5305a
VMware: Add vmware guest param - maxMkConnections (#33220)
This fix adds functionality to configure vmware guest parameter called
'maxMkconnections'. Also, added integration test for this change.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 94019e7050
VMware: add support for memory_reservation (#33080)
This fix adds functionality to support memory_reservation and
memory_reservation_lock while managing Virtual Machine.

Fixes: #20407

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers af59817850 pkg5: PEP8 compliancy and documentation changes (#33559)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Ganesh Nalawade aaf22965db
Reset persistent connection in junos integration test (#33573) 7 years ago
Ganesh Nalawade 399e72abb0
Fix reconstructing socket path in network_cli (#33572)
*  Persistent connection socket path is hash of
   remote address, port, remote user and connection
   type.

*  Integration test fixes
7 years ago
Dag Wieers aec8e7784a urpmi: PEP8 compliancy and documentation changes (#33560)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Ganesh Nalawade 95044d69c7
Fix unit test failure for netconf connection plugin (#33547) 7 years ago
ZhijunZhao 8506b7bfdc Fix azure_rm_acs due to Azure breaking API change (#33221)
* Fix azure_rm_acs due to Azure breaking API change

* resolve code review feedbacks

* resolve test failures

* better name

* ignore case for vm size

* reformat code

* resolve code review feedbacks
7 years ago
nwsparks cf6f6d09db new windows module win_audit_policy_system (#31046)
* new windows module win_audit_policy_system

* removed the backup/restore functionality

adjusted to use run-command rather than running the command directly

adjusted testing appropriately for the above changes

* fixed issue with variable naming in testing
removed .psm1 from requires
fixed copyright

* Updated audit_type to list and added appropriate error handling
Updated testing accordingly
Fixed up documentation
7 years ago
Ryan S. Brown 5087ce9273 Remove botocore from top-level execution in lambda_policy tests
Even though the tests are skipped, the `ClientError` uses outside the
test cause a failure even though the tests never run
7 years ago
Dag Wieers ff50b7893c
rpm_key: PEP8 compliancy and documentation changes (#33426)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Dag Wieers fbfeeff6bf
apt_repository: PEP8 compliancy and documentation changes (#33429)
* apt_repository: PEP8 compliancy and documentation changes

This PR includes:
- PEP8 compliancy changes
- Documentation changes

* Fix merge issue
7 years ago
Dag Wieers c4ef5bb922
apt_key: PEP8 compliancy and documentation changes (#33427)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Dag Wieers 2416a8806d apt: PEP8 compliancy and documentation changes (#33425)
This PR includes:
- PEP compliancy changes
- Documentation changes
7 years ago
Ganesh Nalawade 11c9ad23d5
Refactor common network shared and platform utils code into package (#33452)
* Refactor common network shared and platform specific code into package (part-1)

As per proposal #76 refactor common network shared and platform specific
code into sub-package.
https://github.com/ansible/proposals/issues/76

*  ansible.module_utils.network.common - command shared functions
*  ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions

*  Fix review comments

* Fix review comments
7 years ago
Tim Rupp 18aca48075
Various errors and formatting fixes (#33503)
* Various errors and formatting fixes

Mostly formatting fixes and small changes to better support debugging

* Fixes upstream errors
7 years ago
Tim Rupp 9f544cf926
Adds traffic group and fixes (#33502)
Adds the traffic group param. Adds conventions for updated f5
standards
7 years ago
Tim Rupp 00bf4ee210
routedomain fixes (#33501)
* routedomain fixes

Adds partition. Adds name. Makes name and id mutually exclusive.

* Fixes upstream errors
7 years ago
Tim Rupp dd94cc8229
Various bigip_selfip fixes (#33500)
* Various bigip_selfip fixes

Minor optimizations. Fixes address regex

* Fixing upstream errors
7 years ago
Tim Rupp df86d8f39e
Fixes ordered dict import (#33499)
Make it try to fallback to a pypi package if its not found in what
ships with python
7 years ago
Tim Rupp 07c9c28a06
Fixes for unit tests (#33498)
upstream unit tests broke downstream code. this rectifies that.
7 years ago
Tim Rupp da2e20ef45
Fixes various http monitor things (#33497)
Added token cleanup. Refactored a small amount of code. formatting
and cleanup of code.
7 years ago
Tim Rupp 798de98b0c
Adds hostname to remote-syslog (#33496)
* Adds hostname to remote-syslog

Previously, only an IP address wa allowed. This removes that restriction

* Fixes upstream errors
7 years ago
Tim Rupp a4aa00f556
Various bigip_user fixes (#33495)
There was a bit of refactoring that happened for coding standards.
Additionally, a bug fix was made for changing the root password
7 years ago
Tim Rupp bcda0db7db
Fixes tcp monitors (#33494)
* Fixes tcp monitors

Formatting fixes and a missing default parent. This patch fixes
that.

* Fixes upstream errors
7 years ago
Tim Rupp 212340bf0c
Fixes bug converning filenames with dots (#33493)
The name detminator was incorrect. This fixes it and fixes unit
tests related things that were broken downstream
7 years ago
Tim Rupp 1f1f1c9d04
Refactors bigip_node (#33492)
* Refactors bigip_node

Includes a number of fixes and enhancements in addition to refactoring
the code to be inline with f5 standards

* Fixes upstream errors
7 years ago
Tim Rupp 4f8f99479a
Various bigip policy fixes (#33491)
Test fixes, formatting, and added a difference checking method
7 years ago
Tim Rupp 008e23dcd1
Refactors bigip_sys_db (#33490)
Bringing it up to speed with the other f5 modules.
7 years ago
Tim Rupp 277d416b5b
Refactors bigip_vlan (#33489)
This patch adds tests and refactors the code to be inline with current
f5 coding standards
7 years ago
Tim Rupp 914829f56b
Adds bigip_monitor_snmp_dca module (#33483)
This module is a flavor of monitor for SNMP DCA's
7 years ago
Tim Rupp a2f19fbded
Adds bigip_policy_rule module (#33482)
* Adds bigip_policy_rule module

This module is the second component of managing LTM policies on
BIG-IP. This module lets you manage the rules of a policy

* Fixing upstream errors

* Correcting YAML errors
7 years ago
Tim Rupp abca68f5ac
Adds the bigip_monitor_udp module (#33481)
This module can be used to manage UDP monitors on a BIG-IP
7 years ago
Tim Rupp e3419fce87
Fixes and features for bigip_provision (#33480)
* Fixes and features for bigip_provision

Adds support for dedicated modules. Fixes bug in minimum name.
Adds wrappers around checking for up-ness so that they will contribute
to the watch loop

* Fixes upstream errors
7 years ago
Tim Rupp 2b1f056881
Fixes bugs in iapp template (#33478)
Fixes upstream bugs that broke downstream. Also fixes a name
matching error in the iApp's name
7 years ago
Tim Rupp f60b8a3abb
Fixes various things in bigip tests (#33477)
an upstream change was introduced that broke downstream code. This
path rectifies that error
7 years ago
Tim Rupp 1c373c112f
Minor fixes for gtm facts (#33476)
Removed unused code and fixed upstream changes that broke downstream
7 years ago
Tim Rupp e1062d1a7b
Refactors the gtm datacenter module (#33474)
* Refactors the gtm datacenter module

This module needed to be inline with current f5 coding standards.
This fixes that

* Fixes upstream errors
7 years ago
Tim Rupp 76135a500e
Refactors bigip device sshd (#33473)
* Refactors bigip device sshd

Fixes coding conventions for currect f5 conventions

* Fixes upstream errors
7 years ago
Tim Rupp a3b3dbe220
Refactors bigip_device_ntp (#33472)
* Refactors bigip_device_ntp

To be inline with current f5 conventions

* Fixed incorrect key
7 years ago
Tim Rupp 929a1df91d
Adds fixes to various bigip tests (#33471)
upstream changes broke downstream code. this rectifies that
7 years ago
Tim Rupp f6be12b5d8
Adds various fixes for bigip_config tests (#33470)
There were upstream changes that were incompatible with the downstream
code. This fixes those.
7 years ago
Samer Deeb 717b6e7c1a Add mlnxos_config module (#33356)
* Add new module mlnxos_config

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* Add unit-test for mlnxos_config module

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Abhijeet Kasurde addb882138 VMware: make name and folder required parameter (#33135)
This fix makes name and folder as required together
parameters in vmware_guest_snapshot.
Update integration tests for vmware_guest_snapshot.

Fixes: #22644

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde e4254da1b1
Add esxi_hostname as argument in vmware_vswitch (#30498)
Fix adds esxi_hostname as Ansible module argument for user
to define ESXi hostname to deploy VMware vSwitch.

Fixes: #24647

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Dag Wieers 5b5d767c0b apt_rpm: PEP8 compliancy and documentation changes (#33431)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Tim Rupp 5fa25a0288
Adds fixes to bigip_asm_policy (#33440)
Integrates some upstream changes that were made and fixes several
spacing and testing errors
7 years ago
Toshio Kuratomi 7bd0af15d2
Enhance empty __init__ code-smell to check module_utils (#33438)
Empty __init__ will allow us to use python namespaces with all of these
files.  That may be something we want to take advantage of for allowign
them to be expanded by user dirs.  Also might be needed for AnsiballZ or
other wrapper enhancements in the future.
7 years ago
Toshio Kuratomi e499bccbaa
Port some tests away from nose as examples (#33437)
We don't need to use both nose and pytest.  Once we get rid of all uses
of nose we can remove the extra dependency
7 years ago
R. Francis Smith e957760d52 updated pamd rule args regexp to match file paths also (#33432)
* Added . and / to rule args regexp

Things like pam_echo.so file=/etc/foo.txt weren't being matched and
causing incorrect change counts.  Adding / and . fixed that.

Fixes #33351

* pamd: test argument with value

Relates #33351
7 years ago
Dag Wieers e0c94aa6a7 yum: PEP8 compliancy and documentation changes (#33424)
This PR includes:
- PEP8 compliancy changes
- documentation changes
7 years ago
Ganesh Nalawade 35acae7ea7
Fix eos integration test failure (#33407)
Fixes #33406
Fixes #33405

*  Fix typo in network_cli for sendonly
*  Send `abort` to remote device in case configuration fails
*  Fix indentation issue in eos_static_route integration test

*  Revert network_cli change
7 years ago
Abhijeet Kasurde 1ca7929f96 VMware: Add support for numCoresPerSocket (#33149)
This fix adds support for hardware parameter 'numCoresPerSocket'
in vmware_guest module. Also, adds integration tests for this change.

Fixes: #20406

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Abhijeet Kasurde 7209b7f060
VMware: Add integration test for vmware facts (#33404)
This fix adds integration tests for vmware_guest_facts.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 1b31e34d7c
Remove provider from iosxr user tests (#33394) 7 years ago
Anil Kumar Muraleedharan bada3afee9 Adding module enos_config and its UT files (#33081)
* Adding module enos_config and its UT files

* Removing trailing line

* Removing trailing lines

* Editing enos_module.py to fix build errors

* Removing blank lines in end

* Updating enos_config.py based on review comments

* Adding one more blank line

* Removing training white space

* Removing test_enos_config_force method from UT

* Updating documentation

* Comments by John, Remove version_added: "2.5"
7 years ago
Toshio Kuratomi aa7bd8bc11 Port AnsibleModule deprecate and warning tests to pytest (#33162) 7 years ago
Nathaniel Case a1da3dc997
Auth to become (#33319)
* terminal.on_(de)?authorize -> terminal.on_(un)?become

* Update network_cli

* Readd on_(de)?authorize as wrappers

* Update tests
7 years ago
Matt Martz 3a2c1541ca
Fix tests as filters syntax in recently modified integration tests (#33346) 7 years ago
Martin Krizek 0592fd47bc selinux: check if policy exists before switching (#31834)
* selinux: check if policy exists before switching

* Check the policy dir
7 years ago
George Nikolopoulos 34f965addd New module: Issue NITRO requests to a Netscaler instance (network/netscaler/netscaler_nitro_request) (#33091)
* Add netscaler_nitro_request module

* Make changes as requested.

* Fix whitepsace in EXAMPLES block.

* Set module changed status according to operation performed.
7 years ago
Alex Monteiro 2114278947 DatacenterFactsModule for HPE OneView (#32701)
* Added support to Datacenter resources in HPE OneView

* Adjusting comments in oneview_datacenter_facts

* Adding no_log on the documentation

* Using Pytest to Oneview DatacenterFactsModule tests
7 years ago
Kedar K 717193b67f
Fix integration test failures due to wrong files paths to ficture and (#33329)
missing ssh port
7 years ago
Yanis Guenane a773bd7ad5 openssl_publickey: Ensure format OpenSSH is idempotent (#33264)
Currently the check() method for idempotence only assumes the public
key is under the form of a PEM file when its not always the case.

The module openssl_publickey allows one to generate OpenSSH format
publickey. This leads to idempotence not being detected.
7 years ago
Vincent Bernat e65001ee22 cloudstack: fix spelling of "affinity_type" (#33231)
The previous spelling, "affinty_type" is marked as deprecated and will
be removed in Ansible 2.9. Both spelling are mutually exclusives.
7 years ago
Trishna Guha 819f9ee8fa Add port arg to establish ssh connection in nxos_file_copy (#33304)
* Add port arg to establish ssh connection in nxos_file_copy

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

* resolve kedar's comment
7 years ago
Jordan Borean 8386201242 add deprecation for stat get_md5 (#33002) 7 years ago
Matt Martz 4fe08441be Deprecate tests used as filters (#32361)
* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
7 years ago
Samer Deeb cbf28c20cb Add Support for Mellanox switches: first module: mlnxos_command (#33121)
* Add Support for Mellanox switches: first module: mlnxos_command

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* Add cliconf support for mlnxos

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* 1- Fix short description, 2- remove waitfor

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* remove usage of check_args

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Trishna Guha 25a465ffcb
loopback doesn't support passive_interface (#33252)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Martin Krizek 3a2a1e054f Fix include in loop when stategy=free (#33094) 7 years ago
René Moser 1a546711e1
cs_vpc: add new argument clean_up (#33278)
* cs_vpc: add new argument clean_up

* docs cleanup
* extend tests and increase coverage

* change default for clean_up to None

* extend tests
7 years ago
René Moser 1f9e84fdd4
cs_serviceoffer: remove unused code and improve test coverage (#33276) 7 years ago
Yanis Guenane 32635577a3 openssl_publickey: Do not fail on empty existing file (#33255)
Currently during the check phase, the code considers the file to be
a public key if the file exist - which is not necessarily true.

This commits aims to ensure that the file is actually a publickey else
returns false for the check.
7 years ago
Ken Celenza 748107d369 Type manipulation (#28446)
* add type manipulation

* update for py3

* add tests for list to dict

* Add dict to list tests

* Update tests to search for regex in response

* pep8 clean up

* update Exception for py3

* update test to be py2/3 compat

* update for py26 compat

* potential fix for py3 and py26

* potential fix for py3 and py26 take2

* add new line to kick off shippable

* remove cache file created

* fix filter name

* add space for shipable
7 years ago
Ganesh Nalawade 3d63ecb6f3
Refactor junos modules to Use netconf and cliconf plugins (#32621)
* Fix junos integration test fixes as per connection refactor (#33050)

Refactor netconf connection plugin to work with netconf plugin

* Fix junos integration test fixes as per connection refactor (#33050)

Refactor netconf connection plugin to work with netconf plugin
Fix CI failure
Fix unit test failure
Fix review comments
7 years ago
Matt Clay 2ece86fba1 Split up cloud tests to avoid 1 hour CI limit. 7 years ago
René Moser 7adf91997d
cloudstack: new module cs_serviceoffer (#33060) 7 years ago
Yuwei Zhou e4194b20db Azure create virtual machine with an Availability Set associate (#32535)
* add availability set for vm

* add test

* add import

* fix

* add test assert and output

* fix lint and version added

* add null check

* fix mirror

* fix mirror
7 years ago
Matt Clay b865ddedac Change the default ansible-test docker image. 7 years ago
Matt Clay 633119df75 Disable flakey `win_msg` integration test. 7 years ago
James Cammarata d8ae4dfbf2 Adding aliases for field attributes and renaming async attribute (#33141)
* Adding aliases for field attributes and renaming async attribute

As of Python 3.7, the use of async raises an error, whereas before the use
of the reserved word was ignored. This adds an alias field for field attrs
so that both async and async_val (interally) work. This allows us to be
backwards-compatible with 3rd party plugins that may still reference Task.async,
but for the core engine to work on Py3.7+.

* Remove files fixed for 'async' usage from the python 3.7 skip list
7 years ago
Matt Clay 1ee511f82c Use an abspath for network inventory ssh key path. 7 years ago
Matt Clay 3a6fad38fa Update vyos completion in network.txt. 7 years ago
Matt Clay 887f227994 Use vyos/1.1.8 in CI. 7 years ago
jctanner 218987eac1
ANSIBLE_SSH_USETTY configuration option (#33148)
* Allow the user to circumvent adding -tt on ssh commands to help aid in
debugging ssh related problems.
* Move config to the plugin
* Set version_added
* Change yaml section to "connection"
* Fix ssh unit tests
7 years ago
Gaudenz Steinlin 4c94c6f9ba cloudscale_server: add timeout param and increase default timeout (#33088)
* Improve error message in cloudscale_server module

Fix punctuation and add the full contents of "info" to the output in
case of failed API calls. This is useful in case of connection timeouts
and other error conditions where there is no response body available.

* Increase timeouts in cloudscale_server module

Increase the timeouts to not fail in case the API calls take a bit
longer than usual. The default timeout of fetch_url is 10s which is
quite short. Increase it to 30s. The timeout for waiting for a server
change is increased as well as it calls the API in a loop. Therefore
this value should be larger than the API timeout.

* Send API parameters as JSON in cloudscale_server module

Use JSON to send the POST data to the API instead of an urlencoded
string. Urlencoding is not really a good match for some Python
datatypes.

This fixes an issue when submitting a list of SSH keys which did not get
translated properly.

* Fix typo in cloudscale_server documentation

* cloudscale_sever: Replace timeout const by api_timeout param

Replace the static TIMEOUT_API constant by a user configurable
api_timeout parameter. Also eliminate the TIMEOUT_WAIT constant by
2*api_timeout. This means that the timeout to wait for server changes is
always double the timeout for API calls.

* Use Debian 9 image for cloudscale_server tests
7 years ago
Matt Clay c6bb6c72cc Fix anomalous backslashes and enable pylint test. 7 years ago
Yuwei Zhou b6c401ccc8 Fixes #30863: support update source_address_prefix in azure_rm_securitygroup (#32614)
* compare source address prefix

* remove useless quote
7 years ago
Matt Clay 6f4731ef11 Force all tests to run on docker image updates. 7 years ago
Jordan Borean 0962a0d816 win_updates: removed scheduled task to use become instead (#33118)
* win_updates: removed scheduled task to use become instead

* updated docs to remove scheduled task info

* fix issue with only installing last update in group
7 years ago
Brian Coca ebd08d2a01 jsonify inventory (#32990)
* jsonify inventory
* smarter import, dont pass kwargs where not needed
* added datetime
* Eventual plan for json utilities to migrate to common/json_utils when we split
  basic.py no need to move jsonify to another file now as we'll do that later.
* json_dict_bytes_to_unicode and json_dict_unicode_to_bytes will also
  change names and move to common/text.py at that time (not to json).
  Their purpose is to recursively change the elements of a container
  (dict, list, set, tuple) into text or bytes, not to json encode or
  decode (they could be a generic precursor to that but are not limited
  to that.)
* Reimplement the private _SetEncoder which changes sets and datetimes
  into objects that are json serializable into a private function
  instead.  Functions are more flexible, less overhead, and simpler than
  an object.
* Remove code that handled simplejson-1.5.x and earlier.  Raise an error
  if that's the case instead.
  * We require python-2.6 or better which has the json module builtin to
    the stdlib.  So this is only an issue if the stdlib json has been
    overridden by a third party module and the simplejson on the system
    is 1.5.x or less.  (1.5 was released on 2007-01-18)
7 years ago
Matt Clay 07bb7684b0 Add PS dependency analysis to ansible-test. 7 years ago
Matt Clay e45c763b64 Fix invalid string escape sequences. 7 years ago
Matt Clay f9cd50411f Enable Python 3.7 in ansible-test. 7 years ago
Ricardo Carrillo Cruz be7a3adeb7
Fix ovs integration tests initial setup (#33136) 7 years ago
Ricardo Carrillo Cruz de1bfde2d8
Add very basic openvswitch_bridge integration test (#33134)
More to come on this module.
7 years ago
Abhijeet Kasurde fbe946719e
VMware: Add fix for setting manual MAC address (#32885)
This fix adds ability to set MAC address maunally. Before adding
any MAC address, the value is validated. If value is not valid, then
MAC address is set to vCenter generated MAC address.
Also, added integration tests for this change.

Fixes: #21161

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Martin Krizek 3c1fb9b547
Use custom rpm repo script for dnf testing (#32737)
* Use custom rpm repo script for dnf testing

* Switch to a jinja2 test
7 years ago
Ganesh Nalawade 0ddf092ae3
Add new filter to parse xml output for network use cases (#31562)
* Add new filter to parse xml output for network use cases

Fixes #31026
*  Add parse_xml filter
*  Add documentation for parse_xml filter

* Edited for clarity.

* Fix review comment and add unit tests

* Fix unit test CI failure

* Fix CI issues

* Fix unit test failures

* Fix review comments

* More copy edits.
7 years ago
Matt Clay 5f5e150771 Limit paramiko to < 2.4.0 for python 2.6. 7 years ago
Corban Johnson d9a52db17d Adding RPC attribute parameters to junos_rpc network module (#32649)
* Adding RPC attribute arguments to `junos_rpc` network module.

* Specifying module argument version.

* Fixing DOCUMENTATION block.

* First attempt at new test fixture.

* Updated RPC_CLI_MAP.

* Use `result` instead of `reply`.
7 years ago
Steve Jacobs 400d821fdb Added eagerzeroedthick disk option to disk spec for vmware_guest (#28121)
* Added eagerzeroedthick disk option to disk spec
* Updated docstrings for vmware_guest disk
* VMware: Integration test for disk type

Signed-off-by: Steve Jacobs <sjacobs@brokencrew.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Matt Clay 677aca1cc7 Add Python 3.7-dev to the default docker image. 7 years ago
Will Thames 0b128e2e29 Add tests for ec2_vpc_route_table (#32036)
* Add tests for ec2_vpc_route_table

Initial tests for ec2_vpc_route_table ready for boto3 porting

* Turn AWS connection information into a YAML block
7 years ago
Mike Wiebe 95a2140f4b Use show command to support wider platform set for nxos_interface module (#33037)
* Use show command to support wider platform set

* Fix unit tests
7 years ago
Arnaud 84117e57ba nxos: 32 bits AS in as-dot format not recognized by regexp asn_regex (#30569)
* added test for 32 bits AS

* Lint not happy.
7 years ago
Philippe Dellaert 0324d5e850 Updating parameter to match vmware_portgroup parameter (#33059) 7 years ago
Tim Rightnour 5962337332 Add additional facts to the fact gathering of vmware (#31632)
Adds facts about datastores, esxi_host, vm files, ha state, question, is_template, consolidation status and hw_files. Also, adds integration tests for vmware fact enhancement.
7 years ago
Ganesh Nalawade ce04f6e961
Fix junos integration test fixes as per connection refactor (#33050) 7 years ago
Matt Clay 781219bcfd Fix and re-enable zypper* integration tests in CI. 7 years ago
Matt Clay 2ef438c962 Improve zypper refresh/clean for opensuse images. 7 years ago
Dag Wieers b3e4a88b90 consul_session: PEP8 compliancy and documentation changes (#33000)
THis PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Tim Rupp c94d57311c
Adds bigip_vcmp_guest module (#33024)
This module can be used to manage guests on a vCMP provisioned BIG-IP.
vCMP is a hardware-only feature, therefore this module cannot be used
on the VE editions of BIG-IP.
7 years ago
Dag Wieers 5f36932adf pacemaker_cluster: PEP8 compliancy and doc changes (#33001)
This PR includes:
- PEP8 compliancy changes
- DOcumentation changes
7 years ago
René Moser a314faae0e
cs_firewall: use list type for cidr (#33020) 7 years ago
Pilou a5c9726502 Unit tests: share common code (#31456)
* move set_module_args to units.modules.utils
* unit tests: reuse set_module_args
* unit tests: mock exit/fail_json in module.utils.ModuleTestCase
* unit tests: use module.utils.ModuleTestCase
* unit tests: fix 'import shadowed by loop variable'
7 years ago
Jacob McGill 5747bf34d1 Network ACI: Add integration tests for several module (#33016) 7 years ago
Jordan Borean 8c5ee3461e win_stat: simplified tests before next change (#32996) 7 years ago
Daniel Shepherd cfbe9c8aee [cloud] Add IPv6 support for ec2_vpc_subnet module(#30444)
* Add integration test suite for ec2_vpc_subnet

* wrap boto3 connection in try/except

update module documentation and add RETURN docs

add IPv6 support to VPC subnet module

rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive

DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed

add wait and timeout for subnet creation process

fixup the ipv6 cidr disassociation logic a bit per review

update RETURN values per review

added module parameter check

removed DryRun parameter from boto3 call since it would always be false here

fix subnet wait loop

add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func

fix tags type error per review

remove **kwargs use in create_subnet function per review

* rebased on #31870, fixed merge conflicts, and updated error messages

* fixes to pass tests

* add test for failure on invalid ipv6 block and update tags test for purge_tags=true function

* fix pylint issue

* fix exception handling error when run with python3

* add ipv6 tests and fix module code

* Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets

* fix type in tests and update assert conditional to check entire returned value

* add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI

* remove key and value options from call to boto3_tag_list_to_ansible_dict

* remove wait loop and use boto3 EC2 waiter

* remove unused register: result vars

* revert az argument default value to original setting default=None
7 years ago
Brian Coca 23b1dbacaf
Config continued (#31024)
* included inventory and callback in new config

allow inventory to be configurable
updated connection options settings
also updated winrm to work with new configs
removed now obsolete set_host_overrides
added notes for future bcoca, current one is just punting, it's future's problem
updated docs per feedback
added remove group/host methods to inv data
moved fact cache from data to constructed
cleaner/better options
fix when vars are added
extended ignore list to config dicts
updated paramiko connection docs
removed options from base that paramiko already handles
left the look option as it is used by other plugin types
resolve delegation
updated cache doc options
fixed test_script
better fragment merge for options
fixed proxy command
restore ini for proxy
normalized options
moved pipelining to class
updates for host_key_checking
restructured mixins

* fix typo
7 years ago
Will Thames 46c4f6311a [cloud] Add retries/backoff to ec2_vpc_subnet module (#31870)
* Allow backoff for describe_subnets

Improve exception handling to latest standards

* Add integration test suite for ec2_vpc_subnet

* Add test for creating subnet without AZ

Fix bug identified by test

Fixes #31905
7 years ago
Will Thames 60b29cf57d [cloud] Follow up on FIXMEs in ec2_ami & ec2_ami tests (#32337)
* Several tests were marked as FIXME and should have been fixed with
the boto3 move.

* Improved tags output. Add purge_tags option (default: no)

* Allow description and tags update

* Return launch_permissions

* Allow empty launch permissions for image creation

* Empty launch permissions should work the same way for image
creation as no launch permissions

* Cope with ephemeral devices in AMI block device mapping

* Ephemeral devices can appear in AMI block devices, and this information should be returned

* Fix notation for creating sets from comprehensions
7 years ago
saichint aef50eaa40 Integration Tests only: nxos_udld, nxos_udld_interface, nxos_vxlan_vtep_vni (#29143)
* it cases for vxlan_vtep_vni, udld

* platform specific testing

* fix vxlan_vtep for n7k

* fix udld_intf setup

* skip udld tests on titanium n7k

* remove hardcoding

* fix udld tests for titanium
7 years ago
Ganesh Nalawade ba0aade8f4
Fix ios_config integration test failures (#32959) 7 years ago
Abhijeet Kasurde e61bcc3438
Provide clear error message after failure (#32928) 7 years ago
Abhijeet Kasurde 2d4c4e09db
Add vmware fact about 'Cores Per Socket' (#32881)
This fix adds new fact - 'Cores Per Socket' about vmware guest machine.
Also, adds integration test for this change.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Mike Wiebe 208208ab8f Fix nxos_snmp_host bug (#32916)
* Fix nxos_snmp_host bug

* Enable nxos_snmp_host tests
7 years ago
Tim Rupp 3f3c526026
Removes deprecated "append" param from snat pool (#32953)
This param was deprecated in 2.4 and slated for removal in 2.5. This
patch removes it.
7 years ago
Tim Rupp 0c1f493b6c
Adds module for managing bigip device connectivity (#32950)
This module is a critical part of the HA process for BIG-IPs.
7 years ago
Jordan Borean 1bc4940ee1
added powershell symlink util helper (#27153)
* Added symbolic link util for powershell

* updated module_util license to BSD
7 years ago
Jordan Borean e16e6313c7 windows: fix for checking locked system files (#30665)
* fix for checking locked system files

* moved functions to share module util and created tests

* fixed windows-paths test based on win_stat changes
7 years ago
Jordan Borean 5e20fd0943 removed psobject to hashtables that were missed (#32710)
* removed psobject to hashtables that were missed

* fix up win_region change
7 years ago
Matt Clay ef21038dd5 Fix ansible-test race calling get_coverage_path. 7 years ago
Dag Wieers 3089892e59 sl_vm: PEP8 compliancy and documentation changes (#32657)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
7 years ago
Adrian Likins 86dc3c09ac
Fix vault --ask-vault-pass with no tty (#31493)
* Fix vault --ask-vault-pass with no tty

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

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

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

        ERROR! Attempting to decrypt but no vault secrets found

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

* up test_prompt_no_tty to expect prompt with no tty

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

* Fix logic for when to auto-prompt vault pass

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

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

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

Fixes #30993
7 years ago
Pavel c56dcb7afa module_utils: vmware.py. Incorrect chain of attributes to obtain snapshots from virtual machine (#32669)
* Update vmware.py
Incorrect chain of attributes to obtain snapshots from virtual machine. Module 'vmware_guest_facts' uses method 'gather_vm_facts' of vmware.py and always gets empty list of snapshots.
* Added test for module vmware_guest_facts. Checked VM snapshots.
* Fixed tests for vmware_guest_facts. Ignored certificate for vmware_guest_snapshot module.
7 years ago
Sebastiaan van Doesselaar 900abcddb3 Integrated publickey import and removal in iosxr_user (#32115)
* Integrated publickey import and removal in iosxr_user

* Fixed linting issues

* Added version added for publickeyfile option

* Added quotation marks to version, oops

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

* Added some integration test files

* Created mutually exclusive public_key and public_key_contents versions of config

* Modified tests to use both methods and test more logins

* Added supports for aggregates

* Incorporated provider auth

* Fixed some lint issues

* Fixed a YAML lint issue

* Implemented catches for unconfigured providers.

* Fixed catches, hopefully

* Another test

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

* Trailing whitespace
7 years ago
Prasad Katti 239464f804 ec2_key: add a test for the force option (#32748)
* ec2_key: test force option

* ec2_key: changes requested via review comments
7 years ago
Matt Clay 6472723ba8
Add missing ansible-test --remote-terminate support. (#32918)
* Expand ansible-test --remote-terminate support:

- windows-integration
- network-integration

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

* Terminate windows and network instances when done.
7 years ago
Gawain fa764f6918 New Module vmware_host_facts (#26492)
Add new module  vmware_host_facts ,it can get remote vmware host system info like setup module

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

* Changing Author Name and removing 2 blank lines

* Removing blank lines

* Adding enos_config and its UT files

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

* Work on Ganesh's Review comments

* John Review Comments on enos_command.py

* Review comments of John
7 years ago