Skip to content
Snippets Groups Projects
Commit d827b4fb authored by Florian Bittner's avatar Florian Bittner
Browse files

Merge pull request #61 from daschatten/master

Add 'ssh_auth_file' pillar key to generate an authorized_keys file from ...
parents e39a9537 d416b6d8
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,10 @@ users: ...@@ -28,6 +28,10 @@ users:
- PUBLICKEY - PUBLICKEY
ssh_auth.absent: ssh_auth.absent:
- PUBLICKEY_TO_BE_REMOVED - PUBLICKEY_TO_BE_REMOVED
# Generates an authorized_keys file for the user
# with the given keys
ssh_auth_file:
- PUBLICKEY
google_auth: google_auth:
ssh: | ssh: |
SOMEGAUTHHASHVAL SOMEGAUTHHASHVAL
......
...@@ -142,6 +142,17 @@ user_{{ name }}_public_key: ...@@ -142,6 +142,17 @@ user_{{ name }}_public_key:
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if 'ssh_auth_file' in user %}
{{ home }}/.ssh/authorized_keys:
file.managed:
- user: {{ name }}
- group: {{ name }}
- mode: 600
- contents: |
{% for auth in user.ssh_auth_file -%}
{{ auth }}
{% endfor -%}
{% endif %}
{% if 'ssh_auth' in user %} {% if 'ssh_auth' in user %}
{% for auth in user['ssh_auth'] %} {% for auth in user['ssh_auth'] %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment