I am trying to do the following.
I have a variable yaml

eg:
group_vars.yml
G1:
 - groupname: A
G2:
  - groupname: B
G3:
 - groupname: C
G4:
 - groupname: D

I have this task and I want to pass just the G1 and G2 as extra_vars to the
"groups_name" from the command line. How do I go about doing it?
- include_vars: group_vars.yml
- name: Create Group(s)

  group:

    name: "{{ item.groupname }}"

    state: present

  with_items:

     - "{{groups_name}}"



Cheers

-- 
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/CAHjcDeUwdH7voFxP7brML0-%3Do-WbL4f1KS2sLNYpy3r8i6ZmWg%40mail.gmail.com.

Reply via email to