diff --git a/README.md b/README.md index 358a5f9a3..f589f45f6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/ansible/install/group_vars/all b/ansible/install/group_vars/all index 74a0fc0c1..51d20be9f 100644 --- a/ansible/install/group_vars/all +++ b/ansible/install/group_vars/all @@ -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 diff --git a/ansible/install/setup.yml b/ansible/install/setup.yml new file mode 100644 index 000000000..ae0cce379 --- /dev/null +++ b/ansible/install/setup.yml @@ -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 }}