aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/heat/tasks/register.yml
blob: 70ee29f981a43cc89b666d26785230696b01545f (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
68
69
---
- name: Creating the Heat service and endpoint
  command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
    -m kolla_keystone_service
    -a "service_name={{ item.service_name }}
        service_type={{ item.service_type }}
        description='Openstack Orchestration'
        endpoint_region={{ openstack_region_name }}
        url='{{ item.url }}'
        interface='{{ item.interface }}'
        region_name={{ openstack_region_name }}
        auth={{ '{{ openstack_heat_auth }}' }}"
    -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
  register: heat_endpoint
  changed_when: "{{ heat_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (heat_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
  until: heat_endpoint.stdout.split()[2] == 'SUCCESS'
  retries: 10
  delay: 5
  run_once: True
  with_items:
    - {'interface': 'admin', 'url': '{{ heat_admin_endpoint }}', 'service_name': 'heat', 'service_type': 'orchestration'}
    - {'interface': 'internal', 'url': '{{ heat_internal_endpoint }}', 'service_name': 'heat', 'service_type': 'orchestration'}
    - {'interface': 'public', 'url': '{{ heat_public_endpoint }}', 'service_name': 'heat', 'service_type': 'orchestration'}
    - {'interface': 'admin', 'url': '{{ heat_cfn_admin_endpoint }}', 'service_name': 'heat-cfn', 'service_type': 'cloudformation'}
    - {'interface': 'internal', 'url': '{{ heat_cfn_internal_endpoint }}', 'service_name': 'heat-cfn', 'service_type': 'cloudformation'}
    - {'interface': 'public', 'url': '{{ heat_cfn_public_endpoint }}', 'service_name': 'heat-cfn', 'service_type': 'cloudformation'}

- name: Creating the Heat project, user, and role
  command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
    -m kolla_keystone_user
    -a "project=service
        user=heat
        password={{ heat_keystone_password }}
        role=admin
        region_name={{ openstack_region_name }}
        auth={{ '{{ openstack_heat_auth }}' }}"
    -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
  register: heat_user
  changed_when: "{{ heat_user.stdout.find('localhost | SUCCESS => ') != -1 and (heat_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
  until: heat_user.stdout.split()[2] == 'SUCCESS'
  retries: 10
  delay: 5
  run_once: True

- name: Creating the heat_stack_user role
  command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
    -m os_keystone_role
    -a "name={{ heat_stack_user_role }}
        auth={{ '{{ openstack_heat_auth }}' }}"
    -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
  register: heat_stack_user_role_result
  changed_when: "{{ heat_stack_user_role_result.stdout.find('localhost | SUCCESS => ') != -1 and (heat_stack_user_role_result.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
  until: heat_stack_user_role_result.stdout.split()[2] == 'SUCCESS'
  retries: 10
  delay: 5
  run_once: True

- name: Creating the heat_stack_owner role
  command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
    -m os_keystone_role
    -a "name={{ heat_stack_owner_role }}
        auth={{ '{{ openstack_heat_auth }}' }}"
    -e "{'openstack_heat_auth':{{ openstack_heat_auth }}}"
  register: heat_stack_owner_role_result
  changed_when: "{{ heat_stack_owner_role_result.stdout.find('localhost | SUCCESS => ') != -1 and (heat_stack_owner_role_result.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
  until: heat_stack_owner_role_result.stdout.split()[2] == 'SUCCESS'
  retries: 10
  delay: 5
  run_once: True