From be6f0034d5028a73dd3b660a6022e944c54a57de Mon Sep 17 00:00:00 2001 From: gjmzj Date: Wed, 20 Jan 2021 23:03:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=A0=E9=99=A4=E8=8A=82=E7=82=B9role?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playbooks/31.deletcd.yml | 4 ++-- playbooks/32.delnode.yml | 4 ++-- playbooks/33.delmaster.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/playbooks/31.deletcd.yml b/playbooks/31.deletcd.yml index 3a86bc9..51419f7 100644 --- a/playbooks/31.deletcd.yml +++ b/playbooks/31.deletcd.yml @@ -62,8 +62,8 @@ when: "ETCD_ID.stdout != ''" - name: clean etcd {{ ETCD_TO_DEL }} - shell: "ansible-playbook -i {{ base_dir }}/clusters/{{ CLUSTER }}/hosts \ - {{ base_dir }}/roles/clean/clean_node.yml \ + shell: "cd {{ base_dir }} && ansible-playbook -i clusters/{{ CLUSTER }}/hosts \ + roles/clean/clean_node.yml \ -e NODE_TO_CLEAN={{ ETCD_TO_DEL }} \ -e DEL_ETCD=yes >> /tmp/ansible-`date +'%Y%m%d%H%M%S'`.log 2>&1 \ || echo 'data not cleaned on {{ ETCD_TO_DEL }}'" diff --git a/playbooks/32.delnode.yml b/playbooks/32.delnode.yml index 231b9fb..a37ec98 100644 --- a/playbooks/32.delnode.yml +++ b/playbooks/32.delnode.yml @@ -10,8 +10,8 @@ #ignore_errors: true - name: clean node {{ NODE_TO_DEL }} - shell: "ansible-playbook -i {{ base_dir }}/clusters/{{ CLUSTER }}/hosts \ - {{ base_dir }}/roles/clean/clean_node.yml \ + shell: "cd {{ base_dir }} && ansible-playbook -i clusters/{{ CLUSTER }}/hosts \ + roles/clean/clean_node.yml \ -e NODE_TO_CLEAN={{ NODE_TO_DEL }} \ -e DEL_NODE=yes \ -e DEL_LB=yes >> /tmp/ansible-`date +'%Y%m%d%H%M%S'`.log 2>&1 \ diff --git a/playbooks/33.delmaster.yml b/playbooks/33.delmaster.yml index 49611e4..4b01e03 100644 --- a/playbooks/33.delmaster.yml +++ b/playbooks/33.delmaster.yml @@ -10,8 +10,8 @@ #ignore_errors: true - name: clean node {{ NODE_TO_DEL }} - shell: "ansible-playbook -i {{ base_dir }}/clusters/{{ CLUSTER }}/hosts \ - {{ base_dir }}/roles/clean/clean_node.yml \ + shell: "cd {{ base_dir }} && ansible-playbook -i clusters/{{ CLUSTER }}/hosts \ + roles/clean/clean_node.yml \ -e NODE_TO_CLEAN={{ NODE_TO_DEL }} \ -e DEL_MASTER=yes \ -e DEL_NODE=yes \