Modify download url for lxc image 85/61585/1
authorHarry Huang <huangxiangyu5@huawei.com>
Thu, 30 Aug 2018 09:11:09 +0000 (17:11 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Thu, 30 Aug 2018 09:13:08 +0000 (17:13 +0800)
JIRA: COMPASS-607

Download lxc image from a local server in huawei
lab to avoid lxc pre-staged failur

Change-Id: Ia941d9e883ab5a4ff9c839e65e53703c6c237461
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch [new file with mode: 0644]
deploy/adapters/ansible/roles/config-osa/tasks/main.yml

diff --git a/deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch b/deploy/adapters/ansible/roles/config-osa/files/lxc_cache_prestage.patch
new file mode 100644 (file)
index 0000000..14f5f5f
--- /dev/null
@@ -0,0 +1,11 @@
+--- lxc_cache_prestage.yml      2018-07-24 07:56:22.480369360 +0000
++++ /tmp/lxc_cache_prestage.yml 2018-07-24 08:17:44.665880308 +0000
+@@ -66,7 +66,7 @@
+     --dir=/tmp
+     --out=rootfs.tar.xz
+     --check-certificate={{ (lxc_hosts_validate_certs | bool) | lower }}
+-    {% for server in lxc_image_cache_server_mirrors %}{{ server }}{{ lxc_images[0].split(';')[-1] }}rootfs.tar.xz {% endfor %}
++    http://192.168.137.222/download/rootfs.tar.xz
+     > /var/log/aria2c-image-prestage.log 2>&1
+   args:
+     warn: no
index 7e2585c..35768a2 100755 (executable)
   copy:
     src: redhat-7.yml
     dest: /etc/ansible/roles/os_tacker/vars/redhat-7.yml
+
+- name: copy lxc_cache_prestage.patch
+  copy:
+    src: lxc_cache_prestage.patch
+    dest: /etc/ansible/roles/lxc_hosts/tasks/lxc_cache_prestage.patch
+  when:
+    - checkresult.rc == 0
+    - offline_deployment is defined and offline_deployment == "Disable"
+
+- name: patch lxc_cache_prestage.yml
+  shell:
+    patch -p0 < lxc_cache_prestage.patch
+  args:
+    chdir: /etc/ansible/roles/lxc_hosts/tasks/
+  when:
+    - checkresult.rc == 0
+    - offline_deployment is defined and offline_deployment == "Disable"
+  ignore_errors: "true"