aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/murano/tasks/start.yml
blob: a4311b10510b845288bf65d0e41ff9ee8cc105f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- name: Starting murano-engine container
  kolla_docker:
    action: "start_container"
    common_options: "{{ docker_common_options }}"
    image: "{{ murano_engine_image_full }}"
    name: "murano_engine"
    volumes:
      - "{{ node_config_directory }}/murano-engine/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "kolla_logs:/var/log/kolla/"
  when: inventory_hostname in groups['murano-engine']

- name: Starting murano-api container
  kolla_docker:
    action: "start_container"
    common_options: "{{ docker_common_options }}"
    image: "{{ murano_api_image_full }}"
    name: "murano_api"
    volumes:
      - "{{ node_config_directory }}/murano-api/:{{ container_config_directory }}/:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "kolla_logs:/var/log/kolla/"
  when: inventory_hostname in groups['murano-api']

- name: Waiting for Murano API service to be ready on first node
  wait_for:
    host: "{{ api_interface_address }}"
    port: "{{ murano_api_port }}"
    connect_timeout: 1
    timeout: 60
  run_once: True
  register: check_murano_port
  until: check_murano_port | success
  retries: 10
  delay: 6
  delegate_to: "{{ groups['murano-api'][0] }}"

- name: Checking if Murano core library package exists
  command: "docker exec murano_api murano \
                --os-username admin \
                --os-password {{ keystone_admin_password }} \
                --os-project-name admin \
                --os-auth-url \
                    {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}/v3 \
                --murano-url \
                    {{ admin_protocol }}://{{ api_interface_address }}:{{ murano_api_port }} \
                package-list"
  register: status
  changed_when: False
  run_once: True
  delegate_to: "{{ groups['murano-api'][0] }}"

- name: Importing Murano core library package
  command: "docker exec murano_api murano \
                --os-username admin \
                --os-password {{ keystone_admin_password }} \
                --os-project-name admin \
                --os-auth-url \
                    {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}/v3 \
                --murano-url \
                    {{ admin_protocol }}://{{ api_interface_address }}:{{ murano_api_port }} \
                package-import --is-public /io.murano.zip"
  run_once: True
  delegate_to: "{{ groups['murano-api'][0] }}"
  when:
    - status.stdout.find("io.murano") == -1