-
Notifications
You must be signed in to change notification settings - Fork 4
/
provision.yaml
31 lines (31 loc) · 1.36 KB
/
provision.yaml
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
---
- name: Provision infrastructure
hosts: localhost
gather_facts: false
vars_files:
- vars/os_image_user_map.yaml
- vars/oneflow_templates_map.yaml
tasks:
- name: Generating name and environment_id
set_fact:
deployment_name: "lab-cs-{{ lab_environment }}-{{ sp_version }}-{{ cs_version }}-{{ plugin_version }}"
stack_uuid: "{{ ('lab-cs-' + lab_environment + '-' + sp_version + '-' + cs_version + '-' + plugin_version) | to_uuid }}"
- name: Dumping image id and cloud user
debug:
msg: "Selected OS {{ os_image_user_list | selectattr('name', 'eq', os_name) | first }}"
verbosity: 2
- name: Instantiating OpenNebula service
one_service:
template_id: "{{ oneflow_templates_map[env_type]['template_id'] }}"
service_name: "{{ deployment_name }}"
custom_attrs:
ENVIRONMENT: "{{ lab_environment }}"
STACK_UUID: "{{ stack_uuid }}"
STORPOOL_VERSION: "{{ sp_version }}"
CLOUDSTACK_VERSION: "{{ cs_version }}"
STORPOOL_PLUGIN_VERSION: "{{ plugin_version }}"
VM_IMAGE_ID: "{{ (os_image_user_list | selectattr('name', 'eq', os_name) | first )['one_image_id'] }}"
CLOUD_USER: "{{ (os_image_user_list | selectattr('name', 'eq', os_name) | first )['cloud_user'] }}"
unique: true
wait: true
wait_timeout: 600