forked from ISTI-ansible-roles/ansible-roles
21 lines
569 B
YAML
21 lines
569 B
YAML
---
|
|
- name: Install the ssh keys for non root users
|
|
authorized_key: user={{ item.0.name }} key="{{ item.1 }}" state=present
|
|
when:
|
|
- authorized_keys is defined
|
|
- 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" ]
|