# Ansible create an IAM user with a group and with administrator privilege

**URL:** <https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884>\
**Category:** Ansible Project\
**Created:** [November 28, 2015, 1:23pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884 "2015-11-28T13:23:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adithya\_Khamithkar](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Adithya\_Khamithkar](https://forum.ansible.com/u/Adithya_Khamithkar)\
**Post date:** [November 28, 2015, 1:23pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/1 "2015-11-28T13:23:12Z")

</div>

Hi,

Can someone please help me in creating an IAM user with a group and with administrator privilege

Thanks,

---

<div class="post-metadata">

**Author:** ![Chun-Hung\_Huang](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@Chun-Hung\_Huang](https://forum.ansible.com/u/Chun-Hung_Huang)\
**Post date:** [November 28, 2015, 6:37pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/2 "2015-11-28T18:37:48Z")

</div>

Hi

Do you mean

- you want to add a user which name is IAM ?
- the user belong to a group ? ( which name is group name )
- with adminisrator privilege, sudo users?

Adithya Khamithkar於 2015年11月28日星期六 UTC-6上午7時23分12秒寫道：

---

<div class="post-metadata">

**Author:** ![Adithya\_Khamithkar](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Adithya\_Khamithkar](https://forum.ansible.com/u/Adithya_Khamithkar)\
**Post date:** [November 29, 2015, 4:53am UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/3 "2015-11-29T04:53:06Z")

</div>

Yes I want to add a user in IAM the user name will be a variable that I’ll pass from my vars file. And I want that user to be added in that group called administrator.

---

<div class="post-metadata">

**Author:** ![Chun-Hung\_Huang](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@Chun-Hung\_Huang](https://forum.ansible.com/u/Chun-Hung_Huang)\
**Post date:** [November 29, 2015, 9:36pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/4 "2015-11-29T21:36:36Z")

</div>

Hi, Is something like this

> cat test\_group\_user.yml

- name: Test group and user module

hosts: testserver

vars:

username: sakanamax

tasks:

- name: Add administrator group

sudo: True

group: name=administrator state=present

- name: Add user sakana and add to administrator group

sudo: True

user: name={{ username }} group=administrator

Adithya Khamithkar於 2015年11月28日星期六 UTC-6下午10時53分11秒寫道：

---

<div class="post-metadata">

**Author:** ![Adithya\_Khamithkar](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Adithya\_Khamithkar](https://forum.ansible.com/u/Adithya_Khamithkar)\
**Post date:** [November 29, 2015, 9:40pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/5 "2015-11-29T21:40:42Z")

</div>

Thia is for adding a user on linux. I want to add an IAM user on AWS. 🙂

---

<div class="post-metadata">

**Author:** ![Chun-Hung\_Huang](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@Chun-Hung\_Huang](https://forum.ansible.com/u/Chun-Hung_Huang)\
**Post date:** [November 29, 2015, 9:43pm UTC](https://forum.ansible.com/t/ansible-create-an-iam-user-with-a-group-and-with-administrator-privilege/19884/6 "2015-11-29T21:43:56Z")

</div>

Sorry for misunderstand 🙂  
\<(\_ \_)\>

I don’t use AWS, I think other one could help you

Adithya Khamithkar於 2015年11月29日星期日 UTC-6下午3時40分50秒寫道：
