Hi!

Is there a way so to specify "last line" in tags from a list?. I want to 
create a new user by using adhocs command. So it won't have to go through 
all the userlist everytime. Only the last added line. In this case    - { 
id: '7' , user: 'user7' }


*tasks - main.yml:*

- name: Add vnc users
  user: name={{ item.user }} home={{ home_dir }}/{{ item.user }}
  with_items:
    - "{{ vnc_servers }}"
  tags: addnewuser





*vars - main.yml:*

---

service_name: vncserver

home_dir: "{{ opt_dir }}/home"
vnc_servers:
  - { id: '1' , user: 'user1' }
  - { id: '2' , user: 'user2' }
  - { id: '3' , user: 'user3' }
  - { id: '4' , user: 'user4' }
  - { id: '5' , user: 'user5' }
  - { id: '6' , user: 'user6' }
  - { id: '7' , user: 'user7' } = newly added user




-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/80ab97de-94b2-4b9e-bec9-0ad2ccbf3b30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to