stor4nfv: support multiple architecture images 77/58077/1
authorYibo Cai <yibo.cai@arm.com>
Wed, 30 May 2018 07:33:39 +0000 (15:33 +0800)
committerYibo Cai <yibo.cai@arm.com>
Wed, 30 May 2018 07:37:13 +0000 (15:37 +0800)
Change-Id: I2a3482873e37f58c8f16a02988770d6e78fd3ab6
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
plugins/stor4nfv/roles/stor4nfv/tasks/post-install.yml

index 55d26d6..182c0a6 100644 (file)
@@ -8,6 +8,10 @@
 # #############################################################################
 ---
 
+- name: define image architecture
+  set_fact:
+    imgarch: "{{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }}"
+
 - name: ensure ceph-ansible dir exists
   stat:
     path: /opt/ceph-ansible
 
 - name: ensure osdsctl exists
   stat:
-    path: /opt/opensds-v0.1.5-linux-amd64/bin/osdsctl
+    path: /opt/opensds-v0.1.5-linux-{{ imgarch }}/bin/osdsctl
   ignore_errors: "true"
   register: osdsctl_exists
 
 - name: ensure opensds csi directory exists
   stat:
-    path: /opt/opensds-k8s-v0.1.0-linux-amd64
+    path: /opt/opensds-k8s-v0.1.0-linux-{{ imgarch }}
   ignore_errors: "true"
   register: csi_dir_exists
 
 - name: create opensds default profile, csi pods
   remote_user: root
   shell: |
-    cp /opt/opensds-v0.1.5-linux-amd64/bin/osdsctl /usr/local/bin;
+    cp /opt/opensds-v0.1.5-linux-{{ imgarch }}/bin/osdsctl /usr/local/bin;
     export OPENSDS_ENDPOINT=http://{{ public_vip.ip }}:50040;
     export OPENSDS_AUTH_STRATEGY=noauth;
     osdsctl profile create '{"name": "default", "description": "default policy"}'
-    cd /opt/opensds-k8s-v0.1.0-linux-amd64;
+    cd /opt/opensds-k8s-v0.1.0-linux-{{ imgarch }};
     kubectl create -f csi/deploy/kubernetes;
   ignore_errors: "true"
   when: