From dd945044b76e1d45199c753f9326edecaba64a17 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 18 Mar 2020 15:38:43 +0300 Subject: [PATCH] Add internal ips to known_hosts --- README.md | 1 + all_vars.sample | 3 ++- opennebula-keys.sh | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2447c5b..6ff1336 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ + Везде убрать DHCP + Удалять network-manager + Везде прописать все ноды в /etc/hosts ++ В known_hosts также добавлять внутренние IP ## TODO diff --git a/all_vars.sample b/all_vars.sample index 3b5f2f3..a4081bb 100644 --- a/all_vars.sample +++ b/all_vars.sample @@ -3,7 +3,8 @@ keepalived_password= keepalived_router_id=ONEPROD galera_cluster_name=galera_cluster galera_password= -opennebula_hosts="172.31.1.7 172.31.1.5 172.31.1.10 172.31.1.9" +opennebula_hosts="172.31.1.5 172.31.1.10 172.31.1.9 172.31.1.16 172.31.1.17 172.31.1.18" +int_ips="192.168.5.12 192.168.5.13 192.168.5.14 192.168.5.15 192.168.5.16 192.168.5.17" opennebula_db_password= init_db=0 one_key= diff --git a/opennebula-keys.sh b/opennebula-keys.sh index 7a97834..29af5b7 100755 --- a/opennebula-keys.sh +++ b/opennebula-keys.sh @@ -20,6 +20,10 @@ done # Gather host keys ssh-keyscan $opennebula_hosts > tmp$$ +for play_host in $key_hosts; do + ssh root@$play_host "ssh-keyscan $int_ips" >> tmp$$ + break +done for play_host in $key_hosts; do cat tmp$$ > hostkeys$$ ssh root@$play_host 'cat /var/lib/one/.ssh/known_hosts || true' >> hostkeys$$