ssh_host_keys
This commit is contained in:
20
ansible/roles/ssh_host_keys/tasks/main.yml
Normal file
20
ansible/roles/ssh_host_keys/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name: Set specific variables for distributions
|
||||
ansible.builtin.include_vars: '{{ item }}'
|
||||
with_first_found:
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
||||
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
|
||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
||||
- '{{ ansible_distribution }}.yml'
|
||||
- '{{ ansible_os_family }}.yml'
|
||||
- default.yml
|
||||
|
||||
- name: Checking if host keys have been changed
|
||||
ansible.builtin.lineinfile:
|
||||
line: "{{ item.pub_key }}"
|
||||
dest: "{{ item.files.0 }}"
|
||||
state: absent
|
||||
check_mode: true
|
||||
with_items: "{{ ssh_host_keys_keys }}"
|
||||
notify: Removing ssh host public and private keys
|
||||
Reference in New Issue
Block a user