From df60b76552d1020ee66c6982ae3e5da109edb713 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Wed, 1 Nov 2017 15:48:09 +0800 Subject: [PATCH] Fix ansible running issue on Debian When deploying on debian, it reports error: stat /usr/bin/ansible: no such file or directory That's because on Debian and Ubuntu pip install ansible to /usr/local/bin/ansible, whereas on CentOS the location is /usr/bin/ansible. Change to ansible to handle both cases. Closes-Bug: #1729216 Depends-On: I2b57403128bc103148ae696c219df52590214adc Change-Id: I025037cf48596450e6479ab7ff6425c48ac73aad Signed-off-by: Xinliang Liu --- ansible/roles/ceph/tasks/bootstrap_osds.yml | 4 ++-- ansible/roles/ceph/tasks/reconfigure.yml | 2 +- ansible/roles/ceph/tasks/start_osds.yml | 2 +- ansible/roles/swift/tasks/check.yml | 2 +- ansible/roles/swift/tasks/start.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ansible/roles/ceph/tasks/bootstrap_osds.yml b/ansible/roles/ceph/tasks/bootstrap_osds.yml index 24f2af12d8..00f46df7fd 100644 --- a/ansible/roles/ceph/tasks/bootstrap_osds.yml +++ b/ansible/roles/ceph/tasks/bootstrap_osds.yml @@ -1,6 +1,6 @@ --- - name: Looking up disks to bootstrap for Ceph OSDs - command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox sudo -E ansible localhost -m find_disks -a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup @@ -12,7 +12,7 @@ osds_bootstrap: "{{ (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).disks|from_json }}" - name: Looking up disks to bootstrap for Ceph Cache OSDs - command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox sudo -E ansible localhost -m find_disks -a "partition_name='KOLLA_CEPH_OSD_CACHE_BOOTSTRAP' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_cache_lookup diff --git a/ansible/roles/ceph/tasks/reconfigure.yml b/ansible/roles/ceph/tasks/reconfigure.yml index 090745fb74..dcb793b6ac 100644 --- a/ansible/roles/ceph/tasks/reconfigure.yml +++ b/ansible/roles/ceph/tasks/reconfigure.yml @@ -10,7 +10,7 @@ - { name: ceph_mon, group: ceph-mon } - name: Looking up OSDs for Ceph - command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox sudo -E ansible localhost -m find_disks -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup diff --git a/ansible/roles/ceph/tasks/start_osds.yml b/ansible/roles/ceph/tasks/start_osds.yml index 6471dfd6f8..d44efe094b 100644 --- a/ansible/roles/ceph/tasks/start_osds.yml +++ b/ansible/roles/ceph/tasks/start_osds.yml @@ -1,6 +1,6 @@ --- - name: Looking up OSDs for Ceph - command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox sudo -E ansible localhost -m find_disks -a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}" register: osd_lookup diff --git a/ansible/roles/swift/tasks/check.yml b/ansible/roles/swift/tasks/check.yml index e7e9a5d811..e79ecdb518 100644 --- a/ansible/roles/swift/tasks/check.yml +++ b/ansible/roles/swift/tasks/check.yml @@ -1,6 +1,6 @@ --- - name: Swift sanity checks - command: docker exec -t kolla_toolbox /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox ansible localhost -m kolla_sanity -a "service=swift project=service diff --git a/ansible/roles/swift/tasks/start.yml b/ansible/roles/swift/tasks/start.yml index 4b21401d51..b714bf6f4d 100644 --- a/ansible/roles/swift/tasks/start.yml +++ b/ansible/roles/swift/tasks/start.yml @@ -1,6 +1,6 @@ --- - name: Looking up disks for Swift - command: docker exec -t kolla_toolbox sudo -E /usr/bin/ansible localhost + command: docker exec -t kolla_toolbox sudo -E ansible localhost -m find_disks -a "name={{ swift_devices_name }} match_mode={{ swift_devices_match_mode }}"