* fix order of dnf api operations so transactions don't fail
Previously dnf.base.fill_sack() was called before
dnf.base.update_cache() which apparently breaks dnf transaction
logic as per https://bugzilla.redhat.com/show_bug.cgi?id=1658694Fixes#49060
Signed-off-by: Adam Miller <admiller@redhat.com>
* add changelog and test case
Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit ca084889c7)
* Fix mandatory statement error for junos modules
Fixes#40267
* Add error regex in junos terminal plugin to error out
in case of commit fails
* If commit fails add logic to discard changes before existing
else next task will result in error
* Add integration test
* Minor update
(cherry picked from commit cc8e90395a)
* 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>
* 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)
-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>
* 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)
* [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)
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)
* 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>
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)
* 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)
* Parsing plugin filter may raise TypeError, gracefully handle this exception
and let user know about the syntax error in plugin filter file.
* Test for plugin_filtering
Fixes: #46658
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit b32b4111b2)
* Addresses comments in #38971 (#44324)
* Controlled params within no section
* Added tests to control params within no section
* Cleaning output_file before creating no-section params and check the content
* addresses comment in PR "s/hate/beverage/g"
(cherry picked from commit d3fe6c01f2)
* 44324-ini_file
* Add docker_image_facts tests.
* Add basic integration test for docker_volume.
* Add basic docker_image tests.
* Only start test registry when tests are actually run (i.e. not on CentOS 6).
(cherry picked from commit f19ab56eb4)
The mysql-server package on Ubuntu16.04 was recently updated to disallow
unauthenticated root user login over tcp/ip. This, coupled with pymysql
using tcp/ip whenever host and port is specified causes us to fail to
connect to the database when testing Python3 on Ubuntu16.04.
The fix is to use the unix socket instead.
(cherry picked from commit 748ea39ecd)
* WinRM/PSRP: Ensure shell returns UTF-8 output
This PR makes UTF-8 output work in PSRP shells.
* Add win_command and win_shell integration tests
* Fix tests
* more test fixes
(cherry picked from commit 691ff4b9e6)
* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes#47454
* Add changelog fragment
(cherry picked from commit d5e4f37)
Co-authored-by: Matt Martz <matt@sivel.net>
* Behave better if auto_remove and output_logs are combined. Warn if output cannot be retrieved because of auto_remove.
* Add tests.
* Added changelog.
(cherry picked from commit 3afdb28209)
This reverts commit 0e933f76ba.
The tests for this were broken on centos6 because jinja2 does not have
a map filter on that platform. Tests need to be rewritten.
(cherry picked from commit ccabc2bff5)
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
* Ensure that k8s_facts always returns resources key (#46733)
Fix bug returning `items` key if NotFound exception is hit
(cherry picked from commit b772485d97)
* Add changelog for k8s_facts fix
* user: do not pass ssh_key_passphrase on cmdline
CVE-2018-16837
Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
(cherry picked from commit a0aa53d1a1)
* Ignore user module use of subprocess.
(cherry picked from commit 8d00afc013)
* Fix python3 problem in user module cve fix
(cherry picked from commit 9088671c4e)
* Fix changelog entry for user module CVE fix
(cherry picked from commit 210a43ebeb)
Set _notified_handlers for the task's _uuid that is run as a handler
Fix#47287
(cherry picked from commit 6497049)
Co-authored-by: Pablo <pablorf.dev@outlook.com>
* 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
(cherry picked from commit 0f5331645f)