# Create a new user.

**URL:** <https://forum.ansible.com/t/create-a-new-user/21188>\
**Category:** Ansible Project\
**Created:** [April 18, 2016, 7:54am UTC](https://forum.ansible.com/t/create-a-new-user/21188 "2016-04-18T07:54:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_von\_trier\_pung](https://avatars.discourse-cdn.com/v4/letter/l/a9adbd/32.png) [@Lars\_von\_trier\_pung](https://forum.ansible.com/u/Lars_von_trier_pung)\
**Post date:** [April 18, 2016, 7:54am UTC](https://forum.ansible.com/t/create-a-new-user/21188/1 "2016-04-18T07:54:53Z")

</div>

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:**

---

<div class="post-metadata">

**Author:** ![Dejay\_Clayton](https://avatars.discourse-cdn.com/v4/letter/d/6de8d8/32.png) [@Dejay\_Clayton](https://forum.ansible.com/u/Dejay_Clayton)\
**Post date:** [May 12, 2016, 8:44pm UTC](https://forum.ansible.com/t/create-a-new-user/21188/2 "2016-05-12T20:44:22Z")

</div>

Have you tried using the “last” filter?

with\_items:

- “{{ vnc\_servers | last }}”
