hpc-cloud/roles/glance/tasks/main.yml

43 lines
959 B
YAML

# Build and install a docker image for glance.
---
- include: ../common/tasks/docker.yml
- name: Make build and persistent directories
file:
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- /srv/glance
## Todo: remove this when we have a docker repo
#- name: clone docker-glance repo
# git:
# accept_hostkey: True
# repo: ssh://git@git.webhosting.rug.nl:222/P256174/docker-glance.git
# dest: /srv/glance
- name: build glance image
docker_image:
path: /srv/glance
name: hpc/openstack-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.
command: docke run --rm hpc/openstack-glance /etc/bootstrap.sh
tags: bootstrap
- name: make sure service is started
systemd:
name: glance.service
state: restarted