Commit Graph

9335 Commits (685a4b6d3ff72186d2b4ffce73172a5446a71ccc)

Author SHA1 Message Date
Sloane Hertel d41e38435b
[2.9] CVE-2020-1746 - Remove the params module option from ldap_attr and ldap_entry (#68714)
* Remove the params module option from ldap_attr and ldap_entry

Module options that circumvent Ansible's option handling were disallowed
in:
https://meetbot.fedoraproject.org/ansible-meeting/2017-09-28/ansible_dev_meeting.2017-09-28-15.00.log.html

Additionally, this particular usage can be insecure if bind_pw is set
this way as the password could end up in a logfile or displayed on
stdout.

Fixes CVE-2020-1746

(cherry picked from commit 0ff609f1bc)

* Fix formatting for option names

Co-Authored-By: Felix Fontein <felix@fontein.de>

* Fix fail_json

* fix indentation error

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
5 years ago
Brian Coca 0b4788a71f prevent ansible_facts injection (#68431)
- also only replace when needed
 - switched from replace to index
 - added test to verify bogus_facts are not accepted

CVE-2020-10684

(cherry picked from commit a9d2ceafe4)
5 years ago
Brian Coca 51d2514753 fix vault temp file handling (#68433)
* fix vault tmpe file handling

 * use local temp dir instead of system temp
 * ensure each worker clears dataloader temp files
 * added test for dangling temp files
 * added notes to data loader

CVE-2020-10685

(cherry picked from commit 6452a82452)
5 years ago
Sloane Hertel c6c4fbf4a1 subversion module - provide password securely when possible or warn (#67829)
* subversion module - provide password securely with svn command line option --password-from-stdin when possible, and provide a warning otherwise.
* Update lib/ansible/modules/source_control/subversion.py.
* Add a test.

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit d91658ec0c)
5 years ago
Jordan Borean b2551bb694
ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 - 2.9 (#68601)
* ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 (#68596)

(cherry picked from commit a20a527014)

* Remove extra tests missing from rebase
5 years ago
Florian Apolloner 3bebeb9cc3 Fixed mysql_user module idempotency for long privilege lists. (Fixes #68044) 5 years ago
nkshrishail ea4f6e1539 nxos_lacp: updated tests to handle platforms not supporting lacp system mac command (#64074)
* Updated nxos_lacp tests to handle platforms not supporting lacp system mac command

* nxos_lacp: addressing comments

* nxos_lacp: Updating image tag search to include more tags

(cherry picked from commit 00193f27eb)

Add changelog for nxos_lacp fix
5 years ago
Egor Zaitsev 852b64b3ba
routeros_facts: prevent crash of module when ipv6 package is not installed (#68554)
* routeros_facts: fix crash when ipv6 is disabled

* Update 64958-routeros-facts-ipv6.yml
5 years ago
Abhijeet Kasurde eec5cc4f73 [2.9] VMware: Use existing DVPG network in vmware_guest_network
* Handle all cases of networks

Fixes: #65968

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit afb71c14bd)
5 years ago
Sam Doran 0e51aadd8e
[stable-2.9] Add CentOS 8 to the test matrix (#68025)
* Add CentOS 8 to the test matrix (#63649)

(cherry picked from commit 2a7623dd5c)

* Skip PostgreSQL tests on CentOS 8

The tests in devel have diverged significantly from what is in
stable-2.9. It is easiest to skip these test for CentOS 8 in this branch
since they are still being run in devel.
5 years ago
Graham Mainwaring 32f41334fb Fix colorization to not extend across newline boundary (#68517)
* Fix colorization to not extend across newline boundary

* Fix unit test to look for the newline outside the coloration

* Add changelog fragment

(cherry picked from commit 2068131589)
5 years ago
Abhijeet Kasurde 378434a148 passwordstore: Honor equal sign in userpass
passwordstore lookup plugin now can handle equal sign in user input

Fixes: ansible/ansible#68265

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Sam Doran 1f304ef372 win_unzip - normalize and compare paths to prevent path traversal (#67799)
* Actually inspect the paths and prevent escape
* Add integration tests
* Generate zip files for use in integration test
* Adjust error message

(cherry picked from commit d30c57ab22)
5 years ago
flowerysong 938fb16069 adhoc: Load callbacks before sending v2_playbook_on_start (#67673)
(cherry picked from commit 370f788731)
5 years ago
Zhanwei Wang f7c63c1201 get_url pass incorrect If-Modified-Since header(#67417) (#67419)
Fix #67417. HTTP header value of `If-Modified-Since` set by `get_url` does not follow HTTP protocol.

(cherry picked from commit 1097694355)
5 years ago
Matt Clay bf3cd041e7 Disable failing azure_rm_cosmosdbaccount test. 5 years ago
Matt Clay 8a14392a29 [stable-2.9] Update tests to use RHEL 7.8. (#68787)
* Update tests to use RHEL 7.8.

Keeping support for RHEL 7.6 since collections are still using it.

* Fix tests for RHEL 7.7+ due to extras repo name change..
(cherry picked from commit 04edd77c42)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Rick Elrod 89937180c5 Fix win_psrepository tests
Backport of a5414cb0e4

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Rick Elrod 7a861dd2f1
OpenSUSE15.1 container image + necessary test change (2.9 edition) (#68788)
* add changelog fragment

Signed-off-by: Rick Elrod <rick@elrod.me>

* Update changelogs/fragments/ansible-test-opensuse-15.1.yml

Co-Authored-By: Matt Clay <matt@mystile.com>

* Update docker.txt to use the OpenSUSE 15.1 container image

Signed-off-by: Rick Elrod <rick@elrod.me>

* handle installing mysql on suse

Signed-off-by: Rick Elrod <rick@elrod.me>

* attempt to get tests passing again

Signed-off-by: Rick Elrod <rick@elrod.me>

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Jordan Borean d6a82e6865
galaxy - preserve mode properly on artifact (#68418) - 2.9 (#68451)
* galaxy - preserve mode properly on artifact (#68418)

* galaxy - preserve mode properly on artifact

* Fix py2 encoding issue

* Update lib/ansible/galaxy/collection.py

Co-Authored-By: Matt Clay <matt@mystile.com>

* Use sane defaults instead of sourcing from tarfile

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 127d54b363)

* added mode to dir creation that was missed in backport
5 years ago
Jordan Borean 6703ffd21d [stable-2.9] win_unzip - LiteralPath fix (#66972)
* win_unzip - LiteralPath fix

* Fix up Python sanity issues
(cherry picked from commit 2a9ec8975f)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
5 years ago
Matt Clay 8377f03eb2 Increase unit test timeouts. 5 years ago
Sam Doran 1f2758af20
ansible-galaxy - fix role list bug (#67391) (#67619)
Properly list roles even when the role name is the same or a substring of the
path to the role.

(cherry picked from commit c64202a495)
5 years ago
Jordan Borean 47fc7ab97d
galaxy - Fix collection install dep resolver for bad versions (#67405) (#67413)
* Also make sure version is a string and not an int/float

(cherry picked from commit 4881af2e7e)
5 years ago
Abhijeet Kasurde f8aaa7dcd2
[2.9] VMware: vmware_export_ovf module fix Python3 compatibility issue (#67514)
(cherry picked from commit 023a9b3166)

Co-authored-by: Diane Wang <41371902+Tomorrow9@users.noreply.github.com>
5 years ago
Jordan Borean 151d83efc3
win_credential - fix wildcard name (#67549) (#67552)
(cherry picked from commit d7059881a2)
5 years ago
Sam Doran f243b39ef3
[stable-2.9] Do not error if collection specified null dependencies (#67575) (#67618)
(cherry picked from commit cffead4631)

Co-authored-by: Alan Rominger <arominge@redhat.com>

Co-authored-by: Alan Rominger <arominge@redhat.com>
5 years ago
GomathiselviS 18377e6390
[2.9] Allow nxos_l2_interfaces to append the allowed vlans list (#67703)
* Added Fix - Allow nxos_l2_interfaces to append the allowed vlans list (#66517)

* Added Integration tests

* Corrected lint errors

* Added fix for bug # 54400

* Revert "Added fix for bug # 54400"

This reverts commit bf42db4269.

* Revert "Adding files for RM static_routes"

This reverts commit dafdd92d43.

* Revert "Added Integration tests"

This reverts commit 129dc87682.

* Bug Fix 65332

* Added testcase for #66517

* Removed unnecessary commit

* fixing conflicts

* fixing conflicts

* addressed mikeweibe's comments

* Corrected lint errors

* Added idempotent tc for add vlans

* Added replaced and overridded tcs for trunk vlan add

(cherry picked from commit 4ac89b8ac7)

* backport to PR #66517
5 years ago
Sloane Hertel afb389e588
Fix inline vaults for plugins in ensure_type (#67492) (#67741)
* Fix implicit string - only looked right because of the vault __repr__
* Add tests for strings and implicit strings

(cherry picked from commit 8eb00dd14c)
5 years ago
Felix Fontein 3fb4d109ce
acme_* modules: adjust documentation to reference RFCs 8737 and 8738 instead of the drafts (#67881) (#67882)
* Adjust documentation to reference RFCs 8737 and 8738 instead of the drafts.

* More references.

(cherry picked from commit 35fd86c6bc)
5 years ago
Jordan Borean 0f7d62f6a5
ansible-galaxy - optimise some paths and use fake galaxy int tests (#67685) - 2.9 (#67874)
* ansible-galaxy - optimise some paths and use fake galaxy int tests (#67685)

* ansible-galaxy - optimise some paths and use fake galaxy int tests

* Added init, built, and publish tests

* Test against both mocked Galaxy and AH server

* Finish off writing the install tests

* Fix up broken tests

* Rename test target and add migrated tests

* Use cloud provider for Galaxy implementation

* Added blank static config

* Use correct alias group

* Set release version and fix copy typo

* Remove reset step as it is no longer needed

* Use sane env var names for test container name

(cherry picked from commit 26129fcb80)

* Use --api-key and not --token

* Set fallaxy tests as a smoketest

(cherry picked from commit b241c021b7)
5 years ago
GomathiselviS 48bfa3e906
Fix to - eos_vlans using state parameter replaced is giving odd behavior (#67346)
* backport PR 67318

* added changelog file

* Added missing fixture file
5 years ago
Jordan Borean 9c1794ebfd remove unused import 5 years ago
kaorihinata 39cfb63be6
Allow no_log=False to silence the no_log warnings for module parameters (#64733) (#67439)
As AnsibleModule._log_invocation is currently implemented, any parameter
with a name that matches PASSWORD_MATCH triggers the no_log warning as a
precaution against parameters that may contain sensitive data, but have not
been marked as sensitive by the module author.

This patch would allow module authors to explicitly mark the aforementioned
parameters as not sensitive thereby bypassing an erroneous warning message,
while still catching parameters which have not been marked at all by the
author.

Adds tests for various no_log states including True, False, and None (as
extracted by AnsibleModule._log_invocation) when applied to an argument with
a name that matches PASSWORD_MATCH.

Fixes: #49465 #64656
(cherry picked from commit 3ca4580cb4)
5 years ago
Matt Clay 227f498314
stable-2.9: Restore Tower integration tests. (#67395)
* Move tower_common tests with tower_organization.

(cherry picked from commit c92697acec)

* Test: Bump TOWER_VERSION to supported version (#67378)

* Revert "Remove Tower module tests from CI. (#67368)"

This reverts commit b041d96762.

* Test: Bump TOWER_VERSION to 3.6.2

(cherry picked from commit b9bd2c25ca)

Co-authored-by: Yanis Guenane <yguenane@gmail.com>
5 years ago
Matt Clay 6f95e9629b
[stable-2.9] Remove Tower module tests from CI. (#67368) (#67371)
* [stable-2.9] Remove Tower module tests from CI. (#67368)

* Remove Tower module tests from CI.

The required AMIs are no longer available.

* Mark Tower tests as unsupported..
(cherry picked from commit b041d96762)

Co-authored-by: Matt Clay <mclay@redhat.com>

* Mark tower_common unsupported.
5 years ago
Sam Doran 04994e8dfb [stable-2.9] ansible-test - add constraint for virtualenv (#67289)
* ansible-test - add constraint for virtualenv

* Limit virtualenv only on macOS.

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit 8f296a6533)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Nilashish Chakraborty 54ca524da3
nxos_interfaces: RMB state fixes (#63960) (#67173)
* nxos_interfaces: RMB state fixes

* shippable fixes

* Add add'l comments per review

* fix long line

* Fix mode/enabled system defaults handling

* fix N3L test skips

* lint

* test updates for titanium images

* doc fix

(cherry picked from commit d72025be75)

Add changelog for nxos_interfaces fix

Co-authored-by: Chris Van Heuveln <cvanheuv@cisco.com>
5 years ago
Felix Fontein 569218f0cd
Fix removed_in_version to support honor suboptions (#66918) (#67104)
* Add unit tests.
* Fix reporting for removed_in_version.
* Add changelog.

(cherry picked from commit fe454d27a1)
5 years ago
Jiri Hnidek 69ba90098a
When no pool quantity is set, then do not set quantity to 1 (#66807) (#66933)
* Fixes #66478
* When no quantity is set, then candlepin server usually uses
  default value 1. When more quantities are required, then
  candlepin server can automatically choose correct minimal
  value.

(cherry picked from commit 6f1bb37feb)
5 years ago
Sumit Jaiswal f54263c459
Backport/2.9/55220 (#66757)
* Working Cisco IOS macro editing (fixes #55211) (#55220)

* Working Cisco IOS macro editing (fixes #55211)

* Working Cisco IOS macro editing [fixed pylints] (fixes #55211)

* Added integration tests for edit_macro

* Added conditional integration tests for ios_config macro

* Cosmetic fix: when near block for added conditional integration tests for ios_config macro

* Move teardown to always for block

(cherry picked from commit 4a0c875447)

* changelog

Co-authored-by: Albert Siersema <albert@mediacaster.nl>
5 years ago
Sumit Jaiswal f8c4a38ffe
Backport PR to fix the duplication of IPV6 address with replace state in ios_l3_interfaces module (#66680)
* fix 66530 (#66654)


(cherry picked from commit 0c4f167b82)

* changelog

* Update 66654-fix-ipv6-duplication-for-replace-state-ios-l3-interfaces.yaml

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
5 years ago
Ruediger Pluem 481327ec37
group - correctly determine if a local group exists. (#59772) (#67176)
Fixes #58619
Add integration test

(cherry picked from commit 80c4b86abe)
5 years ago
Florian Apolloner 361d7c677f
Fix DNF idempotency. (#66209) (#66578)
(cherry picked from commit a7e4479d01)
5 years ago
GomathiselviS 182831d8b0
Make banner detection non-greedy in ios_banner (#63092) (#66274)
* Make banner detection non-greedy in ios_banner (#63092)

* Make banner detection non-greedy in ios_banner

* Added ios_banner unit test to detect bug #63091

* Corrected PEP8 errors

* Added integration test

* Corrected typo in integration test

(cherry picked from commit 01a92f0191)

* Added changelog fragment

* Update 66274-ios_banner_nongreedy.yml

Co-authored-by: kalimsshar <34369784+kalimsshar@users.noreply.github.com>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
5 years ago
Jordan Borean 045fc371eb
win_uri: fix up tests (#67064) (#67066)
(cherry picked from commit 3ada0b2f65)
5 years ago
Sam Doran a2b5af86dd
[stable-2.9] include_vars - fix stack trace when run ad-hoc with dirs parameter (#66581) (#66910)
Add integration test

There are a number of other parameters that result in stack traces as well when this module is used ad-hoc. I'm not sure if we're interested in fixing them all since this module isn't meant to be run ad-hoc.
(cherry picked from commit cc2376b782)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran aaadf71438
[stable-2.9] tests: ipify_facts: retry on fail (#66897) (#66903)
(cherry picked from commit 91063f40d6)

Co-authored-by: Rene Moser <mail@renemoser.net>

Co-authored-by: René Moser <mail@renemoser.net>
5 years ago
Pilou 783daf9d1b
throttle: fix linear based strategies (#65422) (#66805)
* throttle tests: fix detection of parallel execution

The test wasn't able to detect if too many workers were running.

On my laptop:
- without this change, the 'throttle' target takes ~20 seconds
- with this change, the 'throttle' target takes ~70 seconds
- 1 second isn't long enough to encounter the issue

* Fix throttle test when strategy is 'free' based

'free' strategy allows multiple tasks to be executed in parallel: use
one 'throttledir' per task.

Use 'linear' strategy with a dedicated play for cleanup/setup tasks

* throttle: reset worker idx before queuing a new task

* TestStrategyBase: define task.throttle

otherwise '1' will be used instead of the default value due to the
following expression being equal to '1':

    int(templar.template(task_mock.throttle))

Co-authored-by: James Cammarata <jimi@sngx.net>
(cherry picked from commit bbbdc1c25c)
5 years ago
Sato Kenta 6df09ae41e
pamd: Fix AttributeError when removing the first or last rule (#66398) (#66776)
(cherry picked from commit a4b59d0213)
5 years ago