Commit graph

4400 commits

Author SHA1 Message Date
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