---

- 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
