summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-01-06 17:23:03 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-01-06 17:23:03 +0100
commitfa3df6c8389bae15532d11d8ffe8ded08fe5788a (patch)
treec5bc9d3d155b5a2981e0cdd3077f2c94915fcec4
parentbasic openwrt deploy support (diff)
fix known host handling for openwrt-deploy
-rw-r--r--common/cloud-install.yml2
-rw-r--r--common/iso-install.yml2
-rw-r--r--common/openwrt-deploy.yml3
-rw-r--r--common/usb-install.yml2
-rw-r--r--common/vm-deploy.yml3
-rw-r--r--common/vm-install.yml2
-rwxr-xr-xdeploy.sh4
-rwxr-xr-xinstall.sh4
8 files changed, 14 insertions, 8 deletions
diff --git a/common/cloud-install.yml b/common/cloud-install.yml
index 506ad2bc..f0a9870d 100644
--- a/common/cloud-install.yml
+++ b/common/cloud-install.yml
@@ -15,6 +15,8 @@
set_fact:
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no{% if install_jumphost is defined %} -o 'ProxyCommand ssh -q -a {{ install_jumphost }} -W %h:%p'{% endif %}"
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
- name: clear all gathered facts
meta: clear_facts
- name: wait for host to start up
diff --git a/common/iso-install.yml b/common/iso-install.yml
index 796ae0d9..3088b107 100644
--- a/common/iso-install.yml
+++ b/common/iso-install.yml
@@ -47,6 +47,8 @@
set_fact:
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no{% if install_jumphost is defined %} -o 'ProxyCommand ssh -q -a {{ install_jumphost }} -W %h:%p'{% endif %}"
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
- name: clear all gathered facts
meta: clear_facts
- name: wait for host to start up
diff --git a/common/openwrt-deploy.yml b/common/openwrt-deploy.yml
index eacb243c..1ef70a5e 100644
--- a/common/openwrt-deploy.yml
+++ b/common/openwrt-deploy.yml
@@ -15,3 +15,6 @@
gather_facts: no
roles:
- role: openwrt/deploy
+ post_tasks:
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
diff --git a/common/usb-install.yml b/common/usb-install.yml
index a7bbe012..a909e679 100644
--- a/common/usb-install.yml
+++ b/common/usb-install.yml
@@ -36,6 +36,8 @@
set_fact:
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no{% if install_jumphost is defined %} -o 'ProxyCommand ssh -q -a {{ install_jumphost }} -W %h:%p'{% endif %}"
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
- name: clear all gathered facts
meta: clear_facts
- name: wait for host to start up
diff --git a/common/vm-deploy.yml b/common/vm-deploy.yml
index 5368df3e..8f4aa926 100644
--- a/common/vm-deploy.yml
+++ b/common/vm-deploy.yml
@@ -38,3 +38,6 @@
gather_facts: no
roles:
- role: vm/guest/deploy
+ post_tasks:
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
diff --git a/common/vm-install.yml b/common/vm-install.yml
index 90b08c56..cffde0c2 100644
--- a/common/vm-install.yml
+++ b/common/vm-install.yml
@@ -34,6 +34,8 @@
set_fact:
ansible_ssh_extra_args: "-o StrictHostKeyChecking=no{% if install_jumphost is defined %} -o 'ProxyCommand ssh -q -a {{ install_jumphost }} -W %h:%p'{% endif %}"
+ - name: remove host-keys from ssh known-hosts
+ local_action: command "{{ (inventory_dir, '../remove-known-host.sh') | path_join | realpath }}" "{{ install_hostname }}"
- name: clear all gathered facts
meta: clear_facts
- name: wait for host to start up
diff --git a/deploy.sh b/deploy.sh
index c073283f..800fd52e 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -17,10 +17,6 @@ vault_environment__set "$env_group" || exit 1
echo "deploying $name with $distro/$codename in environment '$env_group'"
echo ""
-echo "########## clearing old ssh host keys #########"
-remove_known_hosts "$name"
-echo ""
-
echo "########## removing cached facts #########"
rm -f ".cache/facts/$name"
echo ""
diff --git a/install.sh b/install.sh
index 68e06553..52320c58 100755
--- a/install.sh
+++ b/install.sh
@@ -17,10 +17,6 @@ vault_environment__set "$env_group" || exit 1
echo "installing $name with $distro/$codename in environment '$env_group'"
echo ""
-echo "########## clearing old ssh host keys #########"
-remove_known_hosts "$name"
-echo ""
-
echo "########## removing cached facts #########"
rm -f ".cache/facts/$name"
echo ""