Commit Graph

2916 Commits (657ab5813902f15516ce79352323ab30cbdfd325)

Author SHA1 Message Date
Ricardo Carrillo Cruz 29347b7e80 Fix assert on eos_vrf integration test (#26686)
We need to check the session_name key is not in the dict, rather
than checking it has no value, otherwise the test fails.
7 years ago
Ricardo Carrillo Cruz 9f2d58f7b4 Fix eos_config config test (#26679)
We needed to re-register show-running config before doing the
idempotency test.
7 years ago
Ricardo Carrillo Cruz 4006b5d18f Replace Ethernet5 for Ethernet2 on eos integration tests (#26674)
In our CI, we only have 3 NICS: Management1, Ethernet1 and
Ethernet2.
7 years ago
Ricardo Carrillo Cruz 3f5736e14e Add vyos_l3_interface module (#26610)
* Add vyos_l3_interface module

* Add integration tests for vyos_l3_interface

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

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

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

* fixup

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

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

* revert tests

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

* fixup

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

* progress

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

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

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

* fix shellcheck warning

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

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

Modules updated
* nxos_config
* ios_config
* eos_config

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

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

* removes ios_config from pep8/legacy_files.txt

* extends the ignore lines argument to the module

* clean up CI errors

* add missing list brackets

* fixes typo

* fixes unit test cases

* remove last line break when returning config contents

* encode config string to bytes before hashing

* fix typo

* addresses feedback in PR

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

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

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

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

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

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

rm code to create 'ansible_facts' subkey from namespace

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

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

* Fix CI issues

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

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

* Minor fix

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

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

* swap check_mode with candidate

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

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

* Add vyos_static_route implementation module

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

* unit test

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

* modify vyos_static_route

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

* integration test vyos_static and net_static_route

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

* fix typo integration test

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

* modify vyos_static_route

* modify integration test

* vyos_static_route doc build fix

* fix integration test data

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

* update net_static_route cli test set

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

* Feature #2731: be more permissive of arguments

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

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

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

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

now passes.

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

* Feature #2731: bump added version to 2.3

* Feature #2731: replace db_import with db_restore

* Feature #2731: add missing version description

* Feature #2731: fix 'state' description

* Feature #2731: fix pep8 issues

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

* Bump added version from 2.3 to 2.4

* Fix pep8 and pylint errors

* Attempt yaml formatting of documentation string

* Add integration tests for postgres_db:dump/restore

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

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

* Revert to postgres user for dump/restore

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

* Various cleanups to have tests passing

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

* Use pg_user to support FreeBSD

* Revert login_ prefixes and re-enable password support

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

* Optionally add password

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

* Quick fixes

* Refactor login arguments after fixes from pchauncey

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

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

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

* Introduce target_opts for passing limiting dumped/restored schemas

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

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

* changed run_level option to runlevel

* correct merge conflicts since task path fix

* changed run_level option to runlevel

* changed do_not_store_password to store_password, and other minor fixes

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

* postgresql_user - PEP8 and style fixes to make debugging easier

* postgresql_user - move password changing logic to separate function

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

* postgresql_user - further PEP8 fixes

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

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

* Check behaviour when pg_authid relation isn't readable

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

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

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

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

* Minor change

* Doc change

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

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

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

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

* nxos_switchport unit test

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

* legacy file

* update unit test

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

* Add vyos_linkagg integration tests

* Fix pep8 issue

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

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

* shippable error fix

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

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

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

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

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

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

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

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

* addressed latest comments

* test should not use realpath as it follows symlink

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

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

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

* fix vyos_banner unit test

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

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

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

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

* Add nxos_acl test

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

* nxos_pim_rp_address changes

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

* Add ios_static_route integration tests

* Add platform agnostic integration tests for IOS

* Replace unicode function to ansible module_utils to_text

* Add collections handling logic

* Add integration tests for collections

* Make collections and prefix mutually exclusive

* Add net_static_route integration tests for collections

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

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

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

* Improve the $speech_speed parameter handling

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

Fixes #21622

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

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

Unit tests are provided. Integration tests can be found here

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

Unit tests are provided. Integration tests can be found here

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

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

* Add opensvwitch to network-all

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

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

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

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

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

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

* Move filepath munging to nxos_module

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

* Update other nxos tests

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

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

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

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

* Handle wrong password given for VaultAES format

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

* Namespace all of the pycrypto imports and always import them

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

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

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

(cherry picked from commit 9e16b9db275263b3ea8d1b124966fdebfc9ab271)

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

* Attempt to add pycrypto version to setup deps

* Change hacking README for dual pycrypto/cryptography

* update dependencies for various CI scripts

* additional CI dockerfile/script updates

* add paramiko to the windows and sanity requirement set

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

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

* helper script for manual testing of pycrypto/cryptography

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

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

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

* docs and comments updates based on PR review

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

* Add checkmode, allow_clobber parameter, integration tests

* Add aliases, replace win_raw with win_shell

* restore original test_win_group1.yml, add powershel version test

* fix var type

* add conditional on assert

* integration tests conditional tasks review

* documentation fix, test fix, adds result.change

* fix yml

* fix railing whitespace

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

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

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

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

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

* nxos_vpc_interface unit test

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

* fix state_present

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

* add state_present unit test

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

* make ansibot happy

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

* teardown get_config

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