forked from ISTI-ansible-roles/ansible-roles
24 lines
537 B
YAML
24 lines
537 B
YAML
|
---
|
||
|
- name: Install the ssh keys for non root users
|
||
|
authorized_key: user={{ item.0.name }} key="{{ item.1 }}" state=present
|
||
|
when: non_root_users
|
||
|
with_subelements:
|
||
|
- ssh_users_list
|
||
|
- authorized_keys
|
||
|
tags:
|
||
|
- pubkeys
|
||
|
- ssh_keys
|
||
|
|
||
|
- name: Remove obsolete ssh keys if there are any
|
||
|
authorized_key: user={{ item.0.name }} key="{{ item.1 }}" state=absent
|
||
|
when:
|
||
|
- obsolete_ssh_key is defined
|
||
|
- non_root_users
|
||
|
with_subelements:
|
||
|
- ssh_users_list
|
||
|
- authorized_keys
|
||
|
tags:
|
||
|
- pubkeys
|
||
|
- ssh_keys
|
||
|
|