From 34836f492a342ad3345e95bfb63ee8d27443ebb2 Mon Sep 17 00:00:00 2001 From: yuncliu Date: Mon, 7 Dec 2020 15:27:34 +0800 Subject: [PATCH] optimize gather fact --- install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 12ac4872..6c2d847f 100755 --- a/install.sh +++ b/install.sh @@ -91,8 +91,7 @@ function process_install() exit 1 fi ping_all - echo "ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e hosts_name=ascend" - ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e "hosts_name=ascend" + process_check if [ "x${nocopy_flag}" != "xy" ];then echo "ansible-playbook -i ./inventory_file playbooks/distribution.yml -e hosts_name=ascend" ansible-playbook -i ./inventory_file playbooks/distribution.yml -e "hosts_name=ascend" @@ -112,8 +111,7 @@ function process_install() function process_scene() { ping_all - echo "ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e hosts_name=ascend" - ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e "hosts_name=ascend" + process_check echo "ansible-playbook -i ./inventory_file playbooks/distribution.yml -e hosts_name=ascend" if [ "x${nocopy_flag}" != "xy" ];then ansible-playbook -i ./inventory_file playbooks/distribution.yml -e "hosts_name=ascend" @@ -219,6 +217,8 @@ function ping_all() function process_check() { + ansible -i ./inventory_file all -m shell -a "rm -f /etc/ansible/facts.d/npu_info.fact" + echo "ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e hosts_name=ascend" ansible-playbook -i ./inventory_file playbooks/gather_npu_fact.yml -e "hosts_name=ascend" } -- Gitee