2017-06-20 14:41:01 +02:00
|
|
|
# Build and install a docker image for glance.
|
|
|
|
---
|
2017-07-31 13:21:03 +02:00
|
|
|
- set_fact:
|
|
|
|
docker_image: webhost12.service.rug.nl/hpc/openstack-glance:latest
|
|
|
|
env_vars: >
|
|
|
|
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}"
|
|
|
|
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
|
|
|
|
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
|
|
|
|
-e "MYSQL_ROOT_PASSWORD=geheim"
|
|
|
|
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
|
|
|
-e "GLANCE_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
|
|
|
-e "GLANCE_USER=glance"
|
|
|
|
-e "GLANCE_PASSWORD=geheim"
|
|
|
|
|
|
|
|
- name: pull docker image
|
|
|
|
docker_image:
|
|
|
|
name: "{{ docker_image }}"
|
|
|
|
tags: pull
|
|
|
|
|
2017-06-20 14:41:01 +02:00
|
|
|
- name: Make build and persistent directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0777
|
|
|
|
with_items:
|
|
|
|
- /srv/glance
|
|
|
|
|
|
|
|
- name: install service file.
|
|
|
|
template:
|
|
|
|
src: templates/glance.service
|
|
|
|
dest: /etc/systemd/system/glance.service
|
|
|
|
mode: 644
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
|
|
|
|
- command: systemctl daemon-reload
|
|
|
|
|
|
|
|
- name: Initialize database.
|
2017-07-11 09:17:53 +02:00
|
|
|
command: >
|
2017-07-31 13:21:03 +02:00
|
|
|
/usr/bin/docker run --rm
|
|
|
|
{{ env_vars }}
|
2017-07-12 16:32:58 +02:00
|
|
|
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
|
|
|
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
|
2017-08-01 10:19:54 +02:00
|
|
|
{{ docker_image }} /etc/bootstrap.sh
|
2017-06-20 14:41:01 +02:00
|
|
|
tags: bootstrap
|
|
|
|
|
|
|
|
- name: make sure service is started
|
|
|
|
systemd:
|
|
|
|
name: glance.service
|
|
|
|
state: restarted
|