Browse Source

Merge pull request #5 from shawnbutts/master

better sudoers support & default gid
lookup-fix-3
Seth House 11 years ago
parent
commit
b41c70a6d1
1 changed files with 22 additions and 8 deletions
  1. +22
    -8
      users/init.sls

+ 22
- 8
users/init.sls View File

- group: {{ name }} - group: {{ name }}
group.present: group.present:
- name: {{ name }} - name: {{ name }}
- gid: {{ user['uid'] }}
user.present: user.present:
- name: {{ name }} - name: {{ name }}
- home: {{ home }} - home: {{ home }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}


{% if 'sudouser' in user %}
sudoer-{{ name }}:
file.append:
- name: /etc/sudoers
- text:
- "{{ name }} ALL=(ALL) NOPASSWD: ALL"
- require:
- file: sudoer-defaults


{% if 'sudouser' in user and user['sudouser'] %}
sudoer-{{ name }}:
file.managed:
- name: /etc/sudoers.d/{{ name }}
- user: root
- group: root
- mode: '0440'
/etc/sudoers.d/{{ name }}:
file.append:
- text:
- "{{ name }} ALL=(ALL) NOPASSWD: ALL"
- require:
- file: sudoer-defaults
- file: sudoer-{{ name }}
{% else %}
/etc/sudoers.d/{{ name }}:
file.absent:
- name: /etc/sudoers.d/{{ name }}
{% endif %} {% endif %}


{% endfor %} {% endfor %}
{% for user in pillar.get('absent_users', []) %} {% for user in pillar.get('absent_users', []) %}
{{ user }}: {{ user }}:
user.absent user.absent
/etc/sudoers.d/{{ user }}:
file.absent:
- name: /etc/sudoers.d/{{ user }}
{% endfor %} {% endfor %}

Loading…
Cancel
Save