Fix workaround of image upload through horizon 23/52923/7
authorHarry Huang <huangxiangyu5@huawei.com>
Thu, 1 Mar 2018 08:42:06 +0000 (16:42 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Tue, 20 Mar 2018 02:06:34 +0000 (10:06 +0800)
1. using horizon group limit
2. set fact openstack_release to hostvars of
localhost

Change-Id: I0af0da1a508e862d0e2bb975f29897ec2948617f
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/roles/config-osa/tasks/main.yml
deploy/adapters/ansible/roles/config-osa/tasks/set_openstack_release.yml [deleted file]
deploy/adapters/ansible/roles/post-openstack/tasks/main.yml
deploy/adapters/ansible/roles/post-openstack/vars/main.yml
deploy/adapters/ansible/roles/post-osa/vars/main.yml
plugins/odl_cluster/roles/setup-odl/vars/main.yml
plugins/odl_sfc/roles/setup-odl-sfc/vars/main.yml

index 6ea57c0..c14f958 100644 (file)
 - hosts:
     - utility_all[0]
     - network_hosts[0]
+    - horizon
   remote_user: root
   roles:
     - post-openstack
index 5f4f2fb..74d930e 100755 (executable)
   copy:
     src: redhat-7.yml
     dest: /etc/ansible/roles/os_tacker/vars/redhat-7.yml
-
-- include: set_openstack_release.yml
diff --git a/deploy/adapters/ansible/roles/config-osa/tasks/set_openstack_release.yml b/deploy/adapters/ansible/roles/config-osa/tasks/set_openstack_release.yml
deleted file mode 100644 (file)
index c886eab..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-############################################################################
-# Copyright (c) 2018 HUAWEI TECHNOLOGIES CO.,LTD and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-- name: set openstack release
-  lineinfile:
-    dest: "{{ run_dir }}/group_vars/all"
-    line: "openstack_release: {{ openstack_release }}"
-
-- meta: refresh_inventory
index d558239..0bd9aef 100644 (file)
@@ -77,7 +77,7 @@
     regexp: "^HORIZON_IMAGES_UPLOAD_MODE"
     line: "HORIZON_IMAGES_UPLOAD_MODE = 'legacy'"
   when:
-    - inventory_hostname in groups['dashboard_containers']
+    - inventory_hostname in groups['horizon']
 # yamllint enable rule:line-length
 
 - name: restart apache2
@@ -85,4 +85,4 @@
     name: apache2
     state: restarted
   when:
-    - inventory_hostname in groups['dashboard_containers']
+    - inventory_hostname in groups['horizon']
index d9c36d4..ed64c8d 100644 (file)
@@ -43,3 +43,7 @@ flavors:
     vcpus: 8
     ram: 16384
     disk: 160
+
+# yamllint disable rule:line-length
+openstack_release: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}"
+# yamllint enable rule:line-length
index 95f5153..f5ffa33 100644 (file)
@@ -1,6 +1,8 @@
 ---
 
-os_ver: 16.0.5
+# yamllint disable rule:line-length
+os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}"
+# yamllint enable rule:line-length
 os_name: pike
 
 # yamllint disable rule:line-length
index 05ad98f..5f4047c 100755 (executable)
@@ -9,7 +9,9 @@
 ---
 openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml
 
-os_ver: 16.0.5
+# yamllint disable rule:line-length
+os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}"
+# yamllint enable rule:line-length
 os_name: pike
 
 
index 014fc5b..2ffcac1 100755 (executable)
@@ -9,7 +9,9 @@
 ---
 openstack_passwd_file: /etc/openstack_deploy/user_secrets.yml
 
-os_ver: 16.0.5
+# yamllint disable rule:line-length
+os_ver: "{{ lookup('yamlfile', '/opt/openstack-ansible/group_vars/all/all.yml key=openstack_release') }}"
+# yamllint enable rule:line-length
 os_name: pike
 
 odl_username: admin