瀏覽代碼

added option to remove ssh public keys from auth (ssh_auth.absent)

tags/v0.45.0
7oku 10 年之前
父節點
當前提交
4a8393dca9
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. +2
    -0
      pillar.example
  2. +11
    -0
      users/init.sls

+ 2
- 0
pillar.example 查看文件

@@ -24,6 +24,8 @@ users:
pubkey: PUBLICKEY
ssh_auth:
- PUBLICKEY
ssh_auth.absent:
- PUBLICKEY_TO_BE_REMOVED

## Absent user
cuser:

+ 11
- 0
users/init.sls 查看文件

@@ -123,6 +123,17 @@ ssh_auth_{{ name }}_{{ loop.index0 }}:
{% endfor %}
{% endif %}

{% if 'ssh_auth.absent' in user %}
{% for auth in user['ssh_auth.absent'] %}
ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
ssh_auth.absent:
- user: {{ name }}
- name: {{ auth }}
- require:
- file: {{ name }}_user
- user: {{ name }}_user
{% endfor %}
{% endif %}

{% if 'sudouser' in user and user['sudouser'] %}
{% if not used_sudo %}

Loading…
取消
儲存