Skip to content
Snippets Groups Projects
Commit d11e7046 authored by Forrest's avatar Forrest
Browse files

Merge pull request #63 from andrew-vant/auth_from_files

Added option to source ssh public keys from files.
parents f083cac6 1f80412d
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,11 @@ users: ...@@ -32,6 +32,11 @@ users:
# with the given keys # with the given keys
ssh_auth_file: ssh_auth_file:
- PUBLICKEY - PUBLICKEY
# If you prefer to keep public keys as files rather
# than inline in pillar, this works.
ssh_auth_sources:
- salt://keys/buser.id_rsa.pub
google_auth: google_auth:
ssh: | ssh: |
SOMEGAUTHHASHVAL SOMEGAUTHHASHVAL
......
...@@ -166,6 +166,18 @@ ssh_auth_{{ name }}_{{ loop.index0 }}: ...@@ -166,6 +166,18 @@ ssh_auth_{{ name }}_{{ loop.index0 }}:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if 'ssh_auth_sources' in user %}
{% for pubkey_file in user['ssh_auth_sources'] %}
ssh_auth_source_{{ name }}_{{ loop.index0 }}:
ssh_auth.present:
- user: {{ name }}
- source: {{ pubkey_file }}
- require:
- file: {{ name }}_user
- user: {{ name }}_user
{% endfor %}
{% endif %}
{% if 'ssh_auth.absent' in user %} {% if 'ssh_auth.absent' in user %}
{% for auth in user['ssh_auth.absent'] %} {% for auth in user['ssh_auth.absent'] %}
ssh_auth_delete_{{ name }}_{{ loop.index0 }}: ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment