Browse Source

some variable naming changes

master
parent
commit
6c99966d62
4 changed files with 6 additions and 9 deletions
  1. +4
    -2
      defaults/main.yml
  2. +1
    -1
      tasks/local.yml
  3. +1
    -1
      tasks/scan.yml
  4. +0
    -5
      templates/ssh_host_key.j2

+ 4
- 2
defaults/main.yml View File

@@ -1,8 +1,10 @@
ssh_host_key_state: configured

ssh_host: "{{ ansible_host | default(inventory_hostname) }}"

ssh_host_key_types:
- ed25519
- ecdsa
- rsa
ssh_host_key_state: configured
ssh_scan_host: "{% if ssh_ip is defined %}{{ ssh_ip }}{% else %}{{inventory_hostname}}{% endif %}"

ssh_update_local_known_hosts_file: true

+ 1
- 1
tasks/local.yml View File

@@ -5,6 +5,6 @@
args:
path: "{{ lookup('env','HOME') }}/.ssh/known_hosts"
name: "{{ inventory_hostname }}"
key: "{{ lookup('template','ssh_host_key.j2') }}"
key: "{{ inventory_hostname }},{{ ssh_host }} ssh-ed25519 {{ ssh_host_key_ed25519_public }}"
when: ssh_host_key_ed25519_public is defined
throttle: 1

+ 1
- 1
tasks/scan.yml View File

@@ -1,7 +1,7 @@
---

- name: scan ssh host
local_action: command ssh-keyscan -t ed25519 {{ssh_scan_host}}
local_action: command ssh-keyscan -t ed25519 {{ssh_host}}
register: _ssh_keyscan_result
changed_when: false



+ 0
- 5
templates/ssh_host_key.j2 View File

@@ -1,5 +0,0 @@
{% if ssh_ip is defined %}
{{ inventory_hostname }},{{ ssh_ip }} ssh-ed25519 {{ ssh_host_key_ed25519_public }}
{% else %}
{{ inventory_hostname }},{{ ansible_host }} ssh-ed25519 {{ ssh_host_key_ed25519_public }}
{% endif %}

Loading…
Cancel
Save