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
This commit is contained in:
jkilpatr 2017-10-13 11:14:38 -04:00 committed by Justin Kilpatrick
parent 4052a93f50
commit c82559b65a
4 changed files with 37 additions and 30 deletions

View File

@ -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

View File

@ -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

View File

@ -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 }}"

View File

@ -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