Playbook to 'setup' overcloud with centos7 image.

Change-Id: Idcdc3188c6c1101ffed487b7598b9ba92cea76b4
This commit is contained in:
Alex Krzos 2015-12-18 12:38:47 -05:00
parent 850c50eed5
commit 7096b2c6b4
3 changed files with 35 additions and 3 deletions

View File

@ -27,15 +27,13 @@ On director (As stack user):
$ git clone https://github.com/jtaleric/browbeat.git
$ cd browbeat/ansible
$ ./gen_hostfile.sh localhost ~/.ssh/config
$ ansible-playbook -i hosts install/setup.yml
$ cd ~
$ sudo yum install -y libffi-devel gmp-devel postgresql-devel
$ wget -q -O- https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash
$ . ~/rally/bin/activate
$ . ~stack/overcloudrc
$ rally deployment create --fromenv --name overcloud
$ wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
$ glance image-create --name centos7 --disk-format=qcow2 --container-format=bare < CentOS-7-x86_64-GenericCloud.qcow2
$ glance image-update centos7 --is-public true
$ . ~stack/stackrc
$ cd browbeat
$ sudo yum install -y freetype-devel libpng-devel

View File

@ -1,6 +1,7 @@
---
ansible_sudo: yes
centos_image: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
connmon_host: 192.0.2.1
dns_server: 8.8.8.8
pbench_repo_file_url: http://pbench.example.com/repo/yum.repos.d/pbench.repo

33
ansible/install/setup.yml Normal file
View File

@ -0,0 +1,33 @@
---
#
# Playbook to setup undercloud for browbeat
#
- hosts: undercloud
remote_user: stack
vars:
undercloud: true
gather_facts: false
roles:
- common
tasks:
- name: Fetch centos7 image
get_url: url={{ centos_image }} dest=/home/stack/centos7.qcow2
- name: Determine is centos7 image exists
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7"
register: centos7_image_exists
ignore_errors: true
changed_when: false
- name: Upload centos7 image into cloud
shell: . /home/stack/overcloudrc; glance image-create --name centos7 --disk-format=qcow2 --container-format=bare < /home/stack/centos7.qcow2
when: "'centos7' not in '{{ centos7_image_exists.stdout }}'"
- name: Get centos7 image id
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7" | awk '{print $2}'
register: centos7_image_id
changed_when: false
- name: Set centos7 image public
shell: . /home/stack/overcloudrc; glance image-update --visibility public {{ centos7_image_id.stdout }}