Fix incorrect "Could not match supplied host pattern" warning (#66764) (#67432)

This commit is contained in:
Vasili 2020-02-14 23:50:52 +02:00 committed by GitHub
parent c45d193af4
commit 9b28f1f5d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix incorrect "Could not match supplied host pattern" warning (https://github.com/ansible/ansible/issues/66764)

View file

@ -53,7 +53,7 @@ class Play(Base, Taggable, CollectionSearch):
""" """
# ================================================================================= # =================================================================================
_hosts = FieldAttribute(isa='list', required=True, listof=string_types, always_post_validate=True) _hosts = FieldAttribute(isa='list', required=True, listof=string_types, always_post_validate=True, priority=-1)
# Facts # Facts
_gather_facts = FieldAttribute(isa='bool', default=None, always_post_validate=True) _gather_facts = FieldAttribute(isa='bool', default=None, always_post_validate=True)

View file

@ -0,0 +1,13 @@
---
- hosts: localhost
gather_facts: false
tasks:
- name: Group
group_by:
key: test_{{ inventory_hostname }}
- hosts: test_localhost
gather_facts: false
tasks:
- name: Print
import_tasks: tasks.yml

View file

@ -0,0 +1,3 @@
- name: test
debug:
msg: hello

View file

@ -108,3 +108,6 @@ ansible-playbook valid_include_keywords/playbook.yml "$@"
# https://github.com/ansible/ansible/issues/64902 # https://github.com/ansible/ansible/issues/64902
ansible-playbook tasks/test_allow_single_role_dup.yml 2>&1 | tee test_allow_single_role_dup.out ansible-playbook tasks/test_allow_single_role_dup.yml 2>&1 | tee test_allow_single_role_dup.out
test "$(grep -c 'ok=3' test_allow_single_role_dup.out)" = 1 test "$(grep -c 'ok=3' test_allow_single_role_dup.out)" = 1
# https://github.com/ansible/ansible/issues/66764
ANSIBLE_HOST_PATTERN_MISMATCH=error ansible-playbook empty_group_warning/playbook.yml