Browse Source

Merge "Extend linux.user"

add-del-users-in-grups
jenkins-mk jenkins-mk 7 years ago
parent
commit
f61568373c
2 changed files with 28 additions and 6 deletions
  1. +19
    -3
      README.rst
  2. +9
    -3
      linux/system/user.sls

+ 19
- 3
README.rst View File

timezone: 'Europe/Prague' timezone: 'Europe/Prague'
utc: true utc: true


Linux with system users, some with password set
Linux with system users, some with password set:
.. WARNING::
If no 'password' variable has been passed - any predifined password
will be removed.


.. code-block:: yaml .. code-block:: yaml


jsmith: jsmith:
name: 'jsmith' name: 'jsmith'
enabled: true enabled: true
full_name: 'Password'
full_name: 'With clear password'
home: '/home/jsmith' home: '/home/jsmith'
password: userpassword
hash_password: true
password: "userpassword"
mark:
name: 'mark'
enabled: true
full_name: "unchange password'
home: '/home/mark'
password: false
elizabeth:
name: 'elizabeth'
enabled: true
full_name: 'With hased password'
home: '/home/elizabeth'
password: "$6$nUI7QEz3$dFYjzQqK5cJ6HQ38KqG4gTWA9eJu3aKx6TRVDFh6BVJxJgFWg2akfAA7f1fCxcSUeOJ2arCO6EEI6XXnHXxG10"


Configure sudo for users and groups under ``/etc/sudoers.d/``. Configure sudo for users and groups under ``/etc/sudoers.d/``.
This ways ``linux.system.sudo`` pillar map to actual sudo attributes: This ways ``linux.system.sudo`` pillar map to actual sudo attributes:

+ 9
- 3
linux/system/user.sls View File

user.present: user.present:
- name: {{ name }} - name: {{ name }}
- home: {{ user.home }} - home: {{ user.home }}
{%- if user.password is defined %}
- password: {{ user.password }}
{% if user.get('password') == False %}
- enforce_password: false
{% elif user.get('password') == None %}
- enforce_password: true
- password: '*'
{% elif user.get('password') %}
- enforce_password: true - enforce_password: true
- password: {{ user.password }}
- hash_password: {{ user.get('hash_password', False) }}
{% endif %}
- gid_from_name: true - gid_from_name: true
{%- endif %}
{%- if user.groups is defined %} {%- if user.groups is defined %}
- groups: {{ user.groups }} - groups: {{ user.groups }}
{%- endif %} {%- endif %}

Loading…
Cancel
Save