* Change test suite to fit expected behaviour
This reverts some changes from ansible/ansible@723daf3
If a line is found in the file, exactly or via regexp matching, it must
not be added again.
insertafter/insertbefore options are used only when a line is to be
inserted, to specify where it must be added.
(cherry picked from commit 31c11de2af)
* Implement the change in behaviour mentioned in the previous commit
(cherry picked from commit a4141cfa2e)
* Fix comment to reflect what the code does
(cherry picked from commit 150f5cb232)
* Set the correct return message.
In these cases, the lines are added, not replaced.
(cherry picked from commit 3216c31401)
* Add a changelog
(cherry picked from commit c39cf6b332)
* Fix various bugs related in reboot
- Use format strings for consistency and improve debug log messages
- Use local variables instead of class attributes in order to be thread safe
- Run setup module to get distribution and version
- Run find module to get full path of shutdown command
- Use ansible_os_family and ansible_distribution to find commands and args
- Use same command for all Solaris/SunOS distributions
- Move delay calculations to properties
- Reliably check for module run failure
- Fix bug in run_test_command() that accidentally made the method work properly
- Use better exceptions rather than Exception
- Use dict literals rather than constructors
- Correct _check_delay() so it always returns a value, not None
- Don't store and return result in run_test_command() because it's not used anywhere
- add test for post reboot command that fails
- test negative values for delay parameters.
(cherry picked from commit c1589c33c4)
Co-authored-by: Sam Doran <sdoran@redhat.com>
* Add `env` command to ansible-test and run in CI.
* Avoid unnecessary docker pull.
(cherry picked from commit 01833b6fb1)
Co-authored-by: Matt Clay <matt@mystile.com>
Hopefully this will work around the intermittent CI failures due
to NullReferenceException, which then succeed on a retry.
(cherry picked from commit 4bd60c313b)
Co-authored-by: Matt Clay <matt@mystile.com>
* docker_swarm: fix minimal API version (#49691)
* Reduce minimally required docker API version to 1.25, with selective features requiring 1.30.
* Adjust test requirements.
* Forgot some imports.
(cherry picked from commit 495a426039)
* Add changelog for docker swarm minimum api fix
* fix: ensure than all item of a list of excluded files aren't checked (#45122)
* fix: ensure than list of excluded files aren't checked
* test: exclude a list of files
(cherry picked from commit 4f9f1754b4)
* added changelog
* Add passlib to RHEL test instance
This looks like the only tests instance that is missing this libary. It is needed for vars_prompt tests.
* Create setup roles for pexect and passlib
Switch to using aliases rather than installing directly in the test scripts
(cherry picked from commit 96c2375692)
* create local subversion server for tests
* fix sanity issues
* don't touch system config when bringing up site
* removed original setup files
* fix opensuse config
(cherry picked from commit 0420d606de)
* Fix for changes in clearlinux
clearlinux is now providing /etc/os-release file and ansible is identifying as NA
then this change allow ansible to find it
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
* Add changelog fragment for clearlinux changes
Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
(cherry picked from commit 6d42c5020a)
* VMware: Fix module usages in module_utils
* Skip test for Python 2.6 as SSL context is not available in Python 2.6
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 1b04571ea0)
-Add: Mention bitbucket dropping TLSv1 and TLSv1.1 support as per 01 Dec 2018, potentially causing issues with older clients.
(cherry picked from commit a6db7f7abd)
Co-authored-by: Xaroth <xaroth+github@xaroth.nl>
* templar: ensure that exceptions are handled
* Fix AttributeError: object has no attribute 'message'
'message' attribute is deprecated since Python 2.6 and not available
with Python 3.
Simple reproducer:
- hosts: localhost
vars:
not_json: "{{ 'test str' | from_json }}"
tasks:
- command: "echo {{ not_json }}"
(cherry picked from commit 62c05033d6)
* Use expect module to copy files
* Remove old and redundant upgrade files
* Return error message instead of code
* Cleanup copy command code
* Fix force issue in nxos_install_os
* new nxos_install_os integration tests
* Uncomment transport tests
* Revert negative test change
* Remove combined option that is no longer required
* Make shippable happy
* Add n5k test files
(cherry picked from commit a721572206)
* Fix lookup_passwordstore test skipping.
Skip all of RHEL instead of specific versions.
Skip all of CentOS < 7 instead of specific versions.
This makes the test more robust when testing newer versions.
Tests could be executed on RHEL if EPEL was installed during the test.
(cherry picked from commit 704dae2cda)
It is currently supported only with the `--remote` option.
This makes it easier to troubleshoot new instances which are not
yet supported by the setup scripts used by ansible-test.
(cherry picked from commit 0826a00803)
* Support skip of platforms by version in tests.
Previously a remote platform could be skipped completely using the alias:
`skip/{platform}` such as `skip/rhel`
Now a specific platform version can be skipped using the alias:
`skip/{platform}{version}` such as `skip/rhel7.6`
This feature is available for platforms specified with the `--remote` option.
* Add skip by version to the docs.
(cherry picked from commit 8066acc90c)
* [stable-2.7] pip: Fix the mistake replacement from 'distribute' to 'setuptools' (#47403)
* Fix the mistake replace from distribute to setuptools
* Add a testcase for this bug
(cherry picked from commit 93c5781)
Co-authored-by: Zhikang Zhang <zzhang63@ncsu.edu>
* Add a change note
* Added changelog fragment
* Fix comparison of determining which rules to purge by ignoring descriptions (#48443)
AWS uses rule type, protocol, port range, and source as an idempotent identifier.
There can only be one rule with that unique combination. Rules that differ only by description are allowed but overwritten by AWS.
Add a test
Co-authored-by: Will Thames <will@thames.id.au>
(cherry picked from commit 54a2f21f93)
* 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
(cherry picked from commit 0bc5b79)
Co-authored-by: Justin England <justengland@gmail.com>
Fixes#48743
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit 4a06e95671)
fix up sanity tests and with_modules conditional
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit 23b60035a1)
fix yamllint sanity
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit 2b878546d3)
fix group-missing/invalid-group detection
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit 41176b5e0f)
* Check minimal API and docker-py versions for all docker_* tests.
* Improve docker_swarm creation/destruction for tests.
* Fail when conditions aren't met.
* Don't hardcode address for advertise_addr.
(cherry picked from commit 3bb41ccb8e)
We don't need to test with `upgrade: dist`, since we're not trying
to test the `apt` module. We just need to make sure the hold set
by the `dpkg_selections` module is working.
This change will avoid updating all the packages on the system,
which is slow, unnecessary, and can cause the installed python
to be changed.
(cherry picked from commit 136a2cca2f)
Track the interpreter for each copy of the injector by the interpreter
path instead of the interpreter version. This avoids the possibility
of mixing different interpreters with the same version.
(cherry picked from commit fa53b4805b)
Inject a symlink to the correct python into the copied injector
directory instead of altering the shebang of the injector. This
has the side-effect of also intercepting `python` for integration
tests which simplifies cases where it needs to be directly invoked
without collecting code coverage.
(cherry picked from commit d6bf45cd9d)
* Fix tests: use same command if not testing command option.
* Fix idempotency of init option.
* Fix shm_size idempotency (it is included in inspect results from docker API version 1.22 on).
* Add changelog.
(cherry picked from commit b1acabcd03)
* ec2_instance: ebs_optimized is not sub-option of 'network' (#48341)
* ebs_optimized is not suboption of 'network'
* Add Shaps as ec2_instance maintainer
* Added workaround-backward compatible check for ebs_optimized
* Added ebs_optimized test
* CI fixes, dynamic select of ENA-enabled AMI
(cherry picked from commit b7d9feb7dc)
* Added changlog fragment for PR #48341
* fixed yaml errors in changelog
PIP package names must be case insensitive, and must consider hyphens
and underscores to be equivalent
(https://www.python.org/dev/peps/pep-0426/#name), because of this the
module didn't work correctly in check mode. For example if the passed
package name had a different case or an underscore instead of a hyphen
(or the other way around) compared to the installed package, check mode
reported as changed, even though packages were installed. Now the module
ignores case and hyphens/underscores in package names, so check mode
works correctly.
(cherry picked from commit b89b688)
Co-authored-by: Strahinja Kustudic <kustodian@gmail.com>
* Simplify logic and add FreeBSD & NetBSD
* Remove incorrect flag for lock and unlock on FreeBSD
* Add tests and changelog
Co-authored-by: Chris Gadd <gaddman@email.com>
(cherry picked from commit f75a84e382)
Co-authored-by: Christopher Gadd <gaddman@email.com>
* user: fix removing the expiry time when it's 0
* Improve tests and add changelog
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
(cherry picked from commit 41dfc5162f)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
* yum also parse obsolete package output
This is a rebase of the patch originally proposed in
https://github.com/ansible/ansible/pull/40001 by machacekondra
Fixes#39978
Signed-off-by: Adam Miller <admiller@redhat.com>
* properly parse the obsoletes, provide a new output entry, add changelog
Signed-off-by: Adam Miller <admiller@redhat.com>
* make pep8 happy
Signed-off-by: Adam Miller <admiller@redhat.com>
* remove q debugging output
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit 091fb1dc3f)
This will avoid spontaneous test failure for new releases of openshift on PyPI.
(cherry picked from commit 150cdd7931)
Co-authored-by: Matt Clay <matt@mystile.com>
* Allow bang and exclamation without warning
Allow the password field to be ! or * without warning when using this feature to create accounts that are locked.
Add documentation and tests to cover this.
* Use set() rather than braces for Python 2.6
(cherry picked from commit 066af3b6ca)
Co-authored-by: Sam Doran <sdoran@redhat.com>
To ensure that the lvg module is tested for idempotency,
we add a basic integration test.
Support for MacOS and FreeBSD are skipped because the
module does not currently support those platforms.
(cherry picked from commit 204b40f706)
* cleanup is already tested.
* Add test for paused.
* Add recreate and restart tests.
* timeout is a common docker option
* Implement paused and fix paused test.
* Add changelog.
* Improve paused test.
(cherry picked from commit 65768b996d)
* More generic comparison code from docker_container to docker_common.
* More flexibility if a is None and method is allow_to_present.
Note that this odes not affect docker_container, as there a is never None.
* Update docker_secret and docker_config: simplify labels comparison.
* Added unit tests.
* Use proper subsequence test for allow_more_present for lists.
Note that this does not affect existing code in docker_container, since lists
don't use allow_more_present. Using allow_more_present will only be possible
in Ansible 2.8.
* pep8
(cherry picked from commit 73533d3fc2)
* Store parsed docker-py / docker API versions in client.
* Began refactoring 'minimal required version' for docker_container options.
* Removing some fake defaults.
* Added changelog.
* Improve tests (check older docker versions).
* Fix comparison. The breaking point is not docker-py 2.0.0, but 1.10.0.
(Verified by testing with these versions.)
* Move docker-py/API version detection to setup_docker.
* Add YAML document starter.
* docker_network requirement for docker-py was bumped to 1.10.0 in #47492.
(cherry picked from commit 3cca4185be)
* Use expect module to copy files
* Add force option for disruptive upgrades
* Revert changes to copy_kick_system_images.yaml
(cherry picked from commit c53e3ca8e9)
* Add support for POST-as-GET if GET fails with 405.
* Bumping ACME test container version to 1.4. This includes letsencrypt/pebble#162 and letsencrypt/pebble#168.
* Also use POST-as-GET for account data retrival.
This is not yet supported by any ACME server (see letsencrypt/pebble#171),
so we fall back to a regular empty update if a 'malformedRequest' error is
returned.
* Using newest ACME test container image.
Includes letsencrypt/pebble#171 and letsencrypt/pebble#172, which make Pebble behave closer to the current specs.
* Remove workaround for old Pebble version.
* Add changelog entry.
* First try POST-as-GET, then fall back to unauthenticated GET.
(cherry picked from commit 92d9569bc9)