mirror of
https://github.com/saltstack-formulas/openssh-formula.git
synced 2026-10-23 21:05:47 +02:00
Added support to manage ssh certificates
This commit is contained in:
1 parent
6e418aa945
commit
47211d0648
5 files changed
+104
-41
No files matched your search
@@ -0,0 +1,43 @@
|
||||
include:
|
||||
- openssh
|
||||
|
||||
{% from "openssh/map.jinja" import openssh with context %}
|
||||
{% set openssh_pillar = pillar.get('openssh', {}) %}
|
||||
{% set auth = openssh_pillar.get('auth', {}) %}
|
||||
{% for user,keys in auth.items() -%}
|
||||
{% for key in keys -%}
|
||||
{% if 'present' in key and key['present'] %}
|
||||
{{ key['name'] }}:
|
||||
ssh_auth.present:
|
||||
- user: {{ user }}
|
||||
{% if 'source' in key %}
|
||||
- source: {{ key['source'] }}
|
||||
{% else %}
|
||||
{% if 'enc' in key %}
|
||||
- enc: {{ key['enc'] }}
|
||||
{% endif %}
|
||||
{% if 'comment' in key %}
|
||||
- comment: {{ key['comment'] }}
|
||||
{% endif %}
|
||||
{% if 'options' in key %}
|
||||
- options: {{ key['options'] }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
- require:
|
||||
- service: {{ openssh.service }}
|
||||
{% else %}
|
||||
{{ key['name'] }}:
|
||||
ssh_auth.absent:
|
||||
- user: {{ user }}
|
||||
{% if 'enc' in key %}
|
||||
- enc: {{ key['enc'] }}
|
||||
{% endif %}
|
||||
{% if 'comment' in key %}
|
||||
- comment: {{ key['comment'] }}
|
||||
{% endif %}
|
||||
{% if 'options' in key %}
|
||||
- options: {{ key['options'] }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
Reference in new issue
Block a user