forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_control-plane.yaml
53 lines (47 loc) · 1.72 KB
/
04_control-plane.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Required Python packages:
#
# ansible
# openstacksdk
# netaddr
- import_playbook: common.yaml
- hosts: all
gather_facts: no
tasks:
- name: 'Create the Control Plane ports'
os_port:
name: "{{ item.1 }}-{{ item.0 }}"
network: "{{ os_network }}"
security_groups:
- "{{ os_sg_master }}"
allowed_address_pairs:
- ip_address: "{{ os_subnet_range | next_nth_usable(5) }}"
- ip_address: "{{ os_subnet_range | next_nth_usable(6) }}"
- ip_address: "{{ os_subnet_range | next_nth_usable(7) }}"
with_indexed_items: "{{ [os_port_master] * os_cp_nodes_number }}"
register: ports
- name: 'Set Control Plane ports tag'
os_tag:
resource: "port"
name: "{{ item.1 }}-{{ item.0 }}"
tags: "{{ [cluster_id_tag] }}"
with_indexed_items: "{{ [os_port_master] * os_cp_nodes_number }}"
- name: 'Create the Control Plane trunks'
os_trunk:
name: "{{ os_cp_trunk_name }}-{{ item.0 }}"
port_id: "{{ item.1.id }}"
with_indexed_items: "{{ ports.results }}"
when: os_networking_type == "Kuryr"
- name: 'Create the Control Plane servers'
os_server:
name: "{{ item.1 }}-{{ item.0 }}"
image: "{{ os_image_rhcos }}"
flavor: "{{ os_flavor_master }}"
auto_ip: no
# The ignition filename will be concatenated with the Control Plane node
# name and its 0-indexed serial number.
# In this case, the first node will look for this filename:
# "{{ infraID }}-master-0-ignition.json"
userdata: "{{ lookup('file', [item.1, item.0, 'ignition.json'] | join('-')) | string }}"
nics:
- port-name: "{{ os_port_master }}-{{ item.0 }}"
with_indexed_items: "{{ [os_cp_server_name] * os_cp_nodes_number }}"