# Something that seems simply yet can't get it to work

**URL:** <https://forum.ansible.com/t/something-that-seems-simply-yet-cant-get-it-to-work/15508>\
**Category:** Ansible Project\
**Created:** [June 19, 2014, 5:37pm UTC](https://forum.ansible.com/t/something-that-seems-simply-yet-cant-get-it-to-work/15508 "2014-06-19T17:37:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tb582](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tb582](https://forum.ansible.com/u/tb582)\
**Post date:** [June 19, 2014, 5:37pm UTC](https://forum.ansible.com/t/something-that-seems-simply-yet-cant-get-it-to-work/15508/1 "2014-06-19T17:37:45Z")

</div>

Hello, I’m new to Ansible: Here’s what I’m looking to do for my first playbook/automation with it.

I have a list of users, like below. Oh and by the way I’m running this on OSX. First of all where do I save this file? and what to a call it? anythingiwant.yaml?

# List of uses

- abc123
- def532
- gth593

Second I have my hosts file setup with my computers and was able to have anible successfully connect to each of them.

Now how do I take my list of users and have ansible create user accounts plus add their public keys which i have saved on my system to the hosts in my file?

I was able to manually run the addusers module but I could only get it to accept the first user value it kept failing if I also tied to give it a comment. I also don’t want to have to do the manual process for each user plus another manual process to add their keys.

please help!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 20, 2014, 3:46am UTC](https://forum.ansible.com/t/something-that-seems-simply-yet-cant-get-it-to-work/15508/2 "2014-06-20T03:46:20Z")

</div>

> Hello, I'm new to Ansible: Here's what I'm looking to do for my first  
> playbook/automation with it.
> 
> I have a list of users, like below. Oh and by the way I'm running this on  
> OSX. First of all where do I save this file? and what to a call it?  
> anythingiwant.yaml?
> 
> # List of uses  
> - abc123  
> - def532  
> - gth593

Variables need names:

list\_of\_users:  
&nbsp;&nbsp;&nbsp;- abc123  
&nbsp;&nbsp;&nbsp;- def532

etc

> Second I have my hosts file setup with my computers and was able to have  
> anible successfully connect to each of them.
> 
> Now how do I take my list of users and have ansible create user accounts  
> plus add their public keys which i have saved on my system to the hosts in  
> my file?

Read up on the user module and this will be a good start.

> I was able to manually run the addusers module but I could only get it to  
> accept the first user value it kept failing if I also tied to give it a  
> comment. I also don't want to have to do the manual process for each user  
> plus another manual process to add their keys.

If you are experiencing a problem, it's helpful to see what you tried and  
the output.
