hpc-cloud/roles/nova-compute/tasks/main.yml

47 lines
1.0 KiB
YAML
Raw Normal View History

# Build and install a docker image for nova-controller.
---
- name: include secrets
include_vars:
file: ../../secrets.yml
name: secrets
2017-08-01 10:19:54 +02:00
- set_fact:
2017-09-19 11:57:20 +02:00
docker_image: registry.webhosting.rug.nl/hpc/openstack-nova-compute:latest
2017-08-01 10:19:54 +02:00
tags: facts
2017-07-31 13:21:03 +02:00
- name: pull docker image
docker_image:
2017-08-01 10:19:54 +02:00
name: "{{ docker_image }}"
force: True
2017-07-31 13:21:03 +02:00
tags: pull
- name: install service file.
template:
src: templates/nova-compute.service
dest: /etc/systemd/system/nova-compute.service
mode: 644
owner: root
group: root
- command: systemctl daemon-reload
- apt:
name: '{{ item }}'
with_items:
- kvm
- libvirt0
- libvirt-bin
- qemu
- name: make sure service is started
systemd:
name: nova-compute.service
state: restarted
- name: start service at boot.
command: systemctl reenable nova-compute.service
- name: let nova controler discover new host
command: docker exec -i nova-controller.service nova-manage cell_v2 discover_hosts
delegate_to: "{{ hostvars[groups['nova-controller'][0]]['ansible_hostname'] }}"