2016-12-14 17:57:19 +00:00
|
|
|
---
|
2021-02-18 12:00:21 +00:00
|
|
|
- name: Sanity check
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- monitored_ssh_key_files|length > 0
|
|
|
|
fail_msg: "List of SSH keys ('monitored_ssh_key_files') is empty!"
|
|
|
|
|
2016-12-14 17:57:19 +00:00
|
|
|
- name: Copy SSH authorized_keys for monitoring user
|
|
|
|
authorized_key:
|
|
|
|
user: "{{ monitored_user }}"
|
|
|
|
key: "{{ lookup('file', item) }}"
|
2019-11-13 20:49:59 +00:00
|
|
|
key_options: '{{ lookup("template", "ssh-key-options.j2") }}'
|
|
|
|
manage_dir: yes
|
|
|
|
loop: "{{ monitored_ssh_key_files }}"
|
2016-12-14 17:57:19 +00:00
|
|
|
|
|
|
|
- name: Copy SSH wrapper
|
|
|
|
copy:
|
|
|
|
src: "{{ monitored_ssh_key_wrapper_src }}"
|
2018-03-13 19:43:00 +00:00
|
|
|
dest: "{{ monitored_ssh_key_wrapper }}"
|
2019-11-13 20:49:59 +00:00
|
|
|
owner: "{{ monitored_ssh_key_wrapper_owner|default('root') }}"
|
2018-03-13 19:43:00 +00:00
|
|
|
group: "{{ monitored_group }}"
|
|
|
|
mode: "{{ monitored_ssh_key_wrapper_mode }}"
|
2018-03-13 18:10:08 +00:00
|
|
|
backup: yes
|
2024-11-08 10:52:58 +00:00
|
|
|
when: monitored_ssh_key_wrapper_src|default(false) and monitored_ssh_key_wrapper|default(false)
|
2018-04-22 12:14:03 +00:00
|
|
|
|
2021-02-18 11:58:15 +00:00
|
|
|
- name: Install additional packages for SSH monitoring
|
2018-04-22 12:14:03 +00:00
|
|
|
package:
|
2020-09-23 13:03:11 +00:00
|
|
|
name: "{{ monitored_packages_additional_ssh }}"
|
2018-04-22 12:14:03 +00:00
|
|
|
state: latest
|
2019-11-18 19:41:01 +00:00
|
|
|
when: monitored_packages_additional_ssh != []
|
2018-04-22 12:14:03 +00:00
|
|
|
|