From 23dab96ab09b36af83868337cc276baab01a0ada Mon Sep 17 00:00:00 2001 From: sean Date: Wed, 4 Aug 2021 11:35:57 +0800 Subject: [PATCH] ansible: backup curvetab if exist --- .../install_package/tasks/include/install_curve-nbd.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml b/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml index b302887f0b..f6f6fd9e23 100644 --- a/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml +++ b/curve-ansible/roles/install_package/tasks/include/install_curve-nbd.yml @@ -47,12 +47,17 @@ local_file_path: "{{ local_nbd_package_path }}/bin/" file_mode: 0755 include_tasks: copy_file_to_remote.yml - - name: install curvetab + - name: check curvetab exist + stat: + path: "{{ curvetab_path }}/curvetab" + register: file_status + - name: install curvetab if not exist vars: remote_dir_name: "{{ curvetab_path }}" local_file_path: "{{ local_nbd_package_path }}/etc/" file_mode: 0755 include_tasks: copy_file_to_remote.yml + when: not file_status.stat.exists - name: add nbd auto start at boot block: - name: get distro name