Created
February 9, 2016 16:11
-
-
Save moali87/08dbe5f0036ade5bd112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for args in pillar.get('service_accounts:teamcity', {}).items() %} | |
{{ args['user'] }}: | |
user.present: | |
- home: {{ args['home'] }} | |
- shell: {{ args['shell'] }} | |
- uid: {{ args['uid'] }} | |
- groups: {{ args['groups'] }} | |
- fullname: {{ args['fullname'] }} | |
ssh_auth.present: | |
- user: {{ args['user'] }} | |
- source: salt://service_accounts/keys/{{ args['user'] }}.pub | |
- config: /home/{{ args['user'] }}/.ssh/authorized_keys | |
{% endfor %} | |
Author
moali87
commented
Feb 9, 2016
Returns nothing.
ea9e4932940e:
Summary for ea9e4932940e
-----------
Succeeded: 0
Failed: 0
-----------
Total states run: 0
Total run time: 0.000 ms
[root@ea9e4932940e sudoers.d]# salt-call state.show_sls service_accounts
[INFO ] Loading fresh modules for state activity
[INFO ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://service_accounts/init.sls'
local:
----------
[root@ea9e4932940e sudoers.d]#
{% for account,args in pillar.get('service_accounts', {}).items() %}
{{ args['user'] }}:
user.present:
- home: {{ args['home'] }}
- shell: {{ args['shell'] }}
- uid: {{ args['uid'] }}
- groups: {{ args['groups'] }}
- fullname: {{ args['fullname'] }}
ssh_auth.present:
- user: {{ args['user'] }}
- source: salt://service_accounts/keys/{{ args['user'] }}.pub
- config: /home/{{ args['user'] }}/.ssh/authorized_keys
{%endfor%}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment