mirror of https://github.com/ansible/ansible.git
(cherry picked from commit be5fc4e
)
pull/72345/head
parent
ae1ee31b99
commit
132346cb6a
@ -0,0 +1,3 @@
|
|||||||
|
bugfixes:
|
||||||
|
- Collections - Ensure ``action_loader.get`` is called with ``collection_list`` to properly find collections
|
||||||
|
when ``collections:`` search is specified (https://github.com/ansible/ansible/issues/72170)
|
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright: (c) 2020, Ansible Project
|
||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
from ansible.plugins.action import ActionBase
|
||||||
|
|
||||||
|
|
||||||
|
class ActionModule(ActionBase):
|
||||||
|
|
||||||
|
BYPASS_HOST_LOOP = True
|
||||||
|
|
||||||
|
def run(self, tmp=None, task_vars=None):
|
||||||
|
result = super(ActionModule, self).run(tmp, task_vars)
|
||||||
|
result['bypass_inventory_hostname'] = task_vars['inventory_hostname']
|
||||||
|
return result
|
@ -0,0 +1,22 @@
|
|||||||
|
- name: Test collection lookup bypass host list
|
||||||
|
hosts: all
|
||||||
|
connection: local
|
||||||
|
gather_facts: false
|
||||||
|
collections:
|
||||||
|
- testns.testcoll
|
||||||
|
tasks:
|
||||||
|
- meta: end_host
|
||||||
|
when: lookup('pipe', ansible_playbook_python ~ ' -c "import jinja2; print(jinja2.__version__)"') is version('2.7', '<')
|
||||||
|
|
||||||
|
- bypass_host_loop:
|
||||||
|
register: bypass
|
||||||
|
|
||||||
|
- run_once: true
|
||||||
|
vars:
|
||||||
|
bypass_hosts: '{{ hostvars|dictsort|map(attribute="1.bypass.bypass_inventory_hostname")|select("defined")|unique }}'
|
||||||
|
block:
|
||||||
|
- debug:
|
||||||
|
var: bypass_hosts
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: bypass_hosts|length == 1
|
Loading…
Reference in New Issue