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

pull/67436/head
Vasili 5 years ago committed by GitHub
parent c45d193af4
commit 9b28f1f5d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -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)

@ -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

@ -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

Loading…
Cancel
Save