JustPaste.it

# Both files are pillars.
# In sudoers.sls

sudoers:
  users:
    root:
      - 'ALL=(ALL:ALL) ALL'
    user1:
      - 'ALL=(ALL) ALL'
      - 'ALL=(root) ALL'
    user2:
      - 'ALL=(ALL) ALL'
      - 'ALL=(root) ALL'

 

# In users.sls

users:
  user1:
    fullname: I am user1

  user2:
    fullname: I am user2

 

# What i want to do is:

# If user1 in users.sls args 'admin: true' then the user will be added to sudoers automatically.

# So when we add a user we can simply say if he/she is an admin or not and the sudo will be added automatically.

# And of course admin: False is default if the arg is missing from users.sls