Playbook to 'setup' overcloud with centos7 image.
Change-Id: Idcdc3188c6c1101ffed487b7598b9ba92cea76b4
This commit is contained in:
parent
850c50eed5
commit
7096b2c6b4
@ -27,15 +27,13 @@ On director (As stack user):
|
|||||||
$ git clone https://github.com/jtaleric/browbeat.git
|
$ git clone https://github.com/jtaleric/browbeat.git
|
||||||
$ cd browbeat/ansible
|
$ cd browbeat/ansible
|
||||||
$ ./gen_hostfile.sh localhost ~/.ssh/config
|
$ ./gen_hostfile.sh localhost ~/.ssh/config
|
||||||
|
$ ansible-playbook -i hosts install/setup.yml
|
||||||
$ cd ~
|
$ cd ~
|
||||||
$ sudo yum install -y libffi-devel gmp-devel postgresql-devel
|
$ sudo yum install -y libffi-devel gmp-devel postgresql-devel
|
||||||
$ wget -q -O- https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash
|
$ wget -q -O- https://raw.githubusercontent.com/openstack/rally/master/install_rally.sh | bash
|
||||||
$ . ~/rally/bin/activate
|
$ . ~/rally/bin/activate
|
||||||
$ . ~stack/overcloudrc
|
$ . ~stack/overcloudrc
|
||||||
$ rally deployment create --fromenv --name overcloud
|
$ 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
|
$ . ~stack/stackrc
|
||||||
$ cd browbeat
|
$ cd browbeat
|
||||||
$ sudo yum install -y freetype-devel libpng-devel
|
$ sudo yum install -y freetype-devel libpng-devel
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
ansible_sudo: yes
|
ansible_sudo: yes
|
||||||
|
|
||||||
|
centos_image: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
|
||||||
connmon_host: 192.0.2.1
|
connmon_host: 192.0.2.1
|
||||||
dns_server: 8.8.8.8
|
dns_server: 8.8.8.8
|
||||||
pbench_repo_file_url: http://pbench.example.com/repo/yum.repos.d/pbench.repo
|
pbench_repo_file_url: http://pbench.example.com/repo/yum.repos.d/pbench.repo
|
||||||
|
33
ansible/install/setup.yml
Normal file
33
ansible/install/setup.yml
Normal 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 }}
|
Loading…
x
Reference in New Issue
Block a user