Commit graph

4551 commits

Author SHA1 Message Date
David Newswanger
69cd705634
Add vyos smoke integration tests. (#35456)
* added preliminary vyos smoke tests

* added comments, determined current tests are sufficient

* add tests for check mode in module_utils.network.vyos

* removed vyos_smoke from shippable

* added comment explaining why AWS/Shippable tests won't work
2018-02-02 16:04:19 -05:00
Sloane Hertel
7917e3c988
Fix syntax error so route table tests always try to clean up (#35663)
* Always try to clean up after route table tests

* Wait for a new VPC a chance to become available before attempting to get its current state
2018-02-02 15:38:47 -05:00
Pierre-Louis Bonicoli
2646ea9b86 yum_repository: Python 3.7 error have been fixed
See 232dc7110c
2018-02-02 09:43:58 -08:00
Pilou
d608eb9530 Check that AnsibleUndefinedVariable doesn't occur when an unused variable references an undefined variable (#35571)
* Check that AnsibleUndefinedVariable doesn't occur

* AnsibleUndefinedVariable exc.: don't modify type
2018-02-02 09:25:13 -08:00
Martin Krizek
c3199dca6c
Add any_errors_fatal in nested failed block test (#35499) 2018-02-02 16:25:55 +01:00
Nathaniel Case
f3337e1fba
ios test changes (#35510)
* Fix over-byte

* Update ios tests to call `provider`

To continue to support testing `connection: local`

* Fix command dict handling in ios_user

* Clean up unit tests, too
2018-02-02 09:50:15 -05:00
Trishna Guha
dc4a41a4af change testfiles for nxos_file_copy (#35641)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-02 12:54:53 +00:00
James Mighion
f04d40640e Fixing name from aruba to ios. (#35630) 2018-02-02 09:57:49 +05:30
Will Thames
b5a1643e3d Add new aws_waf_condition module (#33110) 2018-02-01 18:16:27 -05:00
Sam Doran
f8f2b6d61d
Fix lineinfile to insert line when pattern exists elsewhere in the file. (#33393)
* Insert lines before or after when the regexp exists elsewhere in the file

* Correct filter syntax in lineinfile integration test

* Use multi-line YAML syntax on lineinfile tests

Unify indentation

* Add lineinfile tests for same line matched to different regexps

* Remove debug statement from test
2018-02-01 16:45:26 -05:00
Toshio Kuratomi
4a48fdba1d
Update code smell blacklists (#35621)
Update blacklist for get_exception, boilerplate, and no-wildcard.

f5, lenovo, and junos have updated their code.
2018-02-01 12:24:07 -08:00
Artem Zinenko
b9571eb4bf Integration tests for rabbitmq_user module (#35421) 2018-02-01 10:25:04 -08:00
Matt Clay
b9c5147be2
Move import sanity test files into own directory. (#35593) 2018-02-01 09:52:31 -08:00
Kedar Kekan
684e953b50 * adds commit replace with config file for iosxr (#35564)
* * adds commit replace with config file for iosxr
* fixes dci failure in iosxr_logging

* * review comment changes
2018-02-01 14:15:32 +00:00
Matt Clay
ea70b49b11 Fix pip integration test. 2018-01-31 23:26:16 -08:00
Zim Kalinowski
fef684d457 fixing mysql and postgresql test failures (#35587) 2018-02-01 17:00:05 +10:00
Dag Wieers
12b8b8dcf2
aci_aaa_user: Manage AAA users on ACI fabrics (#35543)
* aci_aaa_user: Manage AAA users on ACI fabrics

* Fix module documentation

* Ensure we allow to not set accountStatus and expires

* Added aaa_password_lifetime and aaa_password_update_required support

* Improvements to integration tests in light of issue 35544

* Fix ACI ISO 8601 formatted string

* Add HAS_DATEUTIL
2018-02-01 00:45:32 +01:00
Toshio Kuratomi
e8cfe05e37 Test behaviour of loop keyword plus lookup plugins
We introduced the new loop keyword as a replacement for with without
adding tests that it behaved as we expected.  This test asserts that
behaviour.

Incidentally, it also shows how to use parameters with lookups and loops
now.
2018-01-31 13:55:49 -08:00
Alicia Cozine
adf76b7d3f
Reflect new process for network integration tests (#35577)
With `ansible-test network-integration` we don't need the top level yaml files
except NXOS and Dell (for now)
2018-01-31 14:56:28 -06:00
Sloane Hertel
556bb7ab00 [cloud] Log more exception info to fix sts_assume_role integration tests (#35570) 2018-01-31 13:18:09 -05:00
John R Barker
9728857e01
Remove network-test-runner (#35556)
Not been used for a while, replaced by DCI
2018-01-31 16:27:52 +00:00
Matt Clay
2d565d14ed Add pslint sanity test settings.
Globally ignore rule: PSUseShouldProcessForStateChangingFunctions
2018-01-31 06:31:05 -08:00
kiorky
9001a8794f FIX: multiple nested tasks include levels (#35165)
* Test for include_tasks & include_role bug

Related to ansible/ansible:#21890

* Fix nested include_tasks called from role

This fixes the path of included files when you want
to call include_task inside a role's task file and this
role is itself called from multiple level of playbook include_tasks

Related to ansible/ansible:#21890
This fixes ansible/ansible:#35109
2018-01-31 07:35:06 -06:00
Kim Blomqvist
63639abb01 [cloud] Improve ipv6 and EC2 classic support in ec2_group integration tests (#32976)
* ec2_group: fix ipv6 tests to use an explicit VPC

* otherwise would fail on old AWS accounts supporting EC2-classic

* ec2_group: fix tests to use an explicit VPC

* Only run some tests if there is a default vpc associated with the account
2018-01-31 08:00:54 -05:00
saichint
dc35baa8db fix nxos_pim_interface issues (#35405)
* fix nxos_pim_interface issues

* add absent test for pim_interface
2018-01-31 10:51:11 +05:30
Jordan Borean
62b87bc925
change .encode to to_bytes (#35522)
ignore backup dir in test integration targets folder
2018-01-31 08:58:03 +10:00
Clement Trebuchet
287f3a609e Fixes #35468: ADD max_results to the nios api (#35473)
* Fixes #35468: ADD max_results to the nios api

* Fixes #35468: fix nios unittest

* Fixes #35468: document the module docs fragments for nios
2018-01-30 22:21:45 +00:00
Matt Martz
c282e4e00f
Replace LooseVersion comparison with int/float comparison. Fixes #35435 (#35519) 2018-01-30 15:27:22 -06:00
Harri Tuominen
234a877ea5 Netact cm command2 (#34873) 2018-01-30 19:00:29 +00:00
Matt Martz
f659cc5963
Guard against assignments that are not ast.Name in docs parsing (#35513) 2018-01-30 12:56:16 -06:00
Ganesh Nalawade
ef34eb1a7d
Fix junos integration test failures (#35508)
* More integration testcase fixes for junos_facts
2018-01-31 00:07:01 +05:30
Adam Miller
6cc5e4c9df
galaxy remove incorrect check for role path before extraction (#35259)
* galaxy remove incorrect check for role path before extraction

Fixes #35217

Currently lib/ansible/galaxy/role.py checks roles_path and will
ignore paths that don't currently exist which it should not because
the path will attempt to be created by the role extraction process
(which is valid and expected behavior) and if unable to write at the
time of role extraction into the role_path, that error will be
handled properly at that point in the process.

Signed-off-by: Adam Miller <admiller@redhat.com>

* add test case for galaxy install with rolefile and rolepath

Verify we don't regress GitHub Issue #35217

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix the integration test

Signed-off-by: Adam Miller <admiller@redhat.com>

* double quote for shellcheck glob warning

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix galaxy install tests to not need remote resources

Signed-off-by: Adam Miller <admiller@redhat.com>

* make shellcheck sanity tests happy

Signed-off-by: Adam Miller <admiller@redhat.com>

* prep git global conf for running the galaxy install tests in docker

Signed-off-by: Adam Miller <admiller@redhat.com>

* move ansible-galaxy tests into their own target, make git conf non-global

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix up tests based on feedback

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove extra newline from aliases file

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-01-30 10:40:25 -06:00
Nathaniel Case
4a79112e5c
Fix ios_facts return values (#35239)
* Revert model and serialnum to older version

* Add stacked versions of model and serialnum as separate facts

* Add unit test to check stacked output

* Alter model regex to address #34768
2018-01-30 11:17:14 -05:00
John R Barker
a23c95023b
Module deprecation: docs, scheme and tests (#34100)
Enforce module deprecation.
After module has reached the end of it's deprecation cycle we will replace it with a docs stub.

* Replace deprecated modules with docs-only sub
* Use of deprecated past deprecation cycle gives meaningful message (see examples below)
* Enforce documentation.deprecation dict via `schema.py`
* Update `ansible-doc` and web docs to display documentation.deprecation
* Document that structure in `dev_guide`
* Ensure that all modules starting with `_` have a `deprecation:` block
* Ensure `deprecation:` block is only used on modules that start with `_`
* `removed_in` A string which represents when this module needs **deleting**
* CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives
* CHANGELOG.md links to porting guide index

To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain:
```python
if __name__ == '__main__':
    removed_module()
```
2018-01-30 12:23:52 +00:00
Martin Krizek
7c83f006c0
Fix triggering parent's always with run_once set (#35464) 2018-01-30 13:16:19 +01:00
Matt Clay
359ff19484 Temporarily disable influxdb_user test.
The test interferes with the `uri` test.
2018-01-29 18:22:04 -08:00
Matt Clay
3b0dcf7f29 Test Windows 2012+ using Azure by default. 2018-01-29 17:17:06 -08:00
Stephen Granger
7fa09390b0 Elasticbeanstalk app (#31079)
* New AWS elasticbeanstalk app module

* Integration tests for elasticbeanstalk_app
2018-01-29 18:38:32 -05:00
Matt Clay
10f3a47eab Use static password for win_owner test. (#35482)
This will provide consistent results across test runs and
should avoid previously seen issues with password complexity
failures.
2018-01-30 09:04:40 +10:00
Abhijeet Kasurde
becb31f34c nmcli: Allow setting ipv4.dhcp-client-id parameter (#34268)
Signed-off-by: Orion Poplawski <orion@cora.nwra.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-29 17:02:46 -06:00
Matt Clay
e98e757ec4 Fix win_regedit module and tests. (#35478) 2018-01-30 07:57:03 +10:00
Jordan Borean
4da19f2d6b Added code-smell check to verify filenames are allowed with Windows (#35436) 2018-01-29 13:46:02 -08:00
Adrian Likins
b20ba105c2 intg tests for 'any_errors_fatal' (#25813)
* start adding intg tests for any_errors_fatal

* updates

* show captured output

flip conditional for on_includes

* cleanup/ci poke

* fix typos

* Add 'EXPECTED FAILURE' to tasks names for expected failures
2018-01-29 15:47:13 -05:00
Ed Costello
d16bc1c3f4 New aws_ses_identity module to manage AWS Simple Email Service Identity (#31140)
* Add aws_ses_identity module

* Update CI alias, add BotoCoreError exception handling.

* Add SES and SNS permissions to hacking/aws_config to run aws_ses_identity integration tests
2018-01-29 15:35:49 -05:00
Ganesh Nalawade
bbdddffa1e
Fix junos_facts integration test failure (#35469)
Hostname is not always configured on remote host
Instead add a assert statement to check if netconf
is configured for junos_facts.
2018-01-29 23:35:43 +05:30
Jean-Philippe Evrard
5f1254697d New module etcd3 (#35053)
This module uses etcd3 python library to do k/v manipulation on
an etcd3 cluster using version3 api.
2018-01-29 11:49:30 +01:00
Abhijeet Kasurde
aa736c6944
VMware: add new module: vmware_host_acceptance (#35040)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-29 14:30:57 +05:30
Abhijeet Kasurde
aac6d282e5
VMware: Add new module - vmware_vm_vm_drs_rule (#34177)
This adds a new module called vmware_vm_vm_drs_rule. This module add
affinity/antiaffinity rule for VM-VM in given cluster.

Fixes: #32109

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-29 09:36:57 +05:30
Abhijeet Kasurde
8549482482
VMware: add new module: vmware_host_package_facts (#35036)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-29 09:21:34 +05:30
Jordan Borean
9ee079f34d
further fixes to rename only where required (#35432) 2018-01-29 07:02:31 +10:00
Jordan Borean
d902bd39a3
renamed test file to allow checkouts on Windows (#35430)
* renamed test file to allow checkouts on Windows

* used different name pattern to fix sanity issues
2018-01-29 06:22:05 +10:00
Abhijeet Kasurde
857d0fd62e
VMware: add new module: vmware_host_vmnic_facts (#34984)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-28 21:34:45 +05:30
Peter Sprygada
c2d3b9cbd5
refactors nios api shared code to handle provider better (#35393)
* refactors nios api shared code to handle provider better

This change refactors the shared code to be easily shared between
modules, plugins and dynamic inventory scripts.  All parts now implement
the provider arguments uniformly.

This also provides a centralized fix to suppress urllib3 warnings coming
from the requests library implemented by infoblox_client

* fix up pep8 errors

* fix missing var name
2018-01-27 08:03:06 -05:00
Artem Zinenko
1f1402ea68 Integration tests for influxdb_user module (#35315)
* Added integration tests for influxdb_user
* Tests for idempotency checking and check mode
2018-01-27 18:24:34 +05:30
Pilou
47d8d8c36e Fix yum integration tests (#35177)
* use tests instead of filters

* Don't check 'rc', use success/failed tests

- yum module use 'fail_json' which set 'failed'
- 'rc' is for backward compatibility:
  bbd6b8bb42/lib/ansible/executor/task_executor.py (L571)
- besides yum module doesn't document any return values

* Allow to run tests twice in a row

ansible-test is executed with '--retry-on-error' switch, then tests must
be able to executed twice in a row.

Error was:
TASK [yum : install group] ***
ok: [testhost] => {
    "attempts": 1,
    "changed": false,
    "failed": false,
    "invocation": { [...] },
    "msg": "",
    "rc": 0,
    "results": []
}

TASK [yum : verify installation of the group] ***
fatal: [testhost]: FAILED! => {
    "assertion": "yum_result.changed",
    "attempts": 1,
    "changed": false,
    "evaluated_to": false,
    "failed": true
}
2018-01-27 12:35:18 +01:00
Jordan Borean
04d88755d5
fix win_user_right test for Azure (#35415) 2018-01-27 19:33:22 +10:00
Will Thames
56196e66bf [cloud] Improve results from ecs_taskdefinition_facts (#34337)
ecs_taskdefinition_facts should not populate ansible_facts with
so much information.

Better to just return the contents of the dict directly.

Reduce line lengths, use AnsibleAWSModule, don't reimplement
camel_dict_to_snake_dict.
2018-01-26 16:13:22 -05:00
Ghilli3
60d2a8b6a1 Fortinet FortiManager Scripting Module (#34518)
* Adding new code for new module and new module_utils with the pip pyfmg package

* Changed login and logout functionality and renamed mod_utils file as well as cleaned up PEP8 syntax

* Removing extra Ansible parameters and fixing more syntax issues

* Fixing more syntax issues and comparing against previous FTNT script module

* Changing import location to pass syntax checks

* Fixing pylint errors

* Removing test files

* Add unit tests and enabling a login session check within main in order to throw error if network connection exception

* Fixing syntax issues for adding unit tests

* Changing case for pip package requirements

* adding comments

* adding version restriction on pip package for testing

* adding version restriction on pip package for testing

* More comments

* Fixing documentation errors and add the ability to skip a test if it isn't present

* Fixing Pep8 error with whitespace (tab) in the row
2018-01-26 18:40:12 +00:00
Matt Martz
7404dc6767 Recursively remove args with omit as as their value, to match suboptions in argument_spec (#35299)
* Recursively remove args with omit as as their value, to match suboptions in argument_spec

* Add test for the new remove_omit function
2018-01-26 11:07:04 -06:00
Amol Kahat
e8633b7a22 Added VLAN configuration. (#35343)
Fixes GH 22147

Signed-off-by: Amol Kahat <akahat@redhat.com>
2018-01-26 10:21:59 -06:00
Nathaniel Case
1f1e5c11a9
ios_command: Whitelist some commands starting with configure (#35363)
* Whitelist some commands starting with `configure`

* Add tests for conditional `configure` rejection
2018-01-26 10:55:50 -05:00
Dag Wieers
4fa02d581d Remove 'attempts' from non-looped tasks (#35316)
* Remove 'attempts' from non-looped tasks

* Use self._task.until to determine if we're in a loop

* Undo recent changes to Windows tests
2018-01-26 09:06:03 -06:00
Daniel Shepherd
892fc41190 [cloud] New module: Amazon Egress-Only Internet Gateway (ec2_vpc_egress_igw) (#23941)
* New module: ec2_vpc_egress_igw

* minor pep8 fix and doc update

* add test dir and files

* add tests for gateway module

* fix up return documentation per review

* remove HAS_BOTO3 stuff as it is handled in AnsibleAWSModule per review

* fix an error with failure message and add custom handler for non-existent vpc ID

* add additional tests and update tests per review

* ignore errors on clean up tasks

* update module copyright to newer format

* fix exception handling since BotoCoreError doesnt have response attribute

* actually fix exception handling this time so it works with Py3 as well
2018-01-26 09:22:30 -05:00
Jordan Borean
0fb916c35e
more Azure test fixes for Windows (#35386) 2018-01-26 20:44:40 +10:00
Thom Wiggers
e2af5dfae0 Module to generate Diffie-Hellman parameters (#32620)
* Module to generate Diffie-Hellman parameters

Implements #32577

* Add integration tests for openssl_dhparam

* Slightly refactor check to prevent unnecessary regeneration

* Fix code smell in tests

Highly annoying to have to do this again and again and again as the rules change during the game

* Using module.run_command() and module.atomic_move() from a tempfile.

* Remove underscore variable

Ansible prefers dummy
2018-01-26 08:08:29 +00:00
Pierre-Louis Bonicoli
0db98d7d71 NPM integration tests: use ansible-ci-files 2018-01-25 23:06:29 -08:00
Matt Clay
573daf6280 Use ansible-ci-files for rpm_key test downloads. 2018-01-25 22:01:38 -08:00
Jordan Borean
ea7d29e262 azure windows: changed pagefile to dynamically get the path (#35376) 2018-01-25 16:58:49 -08:00
Matt Clay
b1d14d5b06 Fix failing zypper_repository integration test. 2018-01-25 15:29:23 -08:00
Matt Clay
7abdab6c9e Convert ansible-test compile into a sanity test. 2018-01-25 09:45:36 -08:00
Pilou
0ce8d389a4 azure_rm_dnsrecordset: fix broken import and minor updates (#34983)
* fix broken import

Error was:
lib/ansible/modules/cloud/azure/azure_rm_dnsrecordset.py:223:0: NameError: name 'ARecord' is not defined

* doc: use formatting functions

* remove unused dict
2018-01-25 09:39:49 -08:00
Dag Wieers
417accf88d Skip parameters that are being deprecated (#35319)
* Skip parameters that are being deprecated

So in most cases when parameters are deprecated, you may not want to
advertise them in the documentation. One reason for this is because
these parameters were not introduced within Ansible but predate
upstreaming them.

So this change avoids reporting parameters that are not documented and
are deprecated. It's only a small subset of the existing E322 errors.

* Add support for E323 with these changes

* Unsure about the other issues now

* Add better error message with E321

* Restore some erroneously remove files

* Readd false positives to ignore.txt
2018-01-25 11:10:49 -06:00
David Newswanger
ed082af8c9
improved test coveraage for vyos_config (#35298) 2018-01-25 12:04:42 -05:00
Senthil Kumar Ganesan
2f46f8f944 Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915)
* Support for network_cli plugin and tests

* Fixed ansible-test * issues

* Fixed Pylint warning

* Fixed the sanity test errors

* Fix YAMLlinter issue - removed blank spaces

* Fixed Python 3 failures

* Fixed the PEP8 issue

* Fix sanity --test validate-modules

* Reverted the changes to the doc fragments
2018-01-25 12:37:27 +00:00
Abhijeet Kasurde
1f544ed6cc
VMware: Add new module : vmware_drs_rule_facts (#35337)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-25 16:38:07 +05:30
Matt Davis
2a9ec6bdbf
fix Windows tests with hardcoded Administrator account (#35339)
* Admin account is not always called Administrator (eg Azure)
* this fixes some, but not all issues related to the Administrator account on non-English Windows as well (still numerous references to "Administrators" and other en-US Windows group names)
2018-01-25 02:56:58 -08:00
Ganesh Nalawade
c216473c82
Fix ios integration test failures (#35333) 2018-01-25 12:26:17 +05:30
Kedar Kekan
dd949c5b65
* adds missing params in a task (#35330) 2018-01-25 09:06:57 +05:30
Matt Clay
e0010f15e4 Add pslint sanity test. (#35303)
* Add pslint sanity test.

* Fix `no-smart-quotes` sanity test.

* Add docs for `pslint` sanity test.
2018-01-24 17:22:14 -08:00
Yuwei Zhou
7c201fc9bc delete subnet should be idempotent (#35037) 2018-01-25 10:59:14 +10:00
Matt Clay
e9e85625aa Disable failing azure_rm_postgresql* tests. 2018-01-24 14:26:52 -08:00
Matt Clay
bbedb9aac4 Disable failing azure_rm_mysqlserver test. 2018-01-24 13:09:39 -08:00
Matt Clay
8ea0bfe9a3
Miscellaneous test fixes. (#35301)
* Add missing pylint test for invalid path.
* Fix syntax in integration test.
* Use Write-Output in win_script test script.
* Fix pylint in explain mode.
2018-01-24 10:22:04 -08:00
Matt Clay
ebe925405c Disable failing azure_rm_mysqldatabase test. 2018-01-24 09:31:52 -08:00
Matt Clay
cc65636a10 Add PSScriptAnalyzer to default container. 2018-01-24 08:36:28 -08:00
Tim Rupp
bd09e67438
More bug fixes before 2.5 (#35260)
This patch includes more fixes for bugs that were identified in
the upcoming 2.5 release.
2018-01-24 08:15:37 -08:00
Kedar Kekan
c643a5d628
* removes the console logging from cli run before netconf run is (#35290)
started
2018-01-24 21:41:17 +05:30
Matt Martz
1ac04ba52e
Don't skip an inventory source just because it has a comma (#35002)
* Don't skip an inventory source just because it has a comma, make sure it's also doesn't exist as a path. Fixes #34931

* Add integration test for inventory path with commas
2018-01-24 09:44:55 -06:00
Kedar Kekan
56eeaf1b2f
Changes to enable network_cli and netconf on iosxr integration tests. (#35269)
* * Changes to enable network_cli and netconf on modules.
* limits connection local for single TC per playbook.

* * adds a note on why only 1 TC is executed with connection: local
2018-01-24 19:46:27 +05:30
Claes Nästén
0582521f96 NSO: handle types for leaf-lists in nso_config (ValueBuilder) (#34986)
Fixes: #34985
2018-01-24 11:21:17 +00:00
Claes Nästén
b7f815ba89 nso_config handle data.not_found in exists for nested lists (#35267)
Recent NSO can return data.not_found error on exists when parent list
entries does not exist. Handle this and return as false.

Fixes: #35264
2018-01-24 11:21:05 +00:00
saichint
0b30c42902 fix pim rp_address issues (#35248) 2018-01-24 11:48:49 +05:30
Colins-Git
7fac5cd7d2 Support for creation and modification of bridge and bridge slaves for nmcli (#34071)
Fixes: #31737
2018-01-24 11:00:09 +05:30
Zim Kalinowski
b2ea28f1ad [new module] azure_rm_sqldatabase (#34611)
* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase

* updates to azure_rm_sqldatabase
2018-01-24 15:17:31 +10:00
Trishna Guha
fd4fdbf01f
ios_logging handling platform difference (#35232)
* ios_logging handling platform difference

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

* fix unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-01-24 10:39:31 +05:30
Yuwei Zhou
6f67d68f5a azure_rm_networkinterface: support the multiple ip configuration (#32882)
* support the mutilple ip configuration

* Update azure_rm_networkinterface.py

* add test

* fix spell

* make the virtual network name more flexiable

* add test

* fix

* fix lint

* add test

* fix parameter

* deprecate the flatten ip configuration

* fix lint

* fix encoding

* fix mirror

* fix

* load model from common
2018-01-24 14:57:08 +10:00
Deiwin Sarjas
e970ae102c ecs_ecr: Fix AWS ECR repository creation (#34798)
* ecs_ecr: Remove registry ID from create repository call

[Boto3 documentation][1] specifies 'repositoryName' as the only expected
argument. The `**build_kwargs(registry_id)` part also adds 'registryId' which,
when executed, fails with: 'Unknown parameter in input: “registryId”, must be
one of: repositoryName'.

[AWS API documentation][2] also lists only the 'repositoryName' parameter. I.e.
this is not a problem with the boto3 library.

The default registry ID for the account that's making the request will be used
when creating the rpository. This means that if the `registry_id` specified by
the user is different from the default registry ID, then the policy changes
following the repository creation would fail, because the repository will have
been created in one repository but subsequent calls try to modify it in
another. Added a safeguard against this scenario.

[1]: https://boto3.readthedocs.io/en/latest/reference/services/ecr.html#ECR.Client.create_repository
[2]: https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_CreateRepository.html

* Fix concurrent ECR integration tests

If the `ecr_name` is the same in multiple concurrent test runs, then they can
interfere with one another causing both to fail. The `resource_prefix` is
guaranteed to be unique for different jobs running in CI an so avoids this
issue while also making it easier to identify the test which created the
resource.
2018-01-24 10:42:41 +10:00
Ricardo Carrillo Cruz
33c4351a35
Add authorize and provider params to eos_l2_interface tests (#35249)
Otherwise this fail for connection local
2018-01-23 22:45:17 +01:00
Ricardo Carrillo Cruz
eacb4d0a4a
Add become on eos_l2_interface tests (#35245) 2018-01-23 21:30:03 +01:00
Matt Clay
69132007c0 Revert "Move requirements into tests. (#35197)"
This reverts commit 4f6017dc16.
2018-01-23 10:54:25 -08:00
Matt Clay
eae23d2dbd Skip coverage on routine CI runs. 2018-01-23 10:38:38 -08:00
Matt Clay
4f6017dc16
Move requirements into tests. (#35197) 2018-01-23 10:08:16 -08:00
Michael Scherer
060001b08d Remove deprecated code (#34828)
* Remove compat code for to_unicode, to_str and to_bytes

Code was marked as deprecated and to be removed after 2.4

* Remove is_encrypted and is_encrypted_file

Code was marked as deprecated after 2.4 release.
2018-01-23 12:02:09 -06:00
Robin Roth
ec80f8ad80 Add identifier option to apache2_module (#33748)
* Add identifier option to apache2_module

There is a convention connecting the name passed to a2enmod and the one
appearing in apache2ctl -M. Not all modules follow this convention and
we have added a growing list of implicit conversions.
As a better long-term solution this adds an "identifier" option to be
able to set both strings explicitly.

* Run debian-specific tests only there

* Improve cleanup after apache2 tests

This is a follow-up/extension of https://github.com/ansible/ansible/pull/33630

* Add example for the new identifier option

* Put all debian tests in a block
2018-01-23 18:56:59 +01:00
Tim Rupp
ad8ee4e60f
Removes a bogus key from fixtures (#35236) 2018-01-23 09:33:44 -08:00
Martin Krizek
5c7f203c33
Add test for fix using loop_control with delegate_to (#33809) 2018-01-23 17:52:23 +01:00
Jason Vanderhoof
7c8e365dff Conjur Lookup Plugin (#34280)
* Imported lookup plugin from Role

* Plugin cleanup, including:
* Use existing Python YAML parsing
* Remove environment variables as connection options
* Added initial debugging information

* Reworked the lookup plugin using the Python Request library.  As it's available through Ansible, it makes communication with Conjur much more straight forward.

* Removed un-used libraries

* Fixed linting issues

* Standardized output on `format` and insure it works for 2.6, 2.7, and 3.x.

* Use quote_plus from the six library for improved python 2/3 behavior.

* Refactored identity & configuration to prefer user's file. This also includes a refactor to remove an un-needed dictionary merge method.

* Removed `requests` in favor of `ansible.module_utils.urls`.

* Refactored netrc loading to warn if host is not present.

* Tests and a refactor to support easier testing.

* Added reference to website

* Fixed two linting errors

* Fixed an extra line found by linting

* Updated file write to use binary to insure config files are written correctly

* Resolved linting issues

* Refactored config & identity loading to take advantage of plugin options

* Cleanup a bunch of small items caught by linting

* Removed extra line caught by linting

* Swapped in pytest and added some tests with mocked network responses

* Pushing to see if this approach works better...

* Refactored be open_url mocking based on feedback

* Fixed a couple linting issues & refactored mocking into each method to attempt to resolve a failing test

* Use a generic MagicMock for python 2.6

* Fixes doc typo

require -> required

* Use `type: path` in identity_file and config_file

Also removes `expanduser` calls below (which will now be called automatically on
paths.)

* Defines maintainers for conjur_variable plugin

* BOTMETA.yml:
** defines $team_cyberark_conjur as maintainers of Conjur Variable plugin
** adds myself and @jvanderhoof to that team

* Adds URLs to relevant documentation for Conjur Variable lookup plugin

* Clarifies "the server," "the machine" -> "controlling host"

The machine identity used is that of the Ansible controlling host, not any
server being provisioned or instructed. This documentation change aims to make
that relationship clear.

* Adds response code to exception message on authentication failure

* Enhances exception messages to specify the controlling host

These error messages are less likely to confuse a user as to which machine is
associated with the files, identities, and configurations being described.

* Adds ANSIBLE_METADATA for Conjur variable lookup plugin
2018-01-23 10:04:57 -06:00
David Soper
9c9e692165 Ucs vlans and integration tests (#35071)
* UCS VLANs module and integration tests

* UCS VLANs and integration tests
2018-01-23 16:32:32 +01:00
Dhivyap
19ff2f4e8c Ansible 2.5 feature support for dellos9 (#34880)
* Add ansible-2.5 support for dellos9

* Fix ansible-test issues and update copyright

* fix ansible-test errors in dellos9_config

* fix izip attribute error in python3

* fix python3 dict.keys() issue

* Remove waitfor aliases in dellos9_command
2018-01-23 13:59:27 +00:00
David Soper
7aa0c929bf Ucs lan connectivity and integration tests (#35137)
* UCS LAN Connectivity Policies and integration tests

* Docs updated

* UCS LAN Connectivity Policy and integration tests

* Fix use of description in docs and argument_spec so validate-modules passes
2018-01-23 14:45:44 +01:00
David Soper
9945d9a720 Ucs vnic template and integration tests (#35136)
* UCS vNIC templates and integration tests

* docs updated

* UCS vNIC template and integration test

* Update docs and argument_spec for description, mtu, and target.
2018-01-23 14:45:31 +01:00
Toshio Kuratomi
8c7bd8beb4 Set the tempdir on the shell mock object so that it is json serializable 2018-01-22 23:36:34 -08:00
Matt Davis
06dc840b51
implement gather_subset on Windows setup (#35212) 2018-01-22 21:10:25 -08:00
Dag Wieers
64df1a7566
aci_aaa_user_certificate: Rename user parameter to aaa_user (#35207) 2018-01-23 02:23:06 +01:00
Toshio Kuratomi
340a7be7c3 Implement plugin filtering 2018-01-22 16:54:53 -08:00
Toshio Kuratomi
14c3b4d8e5 Move yaml loading functions from DataLoader into a utility module. 2018-01-22 16:54:53 -08:00
Dag Wieers
2a4b3ef0c1 win_product_facts: New module to get Windows product information (#35206)
* win_setup: Add Product ID and Product Key in facts

So this is actually a very nice way to get product key information from
systems collected centrally.

Especially with systems that have been upgraded from Windows 7 or
Windows 8 to Windows 10 may not have a valid Windows 10 product
license key printed anywhere, it was a digital license.

If you ever have to reinstall the system, you may recover the system
from the recovery partition, or the original media, but cannot upgrade
to Windows 10 for free. By collecting the product key, one can always
reinstall your free Windows upgrade.

My only question is, do we want this to be part of the default facts, as
it may be considered important information. Or should we make a special
**win_product_key_facts** ?

* Add ACPI product key support

* Add integration test

* Remove Get-ProductKey function, move inline
2018-01-23 10:44:55 +10:00
Sloane Hertel
b94198f9de [cloud] New inventory plugin: aws_ec2 (#34416)
aws_ec2 is an inventory plugin intended to replace uses of the `contrib/inventory/ec2.py`
inventory script. 

For advanced grouping, please use the `constructed` inventory plugin.
2018-01-22 18:49:57 -05:00
Adrian Likins
6e585bdf24
Fact collector ordering deps (#31362)
Add deps/requires for fact collectors

Fact collectors can now set a required_facts
class attribute that will be a set of the names
of fact collectors they require to be run first.

ie, if a collector needs to know the ansible_distribution,
it should set it's required_facts to include 'distribution'

        required_facts = set(['distribution'])

If a collector requires another collector, it gets added
to the selected collector names.

We then topological sort the ordering of the collectors
so that deps work out (ie, 'distribution' will run before
'service_mgr')

required_facts were added to the collectors for:

        - network (requires 'distribution', 'platform')
        - hardware (requires 'platform')
        - service_mgr (requires 'distribution', 'platform')

Fix name references for facts (need 'ansible_' prefix)
is service_mgr

Fixes #30753
2018-01-22 18:23:40 -05:00
Marek
5fa29201a7 Port sts_assume_role to boto3 (#32569)
* Ported sts_assume_role to boto3

* Added integration tests
2018-01-22 17:46:08 -05:00
Adrian Likins
ffe0ddea96
add a vault --encrypt-vault-to specify vault id to use for encrypt (#31067)
Enforce that there can be only one --new-vault-id or
--new-vault-password-file and use this instead of
--encrypt-vault-id

* Add a config option for default vault encrypt id
2018-01-22 17:12:10 -05:00
Dag Wieers
d6004852a2
ACI: Move to 'host' parameter instead of 'hostname' (#35161)
* ACI: Move to 'host' parameter instead of 'hostname'

* Update host parameter in documentation fragment too
2018-01-22 22:06:56 +01:00
Matt Clay
f2f743aef0 Uninstall backports.lzma in archive test.
This avoids breaking other tests which depend on backports
modules, since the backports.lzma module is currently
incompatible with other backports modules.
2018-01-22 12:36:03 -08:00
Ricardo Carrillo Cruz
b7f4504a36
Add eos_l2_interface module and integration tests (#35162)
* Add eos_l2_interface module and integration tests

* Address PR review comments

* Fix pylint issues
2018-01-22 20:00:39 +01:00
Abhijeet Kasurde
c65842b9d8
Add check mode support in vmware_guest (#32858)
This fix adds check mode support in vmware_guest

Fixes: #32439

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-22 21:16:19 +05:30
Ganesh Nalawade
e8dd01fa5b
Add junos_l2_interface module (#35123)
* Add junos_l2_interface module

*  Implementation for junos_l2_interface module
*  Integration test

* Fix CI issues

* Fix review comments
2018-01-22 20:38:07 +05:30
Abhijeet Kasurde
912729b6a7
VMware: Check if VM is poweredoff before destroy (#35151)
This fix checks if VM is poweredoff before it can be destroyed.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-01-22 20:17:11 +05:30
Peter Sprygada
8d775a332e Add support for Infoblox NIOS (#35097)
* WIP: initial commit

* update documentation in modules

* fix up sanity check issues

* add unit tests for nios api

* fix up sanity check failures

* fix up EXAMPLES in modules

* mock infoblox_client.connector

* remove unsupported assert statement
2018-01-22 14:25:13 +00:00
abirami-n
775118aae2 2.5 Plugin Environment support and Testcases for dellos6 modules (#34890)
* Dellos6_2.5_support

* cleanup

* Fix pep8

* fix waitfor

* fix_facts

* fix_assert
2018-01-22 12:34:21 +00:00
Alberto Murillo
2018a61489 archive: Add support for xz (#34110)
* Add support for xz format on archive module

Fixes #34037
Fixes #34119

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>
2018-01-22 07:33:07 -05:00
Dag Wieers
46e53f90a7
ACI: Rename aci_intf_policy_* to aci_interface_policy_* (#35170)
* ACI: Rename aci_intf_policy_* to aci_interface_policy_*

* Modify documentation accordingly

* Fix validity ignore file
2018-01-22 12:40:15 +01:00
saichint
4bc22be614 Fix for nxos_pim issues (#35103)
* fix nxos_pim issues

* unused line removed

* unused line removed

* remove unnecessary files
2018-01-22 11:30:52 +05:30
René Moser
d1ce8e9924
vultr: add integration tests (#35157) 2018-01-21 22:54:12 +01:00
Tim Rupp
bff862b05d
Fixes bigip_asm_policy (#35154)
This module had been unable to successfully create policies
on different partitions. This appears to be fixed now
2018-01-21 10:11:27 -08:00
Dag Wieers
fa5adabcbf
aci_rest: Additional notes and simplify examples (#35091)
Add additional notes, improve examples
2018-01-21 10:59:08 +01:00
Dag Wieers
2bd0653488
ACI: Support validate_certs, use_ssl and use_proxy (#35146)
This PR includes:
- validate_certs, use_ssl and use_proxy support for the integration
  tests
2018-01-21 00:38:20 +01:00
Dag Wieers
2ad91dd359
ACI: Fix integration tests after error message change (#35138) 2018-01-20 21:40:55 +01:00
Adrian Likins
08f92a9f0f
Fix fact deps when 'filter=ansible_fact' is used. (#33441)
The accumulated collected_facts was being update
with new facts _after_ filtering them. So only
facts that pass the filter would ever be passed
to other fact collectors.

For 'filter=ansible_service_mgr', even though it requires
the platform and distribution facts and even collects them,
they would get filtered out and never passed to the other
collectors that need them (service_mgr for ex).

Fix is just to add the unfiltered facts to collected_facts.

Adds unit tests for fact filter and collected_facts.

Fixes #32286
2018-01-20 15:07:27 -05:00
Adrian Likins
ec9769c82f
Facts distribution clear linux 31501 (#32453)
The search string used to look for Clear Linux
was changed in 45a9f96774 to
be more specific, but was too specific. Now finding
a substring match for 'Clear Linux' in /usr/lib/os-release
is enough to consider a match.

Since the details of the full name in os-release varies
('Clear Linux Software for Intel Architecture',
 'Clear Linux OS for Intel Architecture', etc) the
search string match was failing and would fall back to the
'first word in the release file' method resulting in
ansible_distribution='NAME="Clear'

Also add a meta fact indicating which search string
was matched.

Test case info from:
        https://github.com/ansible/ansible/issues/31501#issuecomment-340861535

Fixes #31501
2018-01-20 15:05:53 -05:00
Adrian Likins
fc180a378a
Support using vault password files that are themselves vault encrypted (#27668)
Extract vault related bits of DataLoader._get_file_contents to DataLoader._decrypt_if_vault_data

When loading vault password files, detect if they are vault encrypted, and if so, try to decrypt with any already known vault secrets.

This implements the 'Allow vault password files to be vault encrypted'  (#31002) feature card from
the 2.5.0 project at https://github.com/ansible/ansible/projects/9

Fixes #31002
2018-01-20 14:56:18 -05:00
Tim Rupp
ca8982f96c
Fixes some bugs and things (#35122)
Removes deprecations and fixes bugs.
2018-01-20 10:40:20 -08:00
Bruno
c5a7beecc4 fix integration tests (#35117) 2018-01-20 08:13:31 +01:00
Tim Rupp
90f0c411e4
Adds module for bigip_device_group_member (#35121)
Module allows for members to be managed in a device group
2018-01-19 20:57:41 -08:00
Tim Rupp
585d8cf4c7
Adds bigip_ucs_fetch module (#35113)
This module can be used to download UCS files from a BIG-IP
2018-01-19 20:25:47 -08:00
Dag Wieers
2cd8a3a9a3
ACI: Make network testing work out-of-the-box (#35116) 2018-01-20 02:47:28 +01:00
Matt Martz
f9c2c9570d
Clean up imports to prevent issues with mutable data being used in modules (#35112)
* Clean up imports to prevent issues with mutable data being used in modules

* Remove un-needed mock
2018-01-19 16:33:16 -06:00
Nathaniel Case
bf1580a333
ios_l2_interface (#35054)
* Fix sending 'None' to device on ios

* Add ios_l2_interface module & tests

* Skip l2 tests on non-l2 images

* Allow test to continue on non-L2 hosts
2018-01-19 17:14:32 -05:00
Will Thames
4d58d16793 Add aws_s3 action plugin to find source files as expected (#35028)
People expect to be able to upload files to s3 using standard
locations for files.

Providing an action plugin that effectively rewrites the `src`
key to the result of finding such a file is a great help.

Tests added, and IAM permissions corrected
2018-01-19 17:11:42 -05:00
Jordan Borean
d0e6889f93 win_become: another option to support become flags for runas (#34551)
* win_become: another option to support become flags for runas

* removed uneeded entries

* fixed up whitespace issue

* Copy edit
2018-01-19 13:58:10 -08:00
Bruno
a13958d273 added integration tests (#34825) 2018-01-19 21:45:16 +01:00