Commit Graph

9424 Commits (0ecb2abf433e883b73cc45d283eabf7d665ec736)

Author SHA1 Message Date
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
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
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
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
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
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
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
GomathiselviS 38eb98bd91
[eos] [2.9] [backport] Turn on eapi by default. (#70119)
* Turn on eapi by default

Signed-off-by: GomathiselviS <gomathiselvi@gmail.com>

* added changelog
4 years ago
Brian Coca caaf295a37
return changed for group_by (#32057) (#69860)
* return changed for group_by

* added tests and fixed 'early registeration'

(cherry picked from commit 22da903e9c)
4 years ago
Sam Doran b8cae337cd
[stable-2.9] ansible_runner test - Add constraints (#70667) (#70670)
A recent updated to psutil, which is a dependency of ansible-runner, fails
to install on older versions of pip.

Commit with the breaking change:

  135628639b
(cherry picked from commit 9d27d7c8b1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Sam Doran f3872c4996 Disable hcloud_server_network test 4 years ago
Matt Clay 8b0484217f [stable-2.9] Default ansible-test provisioning to us-east-1.
Previously windows instances on Shippable would be automatically directed to us-east-2.
(cherry picked from commit 1cf26896c5)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 3b0e0a8194 Remove Azure module tests from CI. 4 years ago
Rick Elrod 194308ea97 pip tests, use py2 compat sampleproject fork
Change:
- sampleproject has gone py3 only. Use a py2 compatible fork.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sumit Jaiswal d672ee1c03
To backport ios_user and ios_command TC failure fix (#70253) 4 years ago
Sam Doran 89dfe82705
[stable-2.9] Pin version of netaddr in docker_container test (#70210) 4 years ago
Monty Taylor be2a3f520c Add an author exception for OpenStack Ansible SIG
The current author line wants to match a github author id. But
some people, including the OpenStack project, do not use github,
and additionally do not claim individual ownership but instead
group ownership.

Since there are already a couple of hard-coded examples in the
regex, just add one more. Alternately we could come up with some
mechanism to indicate that the author is purposely not listing
a github id, but that seems a bit heavywight.
4 years ago
Matt Clay 8b75da2af2 Fix ansible-test import analysis warning.
Fix overlooked in https://github.com/ansible/ansible/pull/68372/

(cherry picked from commit 77732ed50d)
4 years ago
Matt Clay 75d1213f9a Fix ansible-test change detection traceback.
(cherry picked from commit 53a3d1ffdb)
4 years ago
Matt Clay e80d736869 Fix ansible-test module_utils import analysis.
Now empty `*.py` files are ignored during module_utils import analysis for change detection.
This eliminates "No imports found" warnings for files which should have no imports.

(cherry picked from commit ab27680318)
4 years ago
Matt Clay f4b1604eba Fix ansible-test import analysis for collections. (#68352)
* Fix ansible-test import analysis for collections.

* Ignore plugins/module_utils/__init__.py

(cherry picked from commit 0ca3feb861)
4 years ago
Sam Doran cd7dfcebab [stable-2.9] Pin version of netaddr and jmespath in filters test 4 years ago
Matt Clay 6514ae6c05 Revert "Fix ansible-test module_utils import analysis. (#69406)"
This reverts commit b8808efd26.
5 years ago
Matt Clay a0c02d4c9d Revert "Fix ansible-test import analysis for collections. (#68352) (#69405)"
This reverts commit c333846097.
5 years ago
Matt Clay c8a94d0ad5 Revert "Fix ansible-test change detection traceback."
This reverts commit 58954ab77b.
5 years ago
Jordan Borean 84a60f1883
galaxy - preserve symlinks on build/install (#69959) (#69994)
* galaxy - preserve symlinks on build/install (#69959)

* galaxy - preserve symlinks on build/install

* Handle directory symlinks

* py2 compat change

* Updated changelog fragment

(cherry picked from commit d30fc6c0b3)

* Fix integration test

* ansible-galaxy - fix collection installation with trailing slashes (#70016)

If we fail to find a member when extracting a directory, try adding a trailing
slash to the member name. In certain cases, the member in the tarfile will
contain a trailing slash but the file name in FILES.json will never contain
the trailing slash.

If unable to find the member, handle the KeyError and print a nicer error.

Also check if a directory exists before creating it since it may have been
extracted from the archive.

Fixes #70009

* Add unit tests
* Use loop for trying to get members

(cherry picked from commit d45cb01b84)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Clay 58954ab77b Fix ansible-test change detection traceback.
(cherry picked from commit 53a3d1ffdb)
5 years ago
Abhijeet Kasurde f79c606aae
copy: ensure _original_basename is set (#70088)
* added changelog fragment
* added quick and basic test
* Revert "added quick and basic test"
* This reverts commit 75f4141656.
* added better tests
* now also creating files to copy on the remote
* removed tests for recursive copying which is not supported by remote_src

Fixes: #47050

(cherry picked from commit 79dfae9624)

Co-authored-by: Moritz Grimm <memo42@users.noreply.github.com>
5 years ago
Sloane Hertel 1f3185d3eb
Allow tasks to notify a fqcn handler name (#68213) (#70074)
* Allow tasks to notify a fqcn handler name

* Add tests. Fixes #68181

* Add changelog fragment

* Add test to ensure handlers are deduped properly with fqcn, role, and just handler names

* Add some docs about new special vars

(cherry picked from commit 087be1da50)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Hideki Saito b8a81973ee
Backport of dnf module logging (#69480) (#70066)
Signed-off-by: Hideki Saito <saito@fgrep.org>
5 years ago
Brian Coca e0322a0420
implemented 'prefix' for file based cache (#69872) (#70008)
* implemented 'prefix' for file based cache

Co-authored-by: s-hertel <shertel@redhat.com>
(cherry picked from commit ebb22655e4)
5 years ago
Alex Schultz a5c85b477b
Fix IncludedFile equality check (#69524) (#69885)
In the case of a free style strategy, it is possible to end up with
multiple hosts trying to include from the same role, however the tasks
being included may be different with the use of tasks_from.  Previously
if you had two hosts that were included the same role when the
process_include_results function tries to determine if a included needs
to be run on a specific host, it would end up merging two different
tasks into which ever one was processed first.

This change updates the equality check to also check if the task uuid
associated with the IncludedFile is the same. The previous check only
checked if the task's parent uuid was the same. This breaks down when
both includes have the same parent.

    - hosts: all
      strategy: free
      gather_facts: false
      tasks:
        - include_role:
            name: random_sleep
        - block:
          - name: set a fact (1)
            include_role:
              name: set_a_fact
              tasks_from: fact1.yml
          - name: set a fact (2)
            include_role:
              name: set_a_fact
              tasks_from: fact2.yml
        - name: include didn't run
          fail:
            msg: >
              set_a_fact didn't run
              fact1: {{ fact1 | default('not defined')}}
              fact2: {{ fact2 | default('not defined') }}"
          when: (fact1 is not defined or fact2 is not defined)

Closes #69521

(cherry picked from commit 247e43b252)
5 years ago
Matt Clay 7f31a7a488 [stable-2.9] Disabled inconsistent pylint checks.
(cherry picked from commit 8152d8bc1a)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Paul Belanger 16f0b7461c
Support `removed_at_date` in ansible-doc (#70002) (#70015)
* Support removed_at_date in ansible-doc

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

Changes:
  * ansible-doc does not support `removed_at_date` and assumes that
    deprecated dict will either have `removed_in` or `version`. This
    results in ansible-doc (and hence "sanity --test=ansible-doc")
    failing for modules having only `removed_at_date`.

  * This patch adds support for `removed_at_date` and also gives it
    precedence over `removed_in` or `version`.

* Add tests and changelog

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
(cherry picked from commit 9d6b0f2b03)
Signed-off-by: Paul Belanger <pabelanger@redhat.com>

Co-authored-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
5 years ago
Jill R 41bed21e20
ec2_group: Ensure group-based rule targets have consistent data formats (#69748)
Ensure group-based rule targets have consistent data formats throughout the module.
Backported from https://github.com/ansible-collections/amazon.aws/pull/33
5 years ago
Alex Schultz 4a5f9e87cc
Split regular and handler results into their own queues (#69498) (#69730)
When mixed with the free strategy (or any custom strategy that does not behave in
a lock-step manner), the linear methodology of _wait_on_handler_results may cause
race conditions with regular task result processing if the strategy uses
_process_pending_results directly. This patch addresses that by splitting the queues
used for results and adding a flag to _process_pending_results to determine which
queue to check.

Fixes #69457

(cherry picked from commit a4072ad0e9)

Co-authored-by: James Cammarata <jimi@sngx.net>
5 years ago
Nilashish Chakraborty 307d86de4b
Fix system default dict generation (#69690)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

Add changelog
5 years ago
Nathaniel Case d9366cb818
[stable-2.9] Allow the use of paramiko_conn before connection (#61570) (#69642)
* [stable-2.9] Allow the use of _paramiko_conn even if the connection hasn't been started. (#61570)

* Allow the use of _paramiko_conn even if the connection hasn't been started.

I'm not sure what the benefit is of Noneing paramiko_conn on close, but will keep for now

* Fix test

* Try to fix up net_put & net_get

* Add changelog.
(cherry picked from commit 50e09be14f)

Co-authored-by: Nathaniel Case <ncase@redhat.com>

* Restore check_prompt and task_uuid
5 years ago
Sam Doran a259d79ad6
[stable-2.9] Fix filedescriptor out of range in select() when running commands (#65058) (#69517)
* Fix filedescriptor out of range in select() when running commands

* Simplify the run_command() code

Now that we're using selectors in run_command(), we can simplify some of
the code.

* Use fileobj.read() instead of os.read()
* No longer use get_buffer_size() as we can just slurp all of the data
  instead.

Also use a simpler conditional check of whether the selector map is
empty

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>.
(cherry picked from commit f200487414)

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
5 years ago
Brian Coca 4f39d9ac65
avoid fatal tb on bad fqcn callback name (#69440) (#69496)
(cherry picked from commit 0aa76503dc)
5 years ago
Nilashish Chakraborty 156b302b4b
Fix issue with replaced (#69477)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

Add changelog
5 years ago
Daniel Mellado e652706d63
Add missing options for GRE interface (#69426)
This commit adds some missing options related to gre interfaces on
junos_interfaces module.

Cherry-picked from https://github.com/ansible-collections/junipernetworks.junos/pull/37
Fixes: https://github.com/ansible-collections/junipernetworks.junos/issues/36

Signed-off-by: Daniel Mellado <dmellado@redhat.com>
5 years ago
Felix Fontein c333846097
Fix ansible-test import analysis for collections. (#68352) (#69405)
* Fix ansible-test import analysis for collections.

* Ignore plugins/module_utils/__init__.py

(cherry picked from commit 0ca3feb861)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Martin Krizek 54d96eae8c
Ensure --version works with non-ascii project path (#66624) (#69789)
Fixes #66617

(cherry picked from commit 3606dcfe65)
5 years ago
Felix Fontein 4744f31023
Fix ansible-test egg-info directory detection. (#69403)
(cherry picked from commit 8b63da7b43)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Abhijeet Kasurde 153de5ee49
[2.9] podman_image: use correct option for remove_signatures flag (#68979)
podman_image module uses 'podman push' command with wrong
flag '--remove_signatures' instead of '--remove-signatures'

This patch fixes the given typo.

Fixes: ansible/ansible#67965

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