Skip to content

Commit

Permalink
Merge pull request #2823 from iamemilio/upi-improvements
Browse files Browse the repository at this point in the history
[OpenStack][UPI]: tweaks
  • Loading branch information
openshift-merge-robot committed Dec 20, 2019
2 parents cef0a8e + 6faf47c commit 7f6aab4
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 41 deletions.
10 changes: 7 additions & 3 deletions upi/openstack/01_network.yaml
Expand Up @@ -7,8 +7,12 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
cluster_subnet: "{{ os_infra_id }}-nodes"
nodes_subnet: "{{ infraID }}-nodes"
os_network: "{{ infraID }}-network"
os_router: "{{ infraID }}-router"

tasks:
- name: 'Create the cluster network'
Expand All @@ -17,7 +21,7 @@

- name: 'Create a subnet'
os_subnet:
name: "{{ cluster_subnet }}"
name: "{{ nodes_subnet }}"
network_name: "{{ os_network }}"
cidr: "{{ os_subnet_range }}"
allocation_pool_start: "{{ os_subnet_range | next_nth_usable(10) }}"
Expand All @@ -28,4 +32,4 @@
name: "{{ os_router }}"
network: "{{ os_external_network }}"
interfaces:
- "{{ cluster_subnet }}"
- "{{ nodes_subnet }}"
7 changes: 7 additions & 0 deletions upi/openstack/02_security-groups.yaml
Expand Up @@ -3,9 +3,16 @@
# ansible
# openstacksdk


- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
os_sg_master: "{{ infraID }}-master"
os_sg_worker: "{{ infraID }}-worker"

tasks:
- name: 'Create the master security group'
os_security_group:
Expand Down
11 changes: 7 additions & 4 deletions upi/openstack/03_bootstrap.yaml
Expand Up @@ -7,11 +7,14 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
bootstrap_data: "{{ os_infra_id }}-bootstrap-ignition.json"

bootstrap_server: "{{ os_infra_id }}-bootstrap"
bootstrap_port: "{{ os_infra_id }}-bootstrap-port"
bootstrap_data: "{{ infraID }}-bootstrap-ignition.json"
bootstrap_server: "{{ infraID }}-bootstrap"
bootstrap_port: "{{ infraID }}-bootstrap-port"
os_network: "{{ infraID }}-network"
os_sg_master: "{{ infraID }}-master"

tasks:
- name: 'Create the bootstrap server port'
Expand Down
11 changes: 8 additions & 3 deletions upi/openstack/04_control-plane.yaml
Expand Up @@ -7,21 +7,25 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
# The provided 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:
# "{{ os_infra_id }}-master-0-ignition.json"
# "{{ infraID }}-master-0-ignition.json"
cp_data: "ignition.json"

cp_server: "{{ os_infra_id }}-master"
cp_port: "{{ os_infra_id }}-master-port"
cp_server: "{{ infraID }}-master"
cp_port: "{{ infraID }}-master-port"

# These computed lists are used to feed the Ansible loops with the number
# of iterations specified in the Inventory.
cp_servers: "{{ [cp_server] * os_cp_nodes_number }}"
cp_ports: "{{ [cp_port] * os_cp_nodes_number }}"
os_network: "{{ infraID }}-network"
os_sg_master: "{{ infraID }}-master"

tasks:
- name: 'Create the Control Plane ports'
Expand All @@ -33,6 +37,7 @@
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: "{{ cp_ports }}"

- name: 'Create the Control Plane servers'
Expand Down
9 changes: 6 additions & 3 deletions upi/openstack/05_compute-nodes.yaml
Expand Up @@ -7,11 +7,14 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
compute_data: "worker.ign"

compute_server: "{{ os_infra_id }}-worker"
compute_port: "{{ os_infra_id }}-worker-port"
compute_server: "{{ infraID }}-worker"
compute_port: "{{ infraID }}-worker-port"
os_network: "{{ infraID }}-network"
os_sg_worker: "{{ infraID }}-worker"

# These computed lists are used to feed the Ansible loops with the number
# of iterations specified in the Inventory.
Expand Down
7 changes: 7 additions & 0 deletions upi/openstack/down-01_network.yaml
Expand Up @@ -6,6 +6,13 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
os_network: "{{ infraID }}-network"
os_router: "{{ infraID }}-router"


tasks:
- name: 'Remove the cluster router'
os_router:
Expand Down
6 changes: 6 additions & 0 deletions upi/openstack/down-02_security-groups.yaml
Expand Up @@ -6,6 +6,12 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
os_sg_master: "{{ infraID }}-master"
os_sg_worker: "{{ infraID }}-worker"

tasks:
- name: 'Remove the master security group'
os_security_group:
Expand Down
6 changes: 4 additions & 2 deletions upi/openstack/down-03_bootstrap.yaml
Expand Up @@ -6,9 +6,11 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
bootstrap_server: "{{ os_infra_id }}-bootstrap"
bootstrap_port: "{{ os_infra_id }}-bootstrap-port"
bootstrap_server: "{{ infraID }}-bootstrap"
bootstrap_port: "{{ infraID }}-bootstrap-port"

tasks:
- name: 'Remove the bootstrap server'
Expand Down
6 changes: 4 additions & 2 deletions upi/openstack/down-04_control-plane.yaml
Expand Up @@ -6,9 +6,11 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
cp_server: "{{ os_infra_id }}-master"
cp_port: "{{ os_infra_id }}-master-port"
cp_server: "{{ infraID }}-master"
cp_port: "{{ infraID }}-master-port"

# These computed lists are used to feed the Ansible loops with the number
# of iterations specified in the Inventory.
Expand Down
6 changes: 4 additions & 2 deletions upi/openstack/down-05_compute-nodes.yaml
Expand Up @@ -6,9 +6,11 @@
- hosts: all
gather_facts: no

vars_files:
- metadata.json
vars:
compute_server: "{{ os_infra_id }}-worker"
compute_port: "{{ os_infra_id }}-worker-port"
compute_server: "{{ infraID }}-worker"
compute_port: "{{ infraID }}-worker-port"

# These computed lists are used to feed the Ansible loops with the number
# of iterations specified in the Inventory.
Expand Down
22 changes: 0 additions & 22 deletions upi/openstack/inventory.yaml
Expand Up @@ -6,7 +6,6 @@ all:

# User-provided values
os_subnet_range: '10.0.0.0/16'
os_cluster_name: 'openshift'
os_flavor_master: 'm1.xlarge'
os_flavor_worker: 'm1.large'
os_image_rhcos: 'rhcos'
Expand All @@ -19,24 +18,3 @@ all:
# Number of provisioned Compute nodes.
# 3 is the minimum number for a fully-functional cluster.
os_compute_nodes_number: 3

# Computed values

# os_infra_id is the string we will use as a prefix for the names of the
# OpenShift cluster resources. It is built in the form of:
#
# "{{ os_cluster_name }}{{ installation-specific string }}"
os_infra_id: "{{ os_cluster_name }}-upi"

# os_network is the name of the OpenStack network that will contain the
# OpenShift cluster.
os_network: "{{ os_infra_id }}-network"

# os_router is the name of the router that connects the os_network to your
# cluster's external network (os_external_network)
os_router: "{{ os_infra_id }}-router"

# os_sg_* are the names of the security groups that will be assigned to
# the respective nodes.
os_sg_master: "{{ os_infra_id }}-master"
os_sg_worker: "{{ os_infra_id }}-worker"

0 comments on commit 7f6aab4

Please sign in to comment.