sudocmd.sls 553 Bytes
Newer Older
Francesco Gionghi's avatar
update  
Francesco Gionghi committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

{#- Get the `tplroot` from `tpldir` #}
{%- set fbkusersroot = slspath.split('/')[0] %}
{%- from fbkusersroot ~ "/map.jinja" import fbkusers with context %}

{% if pillar.fbkusers is defined %}
{% for user, options in fbkusers.items() %}
{% if options["sudocmd"] %}

/etc/sudoers.d/{{ user }}-cmd:
  file.managed:
    - name: /etc/sudoers.d/{{ user }}-cmd
    - source: salt://fbkusers/files/sudo.cmd
    - template: jinja
    - defaults:
        sudouser: {{ user }}
        myaccumulator: {{ options["sudocmd"] }}

{% endif %}
{% endfor %}
{% endif %}