Declare variable user created with limits

19 views
Skip to first unread message

COUSSI Matthieu

unread,
Dec 3, 2018, 11:24:22 PM12/3/18
to Ansible Project
Hi,

I have a variable with this structure where i declare the users that i have to create.

struct :
 users
:
   
- { name: user1,  uid: 2001,    shell: /bin/sh,    group: grp1,   groups: grp2,    home: /home/user1 }
   
- { name: user2,  uid: 2002,    shell: /bin/sh,    group: grp1,   groups: grp2,    home: /home/user2 }
   
- { name: user3,  uid: 2002,    shell: /bin/sh,    group: grp1,   groups: grp2,    home: /home/user3 }

   
For each user, i want to define the limits but i don't know how to declare this in the structure of my variable "struct".

    - { type: soft, item: nofile, value:  65536}
   
- { type: hard, item: nofile, value:  65536}
   
- { type: soft, item: nproc, value:  16000}
   
- { type: hard, item: nproc, value:  16000}


Thanks for your help,

Matt

Piotr Owcarz

unread,
Dec 4, 2018, 4:31:50 AM12/4/18
to ansible...@googlegroups.com
Hi

It's hard to get what your goal is... You mean something like this? 

struct :
 users
:
   
- name: user1
     uid: 2001
     shell: /bin/sh
     group: grp1   
     groups: grp2
     home: /home/user1
     limits: 
       - { type: soft, item: nofile, value:  65536}
       - { type: soft, item: nofile, value:  65536}

       
- { type: hard, item: nofile, value:  65536}
       
- { type: soft, item: nproc, value:  16000}
       
- { type: hard, item: nproc, value:  16000}


Piotr

--
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/7c319635-d955-43db-b65b-e6000fc48e58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

COUSSI Matthieu

unread,
Dec 5, 2018, 9:29:06 AM12/5/18
to Ansible Project
Hi,

Thx for you reply.
I'm gonna to test.

Matt
Reply all
Reply to author
Forward
0 new messages