# User quota management with Ansible

**URL:** <https://forum.ansible.com/t/user-quota-management-with-ansible/19555>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 19, 2015, 9:23pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555 "2015-10-19T21:23:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [October 19, 2015, 9:23pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/1 "2015-10-19T21:23:14Z")

</div>

Hi,

I would like to provision a system on AWS using Ansible, recreate my ~8000 users and establish user quotas… edquota opens an interactive editor, so it’s not particularly Ansible-friendly. Has anyone here set user filesystem quotas via Ansible?

Thanks!  
Joanna

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 19, 2015, 9:47pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/2 "2015-10-19T21:47:52Z")

</div>

IIRC the `quota` command can be used to set/modify/remove user quotas  
w/o interactive prompts, its been years since i set user quotas so  
things might have changed.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [October 21, 2015, 4:14pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/3 "2015-10-21T16:14:56Z")

</div>

Hi Brian,

So far I have found that `quota` seems to only display quota information. I could use `edquota` with -p flag to point to an account as a prototype, but that still leaves me needing to set up at least one account manually. As far as I know, the files (aquota.user and aquota.group) are not stored in plain text, leaving me without the option to use lineinfile.

If anyone is using Ansible to manage quotas, they are keeping it quiet. 🙂

Joanna

---

<div class="post-metadata">

**Author:** ![David\_Karban](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@David\_Karban](https://forum.ansible.com/u/David_Karban)\
**Post date:** [October 21, 2015, 4:31pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/4 "2015-10-21T16:31:07Z")

</div>

Hi,

there is an workaround about edquota problem I used some long time ago. You can override editor taht is called for quota editing. It is using standard EDITOR environment variable. What I done was supply my own script to EDITOR, that returned quota in proper formatting and without user interaction.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [October 21, 2015, 8:42pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/5 "2015-10-21T20:42:03Z")

</div>

Okay, it looks like there is a module for managing GlusterFS volumes…and it has a ‘quota’ option. I’m not sure if that applies to users, groups, or files/directories.

---

<div class="post-metadata">

**Author:** ![jdelaporte](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jdelaporte/32/366_2.png) [@jdelaporte](https://forum.ansible.com/u/jdelaporte)\
**Post date:** [October 21, 2015, 9:03pm UTC](https://forum.ansible.com/t/user-quota-management-with-ansible/19555/6 "2015-10-21T21:03:57Z")

</div>

It appears that on Debian family I can use quotatool and on RHEL family I can use setquota.
