Bladeren bron

improvements

master
bovenliggende
commit
481bb1f263
3 gewijzigde bestanden met toevoegingen van 15 en 12 verwijderingen
  1. +3
    -1
      defaults/main.yml
  2. +1
    -1
      tasks/local.yml
  3. +11
    -10
      tasks/main.yml

+ 3
- 1
defaults/main.yml Bestand weergeven

@@ -4,4 +4,6 @@ ssh_host_key_types:
- rsa
ssh_ip: "{{ansible_host}}"
ssh_host_key_state: configured
ssh_scan_host: "{{inventory_hostname}}"
ssh_scan_host: "{% if ssh_ip is defined %}{{ ssh_ip }}{% else %}{{inventory_hostname}}{% endif %}"

ssh_update_local_known_hosts_file: true

tasks/file.yml → tasks/local.yml Bestand weergeven

@@ -1,6 +1,6 @@
---

- name: write ssh_known_hosts file
- name: write local ssh_known_hosts file
local_action: known_hosts
args:
path: "{{ lookup('env','HOME') }}/.ssh/known_hosts"

+ 11
- 10
tasks/main.yml Bestand weergeven

@@ -1,17 +1,17 @@
---

- include: regenerate.yml
- import_tasks: regenerate.yml
when: ssh_host_key_state == 'regenerated'

- include: scan.yml
- import_tasks: scan.yml
when: ssh_host_key_state == 'scanned'

- include: setup.yml
- import_tasks: setup.yml
when:
- ssh_host_key_state == 'configured'
- ansible_ssh_host_key_ed25519_public is defined

- include: fetch.yml
- import_tasks: fetch.yml
when:
- ssh_host_key_state == 'configured' or
ssh_host_key_state == 'fetched' or
@@ -20,16 +20,17 @@
and not ansible_ssh_host_key_ed25519_public is defined
or not ssh_host_key_state == 'configured'

- include: save.yml
- import_tasks: save.yml
when:
ssh_host_key_state == 'configured' or
ssh_host_key_state == 'scanned' or
ssh_host_key_state == 'regenerated' or
ssh_host_key_state == 'fetched'

- include: file.yml
- import_tasks: local.yml
when:
ssh_host_key_state == 'configured' or
ssh_host_key_state == 'scanned' or
ssh_host_key_state == 'regenerated' or
ssh_host_key_state == 'saved'
- ssh_host_key_state == 'configured' or
ssh_host_key_state == 'scanned' or
ssh_host_key_state == 'regenerated' or
ssh_host_key_state == 'saved'
- ssh_update_local_known_hosts_file

Laden…
Annuleren
Opslaan