Commit Graph

6223 Commits (ec48e854c969559b736b9b31bd8e565d20329088)

Author SHA1 Message Date
Shuang Wang d302485f99 option [others] of get_url is unnecessary (#47005)
* parameters [others] of get_url is unnecessary

* delete a blank line

* test

* delete ignore

* Update get_url.py
6 years ago
Matt Clay 6a1aa51a74 Add constraint for pycparser. 6 years ago
Matt Clay 76bf861308
Upgrade pylint to version 2.1.1. (#47036)
* Fix issues reported by the latest pylint.
* Split pylint runs into more contexts.
* Upgrade pylint.
6 years ago
jctanner 0b15ad00c1
Add a test target for the foreman inventory script (#46837)
Add a test target for the foreman inventory script
6 years ago
Matt Clay 3033fd96b0
Move unit test compat code out of `lib/ansible/`. (#46996)
* Move ansible.compat.tests to test/units/compat/.
* Fix unit test references to ansible.compat.tests.
* Move builtins compat to separate file.
* Fix classification of test/units/compat/ dir.
6 years ago
Jordan Borean 6e2897647c
win test: add http tester container to Windows tests (#46606) 6 years ago
Matt Martz a06a5ded61
Do not use mutable defaults in FieldAttribute, instead allow supplying a callable for defaults of mutable types. Fixes #46824 (#46833) 6 years ago
Nathaniel Case e9a7a741f8
Add missing connection param to test (#46831) 6 years ago
Christian Kotte ade5d938c3 VMware: Improve module vmware_host_config_manager (#46264)
* Improve module description
* Add check mode support and change message
6 years ago
Will Thames b772485d97 Ensure that k8s_facts always returns resources key (#46733)
Fix bug returning `items` key if NotFound exception is hit
6 years ago
Jordan Borean 0f5331645f
ansible-test: add skip/windows/... alias to skip tests on specific Windows versions (#46845)
* ansible-test: add skip/windows/... alias to skip tests on specific Windows versions

* show what tests were skipped

* changes to logic to only skip if all Windows targets are set to skip

* codestyle improvements

* change warning message based on review

* check args type before running the Windows path
6 years ago
Matt Clay ec88510fd4 Add OUTPUT_DIR env var to integration tests. 6 years ago
Matt Clay 0c29463785 Block module ansible imports outside module_utils. 6 years ago
abarbare cafed004ad fix scaleway user data tests (#46570)
* fix scaleway user data tests

* default values

* pep8
6 years ago
cahlchang 1cce11b39c [AWS] Support check mode in aws ec2_instance module (#46774)
* fix checkmode

* Added checking test to existing test playbook

* Added test for check mode
6 years ago
Justin England 0bc5b799a6 Update win_scheduled_task.py (#46720)
* Update win_scheduled_task.py to document that the duration of a task trigger can be null, which will cause it to run indefinitely - docs update makes use of suboptions

* Add a fix for the validate-modules schema
6 years ago
Adam Miller fd97c8e56c
fix yum proxy username/password handling (#46291)
Fixes #46249

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Matt Clay 712ad9ed64 Fix ansible-test custom docker image traceback. 6 years ago
Shuang Wang cd1faca6e0 copy - support recursive copying with remote_src (#43998)
* Allow copy module to work with recursive and remote_src #14131
6 years ago
Adam Miller fb6e91bf98
yum module properly check for None config_file (#46641)
* yum module properly check for None config_file
* add conf_file test cases to yum integration tests

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Alicia Cozine 9764f32513 adds stub API docs in a single file (#46663)
* adds stub API docs in a single file
6 years ago
Anil Kumar Muraleedharan d0e89bc1bb Lenovo finetune modules (#46623)
* Making username password etc non mandatory as we use persistence connection.
Some documentation fine tuning also done.

* To update version which was tested against.

* Adding Bacon switch (NE0152T) to device rules

* Qalthos Review catch

* Updating version

* Changing documentation to add Bacon switch. This is effective since 2.8
6 years ago
dangoscomb fb72a5424c nmcli: fix vlan connection modification Fixes #42322 (#42415)
* ensure optional items are set to empty strings rather than not presented
fix syntax of vlan modification command

* extended tests for nmcli
6 years ago
Christian Kotte 2230f40041 VMware: Add check mode support to module vmware_host_firewall_manager (#46266) 6 years ago
Christian Kotte 0bc2e6795d VMware: Gather extended datastore facts (#46546)
* Add datacenter_name alias
* Add check mode support
* Add extended datastore information
6 years ago
Adam Miller ad405fc21e yum module handle list optional empty strings properly (#46634)
Fixes #46517

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Brian Coca 8743e6ae2e remove default from delegate_facts to inherit (#45492)
* remove default from delegate_facts to inherit

fixes #45456

* test delegate_facts

* added note about inheritance and defaults

* yamllint
6 years ago
anasbadaha 2c24cfb401 Add support for IGMP interfaces on onyx switches (#46218)
Signed-off-by: Anas Badaha <anasb@ufm-host08-004.mtr.labs.mlnx>
6 years ago
Jordan Borean f34f75be45
win_uri: use variable for httpbin host (#46734) 6 years ago
Matt Clay 0785656344 Fix vmware_inventory unit tests so they run. 6 years ago
lwm 8d0f823de0 Add a Linode v4 dynamic inventory plugin. (#45902)
* Add a Linode v4 dynamic inventory plugin.

Closes https://github.com/ansible/ansible/issues/44721.

* Use the latest API for accessing host variables.

References:

  * https://github.com/linode/linode_api4-python/issues/141

* Minor docs formating
6 years ago
Toshio Kuratomi 473f70c21a Mocking out __future__ could cause problems 6 years ago
Jordan Borean 7b774117ab
ansible-test: set ulimit to enforce consistent test environment (#46652)
* ansible-test: set ulimit to enforce consistent test environment

* fixed santiy issue
6 years ago
Pilou 955579cd72 rabbitmq_user: 'node' parameter: add default value (#38156)
* Remove unnecessary workaround

* add test: set RABBITMQ_NODENAME environment variable

The following error occurs:

  TASK [rabbitmq_user : Add user] ***
  fatal: [testhost]: FAILED! => {
    "changed": false,
    "cmd": "/usr/sbin/rabbitmqctl -q list_users",
    "rc": 69,
    "msg": "Error:********@c65c2bc59398'. Please see diagnostics information and suggestions below.\n\nMost common reasons for this are:\n\n * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)\n * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)\n * Target node is not running\n\nIn addition to the diagnostics info below:\n\n * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n * Consult server logs on node test@c65c2bc59398\n\nDIAGNOSTICS\n===========\n\nattempted to contact:********@c65c2bc59398\n * effective user's home directory: /var/lib/rabbitmq\n * Erlang cookie hash: 3MxcYFrJzfhEL+FlUfLlQw==",
    "stderr":  [...],
    "stderr_lines": [
      "Error: unable to perform an operation on node 'test@c65c2bc59398'. Please see diagnostics information and suggestions below.", "",
      "Most common reasons for this are:", "",
      " * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)",
      " * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)",
      " * Target node is not running", "",
      "In addition to the diagnostics info below:", "",
      " * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more",
      " * Consult server logs on node test@c65c2bc59398", "",
          "DIAGNOSTICS", "===========", "",
          "attempted to contact: [test@c65c2bc59398]", "",
          "test@c65c2bc59398:",
      "  * connected to epmd (port 4369) on c65c2bc59398",
      "  * epmd reports: node 'test' not running at all",
      "                  other nodes on c65c2bc59398: [rabbit]",
      "  * suggestion: start the node", "",
      "Current node details:",
      " * node name: rabbitmqcli2@c65c2bc59398",
      " * effective user's home directory: /var/lib/rabbitmq",
      " * Erlang cookie hash: 3MxcYFrJzfhEL+FlUfLlQw==", ""
    ],
    "stdout": "",
    "stdout_lines": []
  }

* node parameter: fix default value

'rabbit' is the default value mentioned in the module documentation.
6 years ago
Matt Clay a11f631ee4 Python 3.8 collections compatibility fixes.
Includes a new pylint blacklist plugin to prevent regressions.
6 years ago
Evgeni Golov 7c66c90afc introduce `module_utils.urls.fetch_file` as a wrapper to download and save files (#19172)
* module_utils.urls: add fetch_file function

* apt: use fetch_file instead of own download()

* unarchive: use fetch_file instead of own codecopy

* apt: add test for deb=http://…

* unarchive: add test for a remote file download and unarchive

* yum: replace fetch_rpm_from_url by fetch_file

* use NamedTemporaryFile

* don't add a dot to fileext, it's already there
6 years ago
Felix Fontein a74774488d docker_container: add port range and IPv6 support for published_ports (#46596)
* Allow port ranges.

* Adding IPv6 support for published_ports.

* Die when hostname is passed instead of IP address.

* Added changelog.
6 years ago
Christian Kotte ccfa6ff011 VMware: Add check mode support to module vmware_host_ntp (#46268) 6 years ago
Christian Kotte c4cfeb183f VMware: Add check mode support to module vmware_host_service_manager (#46271) 6 years ago
Felix Fontein 77127d6768 docker_container: allow more mount modes for volumes (#46598)
* Being more strict about volume mount modes.
6 years ago
Abhijeet Kasurde 513be8923d
VMware: new module vmware_host_feature_facts (#45966)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Felix Fontein 8afe46dc02 docker_container: improve publish all ports functionality (#46594)
* Improve handling of published_ports: all.

* Add changelog.
6 years ago
Jordan Borean bc6d441cf2
Win chocolatey facts module (#46610)
* add module win_chocolatey_facts

* rename example name

* fix ansible-test errors

* add integration tests

* fix integration test

* implementation of improvement proposals

* implementation feedback

* implementation feedback

* fix trailing-whitespace

* implementation feedback

* fix version

* fix lint

* add test targets

* Updated modules docs and tests

Co-authored-by: Simon Baerlocher <sbaerlocher@users.noreply.github.com>
6 years ago
flowerysong be05069c61 Port the sns module to boto3 (#45634)
* Port sns to boto3

* Exception handling for ARN lookup

* sns: Add integration tests
6 years ago
Rémy Léone 4967ef5936 Specify region in IP facts (#46210) 6 years ago
Rémy Léone 2903033c1d Add region parameters to sg (#46211) 6 years ago
Rémy Léone 3a1d8867ed Add region to server facts (#46212) 6 years ago
Rémy Léone 6ab07d1a74 Add region to snapshots facts (#46213) 6 years ago
Christian Kotte 5cd1ba3477 VMware: Add check mode support to module vmware_host_dns_facts (#46530) 6 years ago
Rémy Léone c3e5ebfa79 Add region to the volume facts (#46214) 6 years ago
Felix Fontein a520ca3298 docker_container, docker_image_facts: allow to use image IDs (#46324)
* Allow to specify images by hash for docker_container and docker_image_facts.

* flake8

* More sanity checks.

* Added changelog.

* Added test.

* Make compatible with Python < 3.4.

* Remove out-commented imports.
6 years ago
Matt Clay 1a28898a00 Fix parametrize warning in unit tests. 6 years ago
Jordan Borean 25c627d256
shippable: fix py3 issues with downloader (#46522) 6 years ago
Will Thames aec263df8a Add test suite for ec2_vpc_igw before boto3 upgrade (#45903) 6 years ago
tstoner ae363da5f5 Purging logging configuration before running playbook (#46302) 6 years ago
Matt Clay e2b6047514
Add symlinks sanity test. (#46467)
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.
6 years ago
Christian Kotte a4961ff32a VMware: Add check mode support to module vmware_host_firewall_facts (#46265) 6 years ago
Christian Kotte ab26119637 VMware: Add check mode support to module vmware_host_acceptance (#46260)
* Improve module description
* Add check mode support
6 years ago
Matt Clay 0dc7f38787
Improve ansible-test environment checking between tests. (#46459)
* Add unified diff output to environment validation.

This makes it easier to see where the environment changed.

* Compare Python interpreters by version to pip shebangs.

This helps expose cases where pip executables use a different
Python interpreter than is expected.

* Query `pip.__version__` instead of using `pip --version`.

This is a much faster way to query the pip version. It also more
closely matches how we invoke pip within ansible-test.

* Remove redundant environment scan between tests.

This reuses the environment scan from the end of the previous test
as the basis for comparison during the next test.
6 years ago
John Imison c4cfa387ea Lookup plugin for rabbitmq (#44070)
* Adding a basic get lookup for rabbitmq.

* Always return a list

* If content type is JSON, make accessible via dict.

* Fixed incorrect json.loads variable and missing raise

* Change to document returned data

* Fixed pep8 issues

* Adding integration testing

* Moving lookup intgration tests to new target

* New rabbitmq lookup plugin (#44070).

* New rabbitmq lookup plugin (#44070).

* PR review feedback updates

* Testing pika is installed

* Minor mods to tests

* Check if connection is already closed or closing

* Updated tests and connection testing

* PR review feedback updates

* PR review include ValueError in AnsibleError output

* Suggesting to use set_fact when using returned variable more than once.

* Cleaned up some tests, added some notes and handling connection closure on some exceptions.

* Removed finally statement and added some additional error handling.

* Added some additional error handling.

* PR review updates.

* Additional integration tests and removing return in finally

* Updated version

* Changing back to running tests on ubuntu.

* Additional tests

* Running tests on  Ubuntu only

* Fixing syntax error

* Fixing ingtegration tests and a string/byte issue

* Removed non-required test and fixed BOTMETA

* Trying to fix integration test failure on ubuntu1404

* Some issues occured when handling messages from the queue with to_native.  Switching to to_text resolved the issues.

* Renaming channel to queue (thanks dch). Disabling trusty tests.
6 years ago
Matt Clay 33a8be9109 Add file exists check in integration-aliases test. 6 years ago
Sam Doran b74279d14c Use proper index value with insertbefore on a one line file (#46071)
Add tests and changelog
6 years ago
Jordan Borean ba638f40cf
ps-lint: ignore rules that are not relevant to Ansible (#46376) 6 years ago
Jordan Borean 1de88cbaa9
win_chocolatey: remove test packages after tests are run (#46431) 6 years ago
Matt Clay 6d9be66418 Use default-test-container version 1.3.0. 6 years ago
Christian Kotte 1589424c3e VMware: Add check mode support in vmware_host_config_facts (#46272) 6 years ago
Jordan Borean e972287c35 win_exec: refactor PS exec runner (#45334)
* win_exec: refactor PS exec runner

* more changes for PSCore compatibility

* made some changes based on the recent review

* split up module exec scripts for smaller payload

* removed C# module support to focus on just error msg improvement

* cleaned up c# test classifier code
6 years ago
Matt Clay 0d7a156319 Fix ansible-test encoding issues for exceptions. 6 years ago
Matt Clay e53390b3b1
Fix ansible-test multi-group smoke test handling. (#46363)
* Fix ansible-test smoke tests across groups.
* Fix ansible-test list arg defaults.
* Fix ansible-test require and exclude delegation.
* Fix detection of Windows specific changes.
* Add minimal Windows testing for Python 3.7.
6 years ago
Sloane Hertel 27534e9b47 Move network utils that are used by AWS modules (#45579)
* Separate networking tools that may be used by modules outside of networking so changes to networking-only utilities don't trigger AWS integration tests

* Add unit tests for moved network utils

* Add comment to prevent imports from being mistakenly removed

* Move to_bits as well
6 years ago
Matt Clay 33b34f5c82 Rebalance shippable/posix/ CI groups. 6 years ago
Egor Zaitsev 6df1f6b203 New module: routeros_facts – collect facts from RouterOS devices (#46114)
* feat(routeros): implement routeros_facts module

* fix(routeros): review by felixfontein

* fix(routeros): review by ganeshrn

* fix(routeros): review by felixfontein
6 years ago
Jordan Borean c20433e5e4 remove comments from multiplle yaml string that breaks tests for now 6 years ago
Pilou b76c4c840e WIP: Check that union Jinja filter can be chained (#46298)
* Check that union Jinja filter can be chained

* set filters: fix unexpected templating type error

this error occurs with Jinja 2.10 since 32ec69d827,
for example when union filters are chained:

$ ansible all -i localhost, -mdebug -a"msg={{ []|union([])|union([]) }}"
localhost | FAILED! => {
    "msg": "Unexpected templating type error occurred on ({{ []|union([])|union([]) }}):
            unsupported operand type(s) for +: 'set' and 'list'"
}
6 years ago
Brian Coca d3d812b604 avoid tests when ncclient is not installed 6 years ago
abarbare c5d5d08b6b feat: add scaleway security_group_rule management (#45694)
* feat: add scaleway security_group_rule management
6 years ago
Remo Wenger 83e584577a docker_container: ambiguous parameter "stop_timeout" (#43874)
* docker_container: Honour stop_timeout when creating docker containers (#43814)

* Adjusting description to what actually happens.

See docker-py changelog for 2.7.0: 'APIClient.stop will
no longer override the stop_timeout value present in the
container’s configuration.'

* Add a test whether stop_timeout can be configured for the container.

* Added changelog.

* Integrate with comparisons (by default, ignore stop_timeout value for restarts; will be configurable with PR ansible/ansible#44789).

* Fix config change code and tests (#2)

* Improving wildcard test.
* Using correct config.
6 years ago
Sam Doran 8b1ae30e2e
Use bytes rather than native string for result (#46281)
This prevents a stack trace in Python 3 when the result is an empty file since
the file is open in binary mode and a native string in Python 3 is str,
not bytes.
6 years ago
Dag Wieers d6bd52ad59 Add unit tests 6 years ago
Dag Wieers 84437855c9 Add integration tests
By checking the cmd result with the original we cause these tests to
fail on older releases without this PR.
6 years ago
Metzger, Simon 00d78d7ef3 added period in description. Changed integration test to work correctly. 6 years ago
Metzger, Simon 285af0b6fb added parameter leaf_port_blk_description in module and integration tests 6 years ago
Metzger, Simon be2c73ac18 be compliant to pep8 and pylint. Added integration tests. 6 years ago
Felix Fontein 84682464c7 docker_container: allow to configure comparison for existing containers (#44789)
* Added comparison configuration.

* Improving user feedback on specifying a wrong option.

* Avoid bare except.

* Added basic integration tests.

* Adding wildcard support.

* Warn if ignore_image=yes is overridden.

* Added changelog fragment.
6 years ago
Matt Clay 04ddadd89b Move module tests using TQM to integration tests. 6 years ago
Felix Fontein a727a1ee67 [aws] route53 module: fix idempotency for CAA records (#46049)
* Fixing record order for CAA records to properly handle idempotency.

* Add integration tests that reproduce CAA failure
6 years ago
Kevin Subileau ac9d506a61 win_nssm: tests and several bug fixes (#44755)
* win_nssm: add failing tests for issue #44079

* win_nssm: use Run-Command instead of Invoke-Expression to prevent interpretation issue

Fix #44079

* win_nssm: add more failing tests

These tests highlight several issues with this module:
 * Service not started when state=started
 * Errors with app_parameters (see #25265)
 * Exception when passing several dependencies separated by comma as specified in doc

* win_nssm: fix service not started when state=started

Nssm status returns a multiline output that doesn't match any of the strict patterns in the switch statement.

* win_nssm: fix incorrect separator in doc for service dependencies

The dependencies parameter works with space as separator, but not with comma as shown in the documentation

* win_nssm: fix error with app_parameters parameter

Fix #25265

* win_nssm: add idempotence tests

* win_nssm: fix several idempotence issues and misbehaviors

Add missing space between arguments when app_parameters contains several keys.
Use Argv-ToString and Escape-Argument to improve arguments handling (parameters with quotes, backslashes or spaces).

* win_nssm: test parameters with spaces, quotes or backslashes

* win_nssm: restore comma as separator for service dependencies

Revert commit ddd4b4b

* win_nssm: restore support of string as dict form for app_parameters and remove support of literal YAML dict

* win_nssm: wrong variable in tests
6 years ago
Yunge Zhu 69594c5370 add azure_rm_cdnprofile and azure_rm_cdnprofile_facts (#45097)
* add cdn profile with facts

* fix merge issue

* fix version

* fix lint

* move cdn client out of azure_rm_common

* fix lint

* fix helper

* fix code bug

* fix bug

* fix import

* fix typo

* fix test
6 years ago
Sandra McCann 08c392477e made sros_config docs match code for match options (#46135)
* made docs match code for match options

* fixed shippable error
6 years ago
tstoner b427499e3e Added feature facts to nxos_facts (#45934)
* Added feature facts to nxos_facts

* Fixed ansibot indentation

* Resolved ansibot whitespace missing after ','

* Per PR suggestion, created method in base class to gather switch config
and store in global variable to prevent multiple calls to switch.

* Addressed ansibot blank line & whitespace after ,
6 years ago
René Moser 7f92a8c94c
cs_staticnat: fix sanity (#46037) 6 years ago
René Moser c09b785a66
cs_instance: doc: fix typo in examples (#46035) 6 years ago
Jordan Borean 40379b76b1
skip installing linux-image-extra in CI as it shouldn't be needed (#46101) 6 years ago
Brian Coca 32ec69d827
allow jinja2 unique filter compat (#45637)
* allow jinja2 unique filter compat
* detect if unique is provided, fallback with warning
* handle j2 specific params
* now all filters using unique must pass environment
* added env to tests

also normalized on how we normally import and use exceptoins
6 years ago
John R Barker f4f5d941e5
botmeta support: core (#45917)
* botmeta enforce `support: core`
6 years ago
abarbare 98b0594352 feat: add scaleway security group module (#45686)
fix: pep8 coding style

fix: error order requests
6 years ago
Matt Martz 49eb53b44d
pylint plugin to catch due/past-due deprecated calls (#44143)
* Start of work on pylint plugin to catch due/past-due deprecated calls

* Improve deprecated pylint plugin

* Catch call to AnsibleModule.deprecate also

* Skip splatted kwargs, we can't infer that info

* Add error for invalid version in deprecation

* Skip version if it's a reference to a var

* Disable ansible-deprecated-no-version for displaying deprecated module info

* fix comments

* is None

* Force specifying a version, this can be disabled on a per case basis

* Disable ansible-deprecated-version by default

* Remove to look for 2.8 deprecated

* Revert "Remove to look for 2.8 deprecated"

This reverts commit 4e84034fd1.

* Add script and template used for creating issues for deprecated issues

* Fix underscore var
6 years ago
Dan f20938788a fixed nxos_aaa_server_host issue with type 7 encrypt key (#46015)
* fixed nxos_aaa_server_host issue with type 7 encrypt and added test cases

* added idempotence tests
6 years ago
Dan a6c20488d3 Add ospf net type (#45904)
* Added ospf network type option to nxos_interface_ospf module

* Added documentation and example for the 'network' parameter

* adding version
6 years ago
tstoner e74e8b8e75 Additional feature enhancements to nxos_logging (#45844)
* Various changes to nxos_logging.  Plus added purge capibility.

* Made a few new nxapi_logging test cases conditional based on version
and/or platform.

* Addressed PR comments and ansibot shippable.  Fixed up nxos_logging documentation format.

* Addressed ansibot shippable issues with whitespaces and documentation.

* Resolved ansibot codestyle trailing whitespace
6 years ago
Jordan Borean e26861435f
async tests: add stability (#46100) 6 years ago
Matt Martz 86e8d21667
Perform full RETURN schema validation in one step, don't try to loop (#46079) 6 years ago
Matt Martz c0915e2f5a
Support nested JSON decoding in AnsibleJSONDecoder (#45924)
* Support nested JSON decoding in AnsibleJSONDecoder

* Add tests for vault portion of AnsibleJSONDecoder
6 years ago
Rémy Léone 53886ecc9b Add an Online servers fact 6 years ago
Matt Clay 4085d01617 Reduce noise in docs-build test failures. 6 years ago
Rémy Léone 6d7004f367 Add a Scaleway IP module (#45121)
- Add an option to enable public ip at server creation
6 years ago
Felix Fontein 7caf70db42 docker_container: fix various idempotency problems and non-working options (#45905)
* Sorting args.

* Doing comparisons of options with container parameters in a more context-sensitive way.

This prevents unnecessary restarts, or missing restarts (f.ex. if parameters are removed from ``cmd``).

* Make blkio_weight work.

* Fix cap_drop idempotency problem.

* Making groups idempotent if it contains integers.

* Make cpuset_mems work.

* Make dns_opts work.

* Fixing log_opts: docker expects string values, returns error for integer.

* Adding tests from felixfontein/ansible-docker_container-test#2.

* Make uts work.

* Adding changelog entry.

* Forgot option security_opts.

* Fixing typo.

* Explain strict set(dict) comparison a bit more.

* Improving idempotency tests.

* Making dns_servers a list, since the ordering is relevant.

* Making dns_search_domains a list, since the ordering is relevant.

* Improving dns_search_domains/dns_servers.

* Fixing entrypoint test.

* Making sure options are only supported for correct docker-py versions.
6 years ago
René Moser 83ec418470
cs_loadbalancer_rule_member: fix error handling (#46012)
* make use of query_api
* fix sanity
6 years ago
Abhijeet Kasurde 905acd7c9e
VMware: vmware_inventory contrib testing (#42879)
* VMware: vmware_inventory contrib testing
* Use python.py to run inventory script during test.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Clay 54937ba784 Fix ansible-test docker python version handling.
This removes the old name based version detection behavior and
uses versions defined in the docker completion file instead, as
the new containers do not follow the old naming scheme.
6 years ago
Sloane Hertel 18dc928e28
Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.
6 years ago
Matt Clay 7d8f1a7aae Disable failing sts_assume_role integration test. 6 years ago
Matt Clay 339d22a2bd
Improve stability of Docker integration tests. (#46005) 6 years ago
Matt Clay d603cd41fe Fix integration test library search path.
This prevents tests from loading modules outside the source tree,
which could result in testing the wrong module if a system-wide
install is present, or custom modules exist.
6 years ago
Matt Clay ac492476e5
Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports.
* Clean up ConfigParser usage in ansible-test.
* Fix bare except statements in ansible-test.
* Miscellaneous cleanup from PyCharm inspections.
* Enable pylint no-self-use for ansible-test.
* Remove obsolete pylint ignores for Python 3.7.
* Fix shellcheck issuers under newer shellcheck.
* Use newer path for ansible-test.
* Fix issues in code-smell tests.
6 years ago
Sam Doran b60854357b
Unify terms and UI between 1Password lookups and facts module (#45427)
* Unify login behavior between 1Password lookup plugins and module

- Use the same names for all credential aspects
- Only require the minimal amount of information for each
- Add more examples

* Change parameter terms

- use terms in line with 1Password documentation.
- update examples
- update tests

* Improve error messages in lookup plugin

* Unify onepassword_facts with lookup plugins

- use same methods and logic for signing in or reusing existing session
- unify terms with lookup plugins

* Change rc test for determing login

An rc other than 1 can be returned when a current login session does not exist.

* Create AnsibleModuleError class

ansible.errors is not available to modules, so create an AnsibleModuleError class within the module

Do not user os.path.expanduser since this is already done by virtue of the type being "path" in the argument spec.

* Add note about risk with fact caching sensitive data

* Add note on op version that was used for testing
6 years ago
Matt Clay 45b5685037 Add python.py coverage injector for ansible-test.
This can be used to run Python scripts from the repository with the
correct interpreter and allow collection of code coverage.

Useful for testing contrib inventory scripts.
6 years ago
Matt Clay 2148999048 Improve error handling for docs-build test. 6 years ago
tstoner 216da1c475 Changed when condition from checking image version to checking keys being (#45943)
defined
6 years ago
Matt Clay 2056c981ae Improve ansible-test match error handling. 6 years ago
Jordan Borean 27c10fa502
add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording
6 years ago
Jordan Borean 198423d6fb
powershell: do not quote join_path result to reflect ShellBase join_path (#45944) 6 years ago
Andrew Gaffney acac001742 Add number of skipped tasks to play recap in 'default' callback (#45797) 6 years ago
Matt Martz 95e77ac853
Ensure that the src file contents is converted to unicode in diff info (#45744)
* Ensure that the src file contents is converted to unicode in diff info. Fixes #45717

* Fix up and cleanup

* The diff functionality in the callback plugins should have the
  to_text() calls removed since we're now doing it in ActionBase
* catching of UnicodeError and warnings in the callback diff
  functionality from 61d01f549f haven't been
  needed since we switched to to_text so remove them.
* Add a note to ActionBase's diff function giving an example of when the
  diff function will be inaccurate and how to fix it

* Fix callback get_diff() tests

I believe the unittests of callback's get_diff() were wrong.  They were
sending in a list where strings were expected.  Because previous code
was transforming the lists into strings via their repr, the previous
tests did not fail but they would have formatted the test cases output
in an odd way if we had looked at it.
6 years ago
Dag Wieers 24dd87bd0a Fix incorrect use of subprocess.CalledProcessError (#45890) 6 years ago
Rémy Léone 7c7a7efbbe Add an option to enable public ip at server creation (#44826) 6 years ago
max-allan-surevine cb460dee74 Update keycloak_client.py (#43547)
* Update keycloak_client.py to document the 'realm' parameter, eliminate E322 ignore
6 years ago
Nathaniel Case 406b59aeba
Move persistent connections to only use registered variables (#45616)
* Try to intuit proper plugins to send to ansible-connection

* Move sub-plugins to init so that vars will be populated in executor

* Fix connection unit tests
6 years ago
Jordan Borean 5c73d4f4bd
async: use async_dir for the async results file directory (#45461)
* win async: use async_dir for the async results file directory

* tried to unify POSIX and PowerShell async implementations of async_dir

* fix sanity issue
6 years ago
Matt Clay 5a3000af19 Support comments in ansible-test flat files. 6 years ago
Dag Wieers cb4bf04be6 Fix pylint error on utf8 character in string (#45880)
Small fix
6 years ago
Matt Clay f3d1f9544b
Make ansible-test available in the bin directory. (#45876) 6 years ago
Jordan Borean 582a4dfa13
append AWS region to test instance file (#45877) 6 years ago
Zim Kalinowski 83645963fb Fixing assigning ssl certificate to http listener in app gateway (#45830)
* fixed ssl certificate reference

* modified test
6 years ago
Zim Kalinowski 16fa49a894 adding os disk name (#45126)
* adding os disk name

* fixed test
6 years ago
Jordan Borean a7d372c3ba
go back to FreeBSD 11.1 for tests due to 11.2 stability issues (#45872) 6 years ago
Eric Helms 74b94e119e Deprecate foreman and katello modules (#42043)
* Deprecate foreman and katello modules in 2.8, remove in 2.12
6 years ago
Felix Fontein bc69aeca7f Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility.

* Adding unit test.

* PEP8.

* Changelog.
6 years ago
Daniel Speichert d34cf93f1a Migrate from MySQLdb to PyMySQL (#40123)
* Migrate from MySQLdb to PyMySQL

* Deduplicate driver loading and failure message

* Explain requirements

* Apply requirements docs change to proxysql too

* Add changelog
6 years ago
Pilou 60160c1e90 doc: exercising module code locally: update cmd (#45697)
The documented way to execute module code locally wasn't always working:

    $ python ./lib/ansible/modules/files/file.py <<< '{"ANSIBLE_MODULE_ARGS": {}}'
    Traceback (most recent call last):
      File "./lib/ansible/modules/files/file.py", line 177, in <module>
        from ansible.module_utils.basic import AnsibleModule
      File "~/ansible/lib/ansible/module_utils/basic.py", line 78, in <module>
        import tempfile
      File "~/ansible/lib/ansible/modules/files/tempfile.py", line 69, in <module>
        from tempfile import mkstemp, mkdtemp
    ImportError: cannot import name 'mkstemp'
6 years ago
Dag Wieers 2edf20d1ed Docs: Avoid use of 'default: null' (#45795)
Various modules document the default 'null' value, but it causes None to
be shown in the documentation explicitly.
6 years ago
Felix Fontein 6e04a1dbdc integration tests for docker_container (#45747)
* First round of integration tests for docker_container.

* Added regression test for #45700.

* Work around dict order randomization.
6 years ago
Matt Clay 846ee7e85f Fix issues with docker_stack test:
- Leave swarm at end of test to avoid breaking docker_swarm test.
- Do not update stack to avoid error leaving swarm.
- Put test back in correct group.
6 years ago
Tim Rupp ccfbed3dbc
Adds bigiq_device_facts module (#45822)
This module can be used to query a variety of facts from a BIG-IQ
6 years ago
Matt Clay 99cac99cbc Block network access for unit tests in docker. 6 years ago
Matt Clay be199cfe90 Minor fixes for unit test delegation. 6 years ago
Julien PRIGENT 6059246093 EFS - add support for new Provisioned Throughput (#43253)
* efs.py: Add support for EFS provisioned throughput

* efs_facts.py: Add support for EFS provisioned throughput

* efs_facts integration tests updated with provision throughput

* efs_facts: Tests refactoring - add failure and success playbook according to botocore version.

* efs_facts: More tests and new option descriptions adjustment

* efs_facts tests renamed to efs
6 years ago
René Moser 1ed3bd9168
vultr: fix for unreliable API behavior (#45712) 6 years ago
Matt Clay abe8e4c9e8
Run unit tests in parallel. (#45812) 6 years ago
Matt Clay 06e2e0e040 Change group on docker_stack test.
This should provide a temporary fix for conflicts with the docker_swarm test.
6 years ago
Matt Clay 379a7f4f5a
Fix ansible-test unit test execution. (#45772)
* Fix ansible-test units requirements install.
* Run unit tests as unprivileged user under Docker.
6 years ago
Dario Zanzico 54c3d1c24e New module: add docker_stack module (clound/docker/docker_stack) (#24588)
* add docker_stack module + tests
6 years ago
Matt Clay 53b230ca74 Fix unit test parametrize order on Python 3.5. 6 years ago
Matt Clay 0686450cae
Fix unit tests which modify the source tree. (#45763)
* Fix CNOS unit test log usage.
* Use temp dir for Galaxy unit tests.
* Write to temp files in interfaces_file unit test.
* Fix log placement in netapp_e_ldap unit test.
6 years ago
Will Thames d2569a3f7d Improve iam_group exception handling (#45599)
* Improve iam_group exception handling

Use AnsibleAWSModule for iam_group and handle BotoCoreErrors
as well as ClientErrors. Use fail_json_aws to improve error messages

* Add minimal iam_group test suite

Update some of the read-only IAM permissions (this is not sufficient
to run the test suite but it gets further than it did until it tries
to add a (non-existent) user)

* Clean up after tests
6 years ago
Sloane Hertel 2167ce6cb6
Remove placeboify from unit tests that are not calling AWS (i.e. creating a recording) (#45754) 6 years ago
Sloane Hertel 5467ac3454
[aws unit test utils] only create a recordings directory when the env var is set (#45752)
* Only create placebo recording test directories when the environment variable PLACEBO_RECORD is set
6 years ago
Aidan Feldman fa18d45eb3 Link to the Galaxy platforms list from the meta file template (#34046)
* Link to the Galaxy platforms list from the meta file template
Fixes https://github.com/ansible/galaxy/issues/52.
* make ansible/ansible text match mazer text on platforms
6 years ago
Sloane Hertel d7ca3f2bd3 ec2_group: fix regression for targets that are a list containing strings and lists (#45594)
* Fix targets that may be a list containing strings and lists which worked prior to 2.6.

* Add ec2_group integration tests for lists of nested targets

* changelog

* Add diff mode support for lists of targets containing strings and lists.
6 years ago
John R Barker 78201d1c32 Allow removed_in: 2.12 (#45732) 6 years ago
David Passante 05328ebf21 Cloudstack: fix support for some VPC service capabilities (#45727)
* Fix support for VPC capabilities such as redundant routers or region level VPC

* Add integration test cases for "region level VPC" and "distributed router" capabilities
6 years ago
Matt Clay e7426e3795
Minor cleanup of code-smell tests. (#45658)
* Minor cleanup of code-smell tests.
* Add exception handling for YAML load.
6 years ago
Maugli 235b11f681 Return correct version on installed VyOS (#39115)
* Return correct version on installed VyOS

Previously existing regexp will shows only "VyOS" without numeric output of router version.
For example: from  "Version:      VyOS 1.1.6" only VyOS will be written in ansible_net_version variable
For more informative output numeric value should be returned as well

* Fixed unittests
6 years ago
John R Barker 822236810e
BOTMETA Validator + Bulk tidyup, support:(core,community,network) (#44903)
plugins/ is COMMUNITY
Set sensible defaults for directories
support:network for the platforms that we Networking SUPPORTS,
everything else is COMMUNITY
Mark other support:network (ansible-connection, etc)
Infoblox is support:core
contrib/ by definition should be support:community
Remove duplicated labels
Make yamllint happy(ier)
Adds sanity test to ensure BOTMETA.yml is valid
6 years ago
Pilou 9984c0fd40 hashi_vault lookup: add integration tests (#44814)
* hashi_vault lookup: add integration tests

* hashi_vault lookup tests: use ansible-ci-files
6 years ago
Anton Nikulin b7263eab1d Store Authorization header inside HttpApi connection plugin (#45598) 6 years ago
Nathaniel Case 285b927889
network command modules cleanup (#45242)
* Standardize _command modules

* Centralize command transformation process

* Fix check mode error test
6 years ago
Zim Kalinowski df768914a1 adding sql firewall rule facts (#45059) 6 years ago
Jordan Borean d81249994e
win_script: add support for become and centralise exec wrapper builder (#45582)
* win_script: add support for become and centralise exec wrapper builder

* satisfying the pep8 gods

* do not scan for module dependencies when running as a script
6 years ago
Nathaniel Case 0b433b3ea9
Clean up after cnos tests (#45564) 6 years ago
Anil Kumar Muraleedharan ac58c36ad0 Lenovo cli bugfixes (#45278)
* To change all CLIs present in the code to latest CNOS CLI. One bug of executing with Lenovo Jakku switch is also getting fixed.

* To change the file names as the commands have changed from display to show

* To change to new CLI in test_cnos_comand.py as well
6 years ago
Dag Wieers cbf2c2a000 Fix integration tests (#43847)
I doubt this is the correct test, but until we have this fixed/improved
at least this works fine.
6 years ago
Zim Kalinowski 111febe62e extended vmss facts (#45535) 6 years ago
Matt Clay c50d6f1944 Update RHEL and FreeBSD versions used for tests:
- RHEL 7.4 -> 7.5
- FreeBSD 11.1 -> 11.2
6 years ago
Deepak Agrawal 81214409cf
asa_config/ios_config: diff strict does not work with multiple parents (#45150)
* multiple parents issues in diff

* Integration tests for missing functionality

* add testcase for other platforms. vnxos does not support qos so need to find a command chain on v-nxos for multiple parets. junos uses on-device diff so should not need this.

* Fix for issue when any candidate parent did not meet the exact line in running-config

* DCI runs eos_config without become flag
6 years ago
Matt Clay d478a4c3f6 Update default container to version 1.2.0. 6 years ago
Matt Martz 5785de582f
Fix logic to not re-download existing files when force=no (#45495)
* Fix logic to not re-download existing files when force=no. Fixes #45491

* Reduce logic complexity
6 years ago
Matt Clay c0bf9815c9 Fix ACI unit test on Python 3.7.0.
The previous logic was only needed for pre-release versions of 3.7.
6 years ago
Alicia Cozine 4264be2b18 Remove more docs build errors (#45364)
* orphans testing pages to avoid not-in-toctree errors

* orphans various pages pending reorg

* adds module_utils and special_vars to main TOC

* uses a glob for scenario_guide TOC

* normalize and Sentence-case headings on community pages, typos

* re-orgs community TOC, adds all pages to toctree

* removes scenario guides index page

* adds style guide to community index

* basic update to style guide

* fix typo that created a new error

* removes not-in-toctree from ignore errors list

* leave removing files for future cleanup task
6 years ago
David Rodríguez 600c7ac108 Fix remote checksums when paths have leading dots (#45287)
* Fix remote checksums with paths have leading dots

* Fix result recorded from the wrong file

* Add changelog fragment
6 years ago
Yuwei Zhou fa04387550 fix the autoscale resource id (#45477)
* fix the autoscale resource id

* Update main.yml
6 years ago
James Cassell 211aeebd0d remove unused templar._clean_data() (#42739) 6 years ago
Zim Kalinowski 8a221d81dd fixing facts for mysql server (#45374) 6 years ago
Jordan Borean 01398f61d5
Win deprecate 2.8 (#45473)
* Remove deprecated/expired functionality

* win:_msi: Remove the win_msi module

* removed some missed deprecated return options and added porting guide reference

Co-authored-by: dagwieers <dagwieers@users.noreply.github.com>
6 years ago
Jordan Borean ec6d82435f
win_scheduled_task: add deprecation warning for repetition format (#45468)
* win_scheduled_task: add deprecation warning for repetition format

* fixed up sanity issues
6 years ago
Jordan Borean 881f3a599c
windows testing - changes to accomodate future behaviour changes (#45464) 6 years ago
Zim Kalinowski 0b029d6792 adding tags support to postgresql (#45339) 6 years ago
Jordan Borean d4ce1b9f31
fix Ansible.ModuleUtils.FileUtil to respect ErrorAction if running in a try/catch (#45451) 6 years ago
Jordan Borean c9c141fb6a
win_say - fix up syntax and test issues (#45450) 6 years ago
Jordan Borean 25ae4f2b73
reordered windows test groups for better efficiency (#45445) 6 years ago
Matt Clay ed49f37957 Reduce cost of Azure DB tests. 6 years ago
Matt Martz 0015d4cef3
2.8 Core Deprecation Removal (#45232)
* Remove deprecated ansible.vars.unsafe_proxy. Fixes #45040

* Remove deprecated validate_md5 alias from fetch module. Fixes #45039

* Remove deprecated private arg from import/include_role. Fixes #45038

* All include deprecations bumped to 2.12. Fixes #45037

* Add changelog for deprecated removals
6 years ago
Jon Dufresne ef67d4074b Prefer io.BytesIO over six; available on all supported Pythons (#45388)
On all supported Pythons, the io.BytesIO is always a stream
implementation using an in-memory bytes buffer. Makes code slightly more
forward compatible by reducing use of the six module.
6 years ago
Zim Kalinowski e203531735 fixing broken sql server tags (#45378) 6 years ago
Matt Clay 1891827dfa Update default-test-container to 1.1.0. 6 years ago
Matt Clay 75d1cb3b05 Fix tower_project integration test.
Changes required due to https://github.com/ansible/ansible/pull/45158
6 years ago
Kevin Breit 6c67674eab meraki_mr_l3_firewall - Integration test fix (#45366)
* Fix integration test as wrong module was called

* Create block section for failures on integration test for mr_l3_firewall integration test
6 years ago
Will Thames 1463c2e4a8
Use a sensible default for k8s merge_type (#45284)
* Use a sensible default for k8s merge_type

The sensible default for merge_type is `['strategic-merge', 'merge'].
However, we can't make this the default default, as we need to support
users who are using openshift 0.6.0, where the merge_type parameter is
unsupported.

* Refactor k8s test suite for merge_type tests

Allow tests with pre-merge-type openshift and post-merge-type
openshift.
6 years ago
jctanner ab133def0b vmware_guest test - Use the cluster name instead of the path (#45368) 6 years ago
Alexander Bethke a3a189fc83 Add integration tests for flatpak_remote module
PR #42315
6 years ago