Tweaks to make install run idempotent

This commit is contained in:
Egon Rijpkema
2017-08-01 10:19:54 +02:00
parent 1a78f649e8
commit 8a3fbd557d
13 changed files with 50 additions and 33 deletions

View File

@ -1,11 +1,7 @@
# Build and install a docker image for nova-controller.
---
- name: pull docker image
docker_image:
name: webhost12.service.rug.nl/hpc/openstack-nova-service:latest
tags: pull
- set_fact:
docker_image: webhost12.service.rug.nl/hpc/openstack-nova-service:latest
env_vars: >
-e "MY_IP={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
-e "NOVA_USER=nova"
@ -24,6 +20,12 @@
-e "NEUTRON_PASSWORD=geheim"
-e "NEUTRON_USER=neutron"
-e "METADATA_SECRET=geheim"
tags: facts
- name: pull docker image
docker_image:
name: "{{ docker_image }}"
tags: pull
- name: install service file.
template:
@ -40,7 +42,7 @@
/usr/bin/docker run --rm
{{ env_vars }}
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
hpc/openstack-nova-service
{{ docker_image }}
/etc/bootstrap.sh
tags: bootstrap