Added a glance role
This role builds and installs a docker image from ssh://git@git.webhosting.rug.nl:222/P<t_CO>174/docker-glance.git
This commit is contained in:
parent
d7e3d4f661
commit
0f10a61ae8
5
glance.yml
Normal file
5
glance.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
- hosts: glance
|
||||||
|
become: True
|
||||||
|
roles:
|
||||||
|
- glance
|
42
roles/glance/tasks/main.yml
Normal file
42
roles/glance/tasks/main.yml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# 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
|
17
roles/glance/templates/glance.service
Normal file
17
roles/glance/templates/glance.service
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Openstack Glance Container
|
||||||
|
After=docker.service
|
||||||
|
Requires=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
TimeoutStartSec=0
|
||||||
|
Restart=always
|
||||||
|
ExecStartPre=-/usr/bin/docker stop %n
|
||||||
|
ExecStartPre=-/usr/bin/docker rm %n
|
||||||
|
ExecStart=/usr/bin/docker run --name %n \
|
||||||
|
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
-p 9292:9292 \
|
||||||
|
hpc/openstack-glance
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user