Eduardo Gonzalez d7a3cbdc67 Fix code style in start_compute.yml
Add space in jinja definition and specify nova-compute
in set volume fact task name.

TrivialFix

Change-Id: I94a3bb2415f1f8d60c646b488be4acc09c489a0a
2017-01-04 15:17:46 +00:00

112 lines
4.1 KiB
YAML

---
- name: Prepare nova-libvirt volumes list
set_fact:
libvirt_volumes:
- "{{ node_config_directory }}/nova-libvirt/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/lib/modules:/lib/modules:ro"
- "/run/:/run/:shared"
- "/dev:/dev"
- "/sys/fs/cgroup:/sys/fs/cgroup"
- "kolla_logs:/var/log/kolla/"
- "libvirtd:/var/lib/libvirt"
- "nova_compute:/var/lib/nova/"
- "{% if enable_cinder_backend_nfs | bool %}/var/lib/nova/mnt:/var/lib/nova/mnt:shared{% endif %}"
- "nova_libvirt_qemu:/etc/libvirt/qemu"
- name: Starting nova-libvirt container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ nova_libvirt_image_full }}"
name: "nova_libvirt"
pid_mode: "host"
privileged: True
volumes: '{{ libvirt_volumes | reject("equalto", "") | list }}'
register: start_nova_libvirt_container
# NOTE(Jeffrey4l): retry 5 to remove nova_libvirt container because when
# guests running, nova_libvirt will raise error even though it is removed.
retries: 5
until: start_nova_libvirt_container|success
when: inventory_hostname in groups['compute']
- name: Prepare nova-compute volumes list
set_fact:
nova_compute_volumes:
- "{{ node_config_directory }}/nova-compute/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run:shared"
- "/dev:/dev"
- "kolla_logs:/var/log/kolla/"
- "{% if enable_iscsid | bool %}iscsi_info:/etc/iscsi{% endif %}"
- "libvirtd:/var/lib/libvirt"
- "nova_compute:/var/lib/nova/"
- "{% if enable_cinder_backend_nfs | bool %}/var/lib/nova/mnt:/var/lib/nova/mnt:shared{% endif %}"
- name: Starting nova-compute container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ nova_compute_image_full }}"
name: "nova_compute"
privileged: True
volumes: '{{ nova_compute_volumes | reject("equalto", "") | list }}'
when:
- not enable_nova_fake | bool
- not enable_ironic | bool
- inventory_hostname in groups['compute']
- name: Starting nova-compute-ironic container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ nova_compute_ironic_image_full }}"
name: "nova_compute_ironic"
volumes:
- "{{ node_config_directory }}/nova-compute-ironic/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
when:
- enable_ironic | bool
- inventory_hostname in groups['nova-compute-ironic']
- name: Starting nova-compute-fake containers
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ nova_compute_image_full }}"
name: "nova_compute_fake_{{ item }}"
privileged: True
volumes:
- "{{ node_config_directory }}/nova-compute-fake-{{ item }}/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/lib/modules:/lib/modules:ro"
- "/run:/run:shared"
- "kolla_logs:/var/log/kolla/"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
- enable_nova_fake | bool
- inventory_hostname in groups['compute']
- name: Prepare nova-ssh volumes list
set_fact:
nova_ssh_volumes:
- "{{ node_config_directory }}/nova-ssh/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla"
- "nova_compute:/var/lib/nova"
- "{% if enable_cinder_backend_nfs | bool %}/var/lib/nova/mnt:/var/lib/nova/mnt:shared{% endif %}"
- "heka_socket:/var/lib/kolla/heka/"
- name: Starting nova-ssh container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ nova_ssh_image_full }}"
name: "nova_ssh"
volumes: '{{ nova_ssh_volumes | reject("equalto", "") | list }}'
# TODO(jeffrey4l): how to handle the nova-compute-fake and
# nova-compute-ironic
when: inventory_hostname in groups['compute']