Hi,

I tried to run a playbook with a dynamic inventory (see my playbook below) 
using e.g. ansible-playbook -i nms-vms init-vrf-nms.yml --extra-vars 
"nms=nms-sz" --tags=basic

Unfortunately, i got the following error:
~
[WARNING]: Could not match supplied host pattern, ignoring: 
dynamically_created_hosts

PLAY [Initialize selected VRF NMS] 
***********************************************************************************************************************************************************************************************************
skipping: no hosts matched

When i use --skip-tags, it works as expected. I wonder if running 
ansible-playbooks with tags included is even supported ?

*init-vrf-nms.yml * 
---
- hosts: localhost
  gather_facts: no

  vars_prompt:
    - name: nms
      prompt: Which VRF NMS should be initialized
      private: no

  tasks:
    - name: "Add host to dynamic inventory"
      add_host:
        name: "{{ nms }}"
        groups: dynamically_created_hosts

# ---------------------------------------------------------

- name: "Initialize selected VRF NMS"
  hosts: dynamically_created_hosts
  become: yes

  tasks:

  - name: "Apply role 'nms-basic'"
    include_role:
      name: nms-basics
    tags:
      - basics

  - name: "Apply role 'vrf-vm'"
    include_role:
      name: vrf-vm
    tags:
      - vrf-vm

Regards,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/47b900b9-df78-4ecd-8168-eb1d49b11da6n%40googlegroups.com.

Reply via email to