32 lines
1,004 B
YAML
32 lines
1,004 B
YAML
---
|
|
- name: Sanity check
|
|
assert:
|
|
that:
|
|
- monitored_ssh_key_files|length > 0
|
|
fail_msg: "List of SSH keys ('monitored_ssh_key_files') is empty!"
|
|
|
|
- name: Copy SSH authorized_keys for monitoring user
|
|
authorized_key:
|
|
user: "{{ monitored_user }}"
|
|
key: "{{ lookup('file', item) }}"
|
|
key_options: '{{ lookup("template", "ssh-key-options.j2") }}'
|
|
manage_dir: yes
|
|
loop: "{{ monitored_ssh_key_files }}"
|
|
|
|
- name: Copy SSH wrapper
|
|
copy:
|
|
src: "{{ monitored_ssh_key_wrapper_src }}"
|
|
dest: "{{ monitored_ssh_key_wrapper }}"
|
|
owner: "{{ monitored_ssh_key_wrapper_owner|default('root') }}"
|
|
group: "{{ monitored_group }}"
|
|
mode: "{{ monitored_ssh_key_wrapper_mode }}"
|
|
backup: yes
|
|
when: monitored_ssh_key_wrapper_src|default(false) and monitored_ssh_key_wrapper|default(false)
|
|
|
|
- name: Install additional packages for SSH monitoring
|
|
package:
|
|
name: "{{ monitored_packages_additional_ssh }}"
|
|
state: latest
|
|
when: monitored_packages_additional_ssh != []
|
|
|