From c82559b65ad462251fb7815488aed282c32e13d9 Mon Sep 17 00:00:00 2001 From: jkilpatr Date: Fri, 13 Oct 2017 11:14:38 -0400 Subject: [PATCH] Resolve upstream breakage from oooq changes So TripleO is moving to not building undercloud images. In doing so they used the obvious name for a dictionary of images just like we did. This causes issues since the config vars take precedence over our own group_vars. Replace with more discriptive var name. Also changed are the meadata gathering functions to use the overcloud image instead of the now non existant undercloud one. Finally collectd openstack has to handle the inclusion of a different version of collectd by default now. Change-Id: Ie29c1c2070ffe88e015a1a04bdb4834cf14f1e5c --- ansible/install/group_vars/all.yml | 22 ++++++------ .../roles/collectd-openstack/tasks/main.yml | 9 ++++- ansible/install/roles/images/tasks/main.yml | 34 +++++++++---------- .../oooq/roles/oooq-metadata/tasks/main.yml | 2 +- 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index e7ed2b823..354ffb067 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -85,17 +85,17 @@ browbeat_workloads: # Guest images for the Overcloud # Note hash key name must match intended name for image upload to # work consistently (Ex. images['cirros'].name == 'cirros') -images: - centos7: - name: centos7 - url: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 - type: qcow2 - convert_to_raw: false - cirros: - name: cirros - url: http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img - type: qcow2 - convert_to_raw: false +browbeat_guest_images: + centos7: + name: centos7 + url: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 + type: qcow2 + convert_to_raw: false + cirros: + name: cirros + url: http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img + type: qcow2 + convert_to_raw: false # DNS Server to add dns_server: 8.8.8.8 diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index 3270cb191..f5eb69c6e 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -5,9 +5,16 @@ - name: Remove Non-EPEL collectd install yum: - name: libcollectdclient + name: "{{ item }}" state: absent become: true + with_items: + - libcollectdclient + - collectd + - collectd-apache + - collectd-ceph + - collectd-mysql + - collectd-turbostat when: collectd_from_epel - name: Clean Non-EPEL collectd configuration diff --git a/ansible/install/roles/images/tasks/main.yml b/ansible/install/roles/images/tasks/main.yml index b0fabbd96..1cf744351 100644 --- a/ansible/install/roles/images/tasks/main.yml +++ b/ansible/install/roles/images/tasks/main.yml @@ -1,42 +1,42 @@ --- # -# Obtain/Upload images to OpenStack Cloud +# Obtain/Upload browbeat_guest_images to OpenStack Cloud # - name: Fetch image get_url: - url: "{{ images[item].url }}" - dest: "{{ home_dir }}/{{ images[item].name }}.{{ images[item].type }}" - with_items: "{{ images }}" + url: "{{ browbeat_guest_images[item].url }}" + dest: "{{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }}" + with_items: "{{ browbeat_guest_images }}" - name: Determine if image exists - shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image list | grep '{{ images[item].name }}' + shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image list | grep '{{ browbeat_guest_images[item].name }}' register: image_exists ignore_errors: true changed_when: false - with_items: "{{ images }}" + with_items: "{{ browbeat_guest_images }}" - name: Remove image from dictionary of images if image exists set_fact: - images: "{{ images|dict_remove(item[0]) }}" + browbeat_guest_images: "{{ browbeat_guest_images|dict_remove(item[0]) }}" when: "'{{ item[0] }}' in '{{ item[1].stdout }}'" with_nested: - - "{{ images }}" + - "{{ browbeat_guest_images }}" - "{{ image_exists.results }}" - name: Convert images to raw - command: qemu-img convert -f {{images[item].type}} -O raw {{ home_dir }}/{{ images[item].name }}.{{ images[item].type }} {{ home_dir }}/{{ images[item].name }}.raw - when: "images[item].convert_to_raw == true" - with_items: "{{ images }}" + command: qemu-img convert -f {{browbeat_guest_images[item].type}} -O raw {{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }} {{ home_dir }}/{{ browbeat_guest_images[item].name }}.raw + when: "browbeat_guest_images[item].convert_to_raw == true" + with_items: "{{ browbeat_guest_images }}" - name: Upload image into cloud (Newton and Ocata versions) - shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image create --public --disk-format={{ images[item].type }} --container-format=bare {{ images[item].name }} < {{ home_dir }}/{{ images[item].name }}.{{ images[item].type }} + shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image create --public --disk-format={{ browbeat_guest_images[item].type }} --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.{{ browbeat_guest_images[item].type }} ignore_errors: true - when: "images[item].convert_to_raw == false" - with_items: "{{ images }}" + when: "browbeat_guest_images[item].convert_to_raw == false" + with_items: "{{ browbeat_guest_images }}" - name: Upload raw image into cloud (Newton and Ocata versions) - shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image create --public --disk-format=raw --container-format=bare {{ images[item].name }} < {{ home_dir }}/{{ images[item].name }}.raw + shell: . {{ browbeat_venv }}/bin/activate; . {{ overcloudrc }}; openstack image create --public --disk-format=raw --container-format=bare {{ browbeat_guest_images[item].name }} < {{ home_dir }}/{{ browbeat_guest_images[item].name }}.raw ignore_errors: true - when: "images[item].convert_to_raw == true" - with_items: "{{ images }}" + when: "browbeat_guest_images[item].convert_to_raw == true" + with_items: "{{ browbeat_guest_images }}" diff --git a/ansible/oooq/roles/oooq-metadata/tasks/main.yml b/ansible/oooq/roles/oooq-metadata/tasks/main.yml index 591b82b3e..e64458729 100644 --- a/ansible/oooq/roles/oooq-metadata/tasks/main.yml +++ b/ansible/oooq/roles/oooq-metadata/tasks/main.yml @@ -2,7 +2,7 @@ #Collect and template Metadata about the deployment - name: Get Overcloud Image Build date - shell: "curl -s -v -X HEAD {{ undercloud_image_url }} 2>&1 | grep '^< Date:'" + shell: "curl -s -v -X HEAD {{ overcloud_image_url }} 2>&1 | grep '^< Date:'" register: build ignore_errors: true