Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
salt-formulas
fbk-formulas
fbkusers
Commits
368ee2da
Commit
368ee2da
authored
Aug 27, 2020
by
Francesco Gionghi
Browse files
tomygroup and ssh_auth.manage
parent
a07ba8e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
fbkusers/group/tomygroup.sls
View file @
368ee2da
{#- Get the `tplroot` from `tpldir` #}
{%- set fbkusersroot = slspath.split('/')[0] %}
{%- from fbkusersroot ~ "/map.jinja" import fbkuserssettings with context %}
{% if pillar.fbkusers is defined %}
{% for user in pillar.fbkusers %}
{% if pillar.fbkusers[user]["tomygroup"] %}
{% for userstoadd in pillar.fbkusers[user]["tomygroup"] %}
{% if salt['user.info'](userstoadd) %}
{{ userstoadd }}-to-{{ user }}:
group.present:
- name: {{ user }}
- addusers:
- {{ userstoadd }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
\ No newline at end of file
fbkusers/sshkey/sshkey.sls
View file @
368ee2da
...
...
@@ -7,15 +7,14 @@
{% for user in pillar.fbkusers %}
{% if pillar.fbkusers[user]["sshkey"] %}
{% for key in pillar.fbkusers[user]["sshkey"] %}
sshkey-{{ user }}-{{ key }}:
ssh_auth.
present
:
ssh_auth.
mange
:
- user: {{ user }}
- name: {{ key }}
- ssh-key:
{% for key in pillar.fbkusers[user]["sshkey"] %}
- {{ key }}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment