-
Notifications
You must be signed in to change notification settings - Fork 5
/
create_vsi.yml
35 lines (32 loc) · 1.03 KB
/
create_vsi.yml
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
---
- name: Configure VSI
ibm.cloudcollection.ibm_is_instance:
name: "{{ name_prefix }}{{ item }}-vsi"
state: available
#id: "{{ vsi.id | default(omit) }}"
vpc: "{{ vpc.id }}"
profile: "{{ vsi_profile }}"
image: "{{ image_id }}"
keys:
- "{{ ssh_key.id }}"
primary_network_interface:
- subnet: "{{ subnet.id }}"
zone: "{{ vpc_zone.name }}"
region: "{{ ibmcloud_ic_region }}"
register: vsi_create_output
- name: Save VSI as fact
set_fact:
cacheable: True
vsi: "{{ vsi_create_output.resource }}"
- name: Configure Floating IP Address
ibm.cloudcollection.ibm_is_floating_ip:
name: "{{ name_prefix }}{{ item }}-fip"
state: available
region: "{{ ibmcloud_ic_region }}"
#id: "{{ fip.id | default(omit) }}"
target: "{{ vsi.primary_network_interface[0]['id'] }}"
register: fip_create_output
- name: Save Floating IPs
set_fact:
cacheable: True
ibmcloud_vsi_node: "{{ ibmcloud_vsi_node|default([]) + [fip_create_output.resource.address] }}"