Commit Graph

48061 Commits (76f591e64c9ac4b3fcdcd3815db18d3cd42bb41c)
 

Author SHA1 Message Date
Abhijeet Kasurde 76f591e64c
[2.9] debconf: add a note about no_log usage (#70754)
debconf module exposes sensitive information to logs, console.
Add a note to user about using no_log=True to hide such
information from console.

Fixes: #32386

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 84b4387702)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Sam Doran 46a0e849ed
[stable-2.9] Handle Slackware OS version strings containing a plus (“+”) (#68142) (#70718)
A couple of years ago Slackware -current began using a plus (“+”) at the end of the distribution version string to indicate a future version work-in-progress.

Rearrange distribution_files unit tests to easily support more tests
  - add conftest with common fixtures
  - use parametrize for testing multiple scenarios

* Add changelog
* Add unit tests for Slackware distribution parsing
* Use correct fixtures for Slackware
Data comes from /etc/slackware-version

Co-authored-by: Sam Doran <sdoran@redhat.com>
Co-authored-by: <Eduard Rozenberg <eduardr@pobox.com>>.
(cherry picked from commit 566c5e6ce1)

Co-authored-by: Eduard Rozenberg <2648417+edrozenberg@users.noreply.github.com>

Co-authored-by: Eduard Rozenberg <2648417+edrozenberg@users.noreply.github.com>
4 years ago
Sviatoslav Sydorenko e5609db342
[backport][2.9][PR #70446] Refactor Python API examples and docs (#70851)
* Add boilerplate snippet into `examples/`

It is a partial backport of #70224

(partially cherry picked from commit 4816bb4f43)

* Refactor Python API examples and docs

PR #70446: it's a follow-up for #70445.

It includes a merge of `examples/scripts/uptime.py` and a similar
code snippet from `docs/docsite/rst/dev_guide/developing_api.rst`.

This patch also changes the docs RST file to include contents of
the example file instead of holding a copy of a similar code.

(cherry picked from commit 20bb915092)
4 years ago
Baptiste Mille-Mathias e55565e951
Create home and parent directories only when requested (#70789)
The home user and the parents directories should only be created when
create_home == True

(cherry picked from commit f3dd8d3052)
4 years ago
Abhijeet Kasurde 7833053223
[2.9] basic: use PollSelector implementation (#70801)
Some platform such as ESXi does not implement EpollSelector,
which is selected by DefaultSelector. Use PollSelector which is
based upon 'Poll' implementation. This works perfectly with
a platform like VMware ESXi.

Fixes: #70238

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 8cccede0d4)
4 years ago
Nathaniel Case f7aff6b888
[stable-2.9] Document existing ansi_re sequences and add `ESC[m` (#70683) (#70808)
* Document existing ansi_re sequences and add `ESC[m`

* Add changelog
(cherry picked from commit 06a4fc2)

Co-authored-by: Nathaniel Case <ncase@redhat.com>
4 years ago
Sviatoslav Sydorenko 3fe5da947b
Fix the internal Python API usage examples (#70842)
Previous version initialized the `TaskQueueManager` after calling
`Play.load()` while advertising a way to inject a custom library
location path. This caused the tasks loader not to find any custom
modules because it was triggered before the path was actually added
to the module loader.

This patch changes the order of the operations to ensure that the
customized `context.CLIARGS` actually influences things.

Resolves https://github.com/ansible/ansible/issues/69758.

(cherry picked from commit 8d97c8c222)
4 years ago
Abhijeet Kasurde 78592ffd68
profile_tasks: typecast result before slicing it (#70835)
Backport of https://github.com/ansible-collections/ansible.posix/pull/15

Fixes: #59059

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
David Shrewsbury 76815d3afc
Sanitize URI module keys with no_log values (#70762) (#70821)
* Add sanitize_keys() to module_utils.

* More robust tests

* Revert 69653 change

* Allow list or dict

* fix pep8

* Sanitize lists within dict values

* words

* First pass at uri module

* Fix insane sanity tests

* fix integration tests

* Add changelog

* Remove unit test introduced in 69653

* Add ignore_keys param

* Sanitize all-the-things

* Ignore '_ansible*' keys

* cleanup

* Use module.no_log_values

* Avoid deep recursion issues by using deferred removal structure.

* Nit cleanups

* Add doc blurb

* spelling

* ci_complete

(cherry picked from commit bf98f031f3)
4 years ago
Rick Elrod 3735d71b5e
Add ansible-releases@redhat.com to announce template (#70814)
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran 2a38a6cca6
[stable-2.9] reboot - fix Void Linux (#70704) (#70917)
Add entry for appropriate commands for Void Linux
(cherry picked from commit 4cc4cebc97)

Co-authored-by: fosslinux <fosslinux@aussies.space>
4 years ago
Bill Dodd 8870ea5b8c
fix error decoding Redfish response payloads on Python 3.5 (#70924) 4 years ago
Sam Doran 435d0feae1
[stable-2.9] lineinfile - fix broken exception handling (#70846) (#70945)
* prevent (ExceptionType) is not subscriptable errors
* tweak error message and use text conversion
* add to_text import
(cherry picked from commit 45c2eb6c0a)

Co-authored-by: nitzmahone <nitzmahone@users.noreply.github.com>

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
4 years ago
Jordan Borean 74d5391f73
ansible-galaxy - fix fallback for AH searches (#70957) (#70983)
(cherry picked from commit b1cb2553af)
4 years ago
Matt Clay c37acc7740
[stable-2.9] Fix ansible-test relative import analysis. (#70994)
(cherry picked from commit 2e0097ada3)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sam Doran 59a409193d
[stable-2.9] facts - fix incorrect time for some date_time_facts (#70665) (#70997)
* [stable-2.9] facts - fix incorrect time for some date_time_facts (#70665)

The iso8601_micro and iso8601 facts incorrectly called now.utcnow(), resulting
in a new timestamp at the time it was called, not a conversion of the previously
stored timestamp.

Correct this by capturing the UTC timestamp once then calculating the local
time using the UTC offset of the current system.

* Use time.time() for getting the current time
* Convert from that stored epoch timestamp to local and UTC times
* Used existing timestamp for epoch time
* Add unit tests that validate the formate of the return value rather than an exact value since mocking time and timezone is non-trivial
(cherry picked from commit c4f442ed5a)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* Remove tests for tz_dst since that fact only exists in newer versions
4 years ago
Nilashish Chakraborty 87364a3286
nxos_user: Do not fail when a custom role is used (#71054)
(https://github.com/ansible-collections/cisco.nxos/pull/130)

Reviewed-by: https://github.com/apps/ansible-zuul
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
4 years ago
Sam Doran 0399960e34
[stable-2.9] unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666) (#71002)
* [stable-2.9] unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666)

Add integration tests for unarchiving as unprivileged user
Break tasks into separate files for easier reading and maintenance

Create a user by specifying a default group of 'staff' for macOS.

The user module does not actually remove the user directory on macOS,
so explicitly remove it.

Put the removal tasks in an always block to ensure they always run

Co-authored-by: Philip Douglass <philip.douglass@amadeus.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>.
(cherry picked from commit ac5f3f8bef)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>

* [stable-2.9] Fix unstable unarchive test (#71004)

* Add mode to copy tasks
* Fix unreliable test by ignoring errors

(cherry picked from commit f99f96ceb6)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>
4 years ago
Martin Krizek 4f732c9ce9
Emit proper error for `x in y` when y is undefined (#70990) (#71012)
Fixes #70984

(cherry picked from commit bf7276a4e8)
4 years ago
Sam Doran 0ecb2abf43
[stable-2.9] linux facts - return proper broadcast address (#64528) (#71065)
* linux facts - return proper broadcast address

Check that the value being returned is actually a broadcast address

* Add tests

* Cleanup tests
(cherry picked from commit e6bf202738)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Martin Krizek f097589fb2
2.9: YUM: Ensure we have enough values to split (#56802) (#71104)
* Ensure we have enough values to split (#56802)

Avoid raising an exception if pkgstr does not complains with expected
value.

(cherry picked from commit 433c98eae0)

* Add changelog

Co-authored-by: Adrián López <adrianlzt+github@gmail.com>
4 years ago
Alicia Cozine cea92ad2cd
use security_fix category in changelogs (#71071)
* use security_fix category in changelogs

(cherry picked from commit 3d5217b6d5)

* these fragments do not say CVE but are security fixes

(cherry picked from commit 8d0c1ff51d)

Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
4 years ago
Matt Clay e5ec3f8578 [stable-2.9] Cap pytest version to avoid relative import issue.
(cherry picked from commit 3a8ac62596)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Rick Elrod 53a1885ab5
Make changelog tool be more strict about suffixes (#70798)
* Make changelog tool be more strict about suffixes

Change:
- Files must end in .yml or .yaml, and must not be dotfiles.
- This is to prevent (for example) emacs backup files (.yml~) from being
  included in changelogs during releases.
- Backport of https://github.com/ansible-community/antsibull-changelog/pull/33

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Jordan Borean 4d675b6d87
win_reg_stat fix up broken test (#70830) 4 years ago
John R Barker 2dd7942073
Update Molecule support contact (#70797) (#70805)
As Molecule started to use https://github.com/ansible-community/molecule/discussions we need to update documentation before retiring
the molecule-users mailing list.

(cherry picked from commit b7ee07215d)

Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com>
4 years ago
Rick Elrod 7f7d01c0ce Remove erroneous changelog entry from .change.yaml too
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 4941cc861d Remove erroneous changelog entry
Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod bef5ebba6e Update Ansible release version to v2.9.11.post0. 4 years ago
Rick Elrod 34d1fac39b New release v2.9.11 4 years ago
Jordan Borean a1e6884f96
win async - use full path for powershell (#70703) (#70713)
(cherry picked from commit 154efd97f2)
4 years ago
Felix Fontein 6c56c5c2ab
docker_container: make sure to_text() and to_native() are used instead of str() (#642) (#70646)
* Make sure to_text() and to_native() are used instead of str().

* Add changelog.

* Quoting should stay.

Backport of 8b92e0454d
4 years ago
Matt Martz f556b6cdd8
[stable-2.9] Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607) (#70642)
* rebase conflicts

* [stable-2.9] Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607).
(cherry picked from commit a77dbf0866)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Abhijeet Kasurde 4f978af4ca
[2.9] pipe: update docs for Popen with shell=True usage (#70603)
pipe lookup plugin uses Popen with shell=True intentionally.
This is considered a security issue if user input is not validated.
Updated docs to reflect this information for the user. Also, added
Bandit B602 documentation link for further reading.

Fixes: #70159

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit e5649ca3e8)
4 years ago
Abhijeet Kasurde 879b9fb2ab
[2.9] selective callback: mark task failed correctly (#70581)
Added additional condition to detect failed task in
selective callback plugin when ran with loop or with_items.

Fixes: ansible/ansible#63767

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Nilashish Chakraborty d1b71e56a4
enabled check mode on nxos bgp modules (#57360) (#70578)
* enabled check mode on nxos bgp modules

* fixed indentation

* spaces instead of tabs

(cherry picked from commit 79ab8cb48d)

Co-authored-by: Jacob Snapp <7643439+jacobsnapp@users.noreply.github.com>
4 years ago
Brian Coca 00eb2edc09
Make filter type errors 'loop friendly' (#70417) (#70575)
- ensure we preserve the typeerror part of the exception so loop defereed error handling
 can postpone those caused by undefined variables until the when check is done.
 - fix tests to comply with the 'new normal'

 - human_to_bytes and others can issue TypeError not only on 'non string'
 but also bad string that is not convertable.

Co-authored-by: Sloane Hertel <shertel@redhat.com>

Co-authored-by: Sloane Hertel <shertel@redhat.com>
(cherry picked from commit cf89ca8a03)
4 years ago
Brian Coca 23f11081eb
try to capture better winrm/put_file error (#70508) (#70571)
* try to capture better winrm/put_file error

fixes #70361

* Update lib/ansible/plugins/connection/winrm.py

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
(cherry picked from commit 8789d7968d)
4 years ago
Mykola Grygoriev a96288c5b4
Fix decrypt argument in assemble module (#70465) (#70559)
* Do not pass decrypt parameter to assemble module

* Add integration tests where decrypt=True

* Add changelog #70465

(cherry picked from commit 71c378e139)
4 years ago
Ken Dreyer 8bd8c09daf
[stable-2.9] podman: Add user flags before container id in podman exec (#70541)
* Add user flags before container id in podman exec

When user provides an ansible_ssh_user, podman connection
plugin includes this values as `--user` flag. This patch
fixes the location of this flag according to podman exec command help.

Fixes: ansible/ansible#65220

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Don't use mount in case of specified user

Co-authored-by: Sagi Shnaidman <sshnaidm@redhat.com>

(cherry picked from commit cc8d4bb4510bcc79537ed3fa591fb9cace576ae9)
4 years ago
David Shrewsbury a048dcba68
[2.9] Make sure ansible_become treated as a boolean (#70484) (#70527)
* Make sure ansible_become treated as a boolean (#70484)

* Make sure ansible_become treated as a boolean

(cherry picked from commit 8aca464b8b)

* Update test/integration/targets/inventory_ini/aliases

Co-authored-by: Sam Doran <sdoran@redhat.com>

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Yaakov Selkowitz eee4058c7e
k8s: update openshift requirements in documentation (#70479)
Backport of https://github.com/ansible-collections/community.kubernetes/pull/153
4 years ago
Matt Martz 6b054121d6
[stable-2.9] Use the first galaxy server supporting v1 for roles (#70375) (#70421)
* Use the first galaxy server supporting v1 for roles. Fixes #65440

* Add changelog fragment

* This is best effort, fall back to original behavior if something bad happens
(cherry picked from commit 1f1d6e5)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Abhijeet Kasurde 6789fa717a
puppet: Fix command line construction (#70463)
Fix command line construction in the puppet module
related to check mode and using manifests directly.

Also, fixes 69ead0ba78 which
introduced another if-statement in the middle of a if/elif pair,
which causes the elif to execute together with the original if
which created '--noop --no-noop' commands.

Fixes: #60576
4 years ago
Martin Krizek 99a37234b7
Fix delegate_facts with interpreter not being set (#70293) (#70385)
Fixes #70168

ci_complete

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit b05e00e99a)
4 years ago
Sloane Hertel c00009bc41
[2.9] Handle post_validate templating errors and add tests (#70240) (#70390)
* Handle post_validate templating errors and fix tests (#70240)

* Handle unexpected templating errors

* Fixes #70050

Fix up tests that weren't running and add tests for graceful templating error handling

(cherry picked from commit 30e70f4b63)

* changelog

ci_complete
4 years ago
Sam Doran 93f2f47d4c
[stable-2.9] Pin psutil version in tests (#70715)
A recent update to psutil introduced a breaking change
4 years ago
haiyuan_zhang a866aa5875
bug fixing in azure_rm_aks.py (#70227) 4 years ago
Abhijeet Kasurde 54787c07f3
[2.9] Fix json callback for non-lockstep strategy plugins such as free. (#70163)
Fixes: #65931

Backport of https://github.com/ansible-collections/ansible.posix/pull/8
4 years ago
Bruno 1465adcb95
nmcli: Add compatibility for new networkmanager library (#65726) (#70152)
Fixes: #48055
* add compatibility for new networkmanager library
* update debian/ubuntu docs
* move import gi into try

(cherry picked from commit 663171e218)

Co-authored-by: Sascha Marcel Schmidt <torvitas@users.noreply.github.com>
4 years ago