28 lines
950 B
YAML
28 lines
950 B
YAML
|
|
- hosts: [{{ ip }}]
|
|
sudo: yes
|
|
tasks:
|
|
- docker:
|
|
command: /bin/bash -c "glance-manage db_sync && /usr/bin/glance-api"
|
|
#command: /usr/bin/glance-api
|
|
name: {{ name }}
|
|
image: {{ image }}
|
|
state: running
|
|
expose:
|
|
- 9393
|
|
ports:
|
|
- {{ ports.value[0]['value'][0]['value'] }}:9393
|
|
{% if host_binds.value %}
|
|
volumes:
|
|
# TODO: host_binds might need more work
|
|
# Currently it's not that trivial to pass custom src: dst here
|
|
# (when a config variable is passed here from other resource)
|
|
# so we mount it to the same directory as on host
|
|
{% for bind in host_binds.value %}
|
|
- {{ bind['value']['src'] }}:{{ bind['value']['dst'] }}:{{ bind['value'].get('mode', 'ro') }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
- name: wait for glance api
|
|
wait_for: host={{ ip }} port={{ ports.value[0]['value']['value'] }} timeout=20
|