User quota management with Ansible

882 views
Skip to first unread message

Joanna Delaporte

unread,
Oct 19, 2015, 5:23:14 PM10/19/15
to Ansible Project
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

Brian Coca

unread,
Oct 19, 2015, 5:48:03 PM10/19/15
to Ansible Project
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.




--
Brian Coca

Joanna Delaporte

unread,
Oct 21, 2015, 12:14:56 PM10/21/15
to Ansible Project
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

David Karban

unread,
Oct 21, 2015, 12:31:31 PM10/21/15
to ansible...@googlegroups.com
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. 

David Karban
Linux server specialist/Specialista na správu linuxových serverů
www.karban.eu

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/392f10a3-28eb-4309-88e0-f9c876a33590%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Joanna Delaporte

unread,
Oct 21, 2015, 4:42:03 PM10/21/15
to Ansible Project
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.

On Monday, October 19, 2015 at 4:48:03 PM UTC-5, Brian Coca wrote:

Joanna Delaporte

unread,
Oct 21, 2015, 5:03:57 PM10/21/15
to Ansible Project
It appears that on Debian family I can use quotatool and on RHEL family I can use setquota.
Reply all
Reply to author
Forward
0 new messages