Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change common role to support 4.16 with new templates #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/common/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
state: absent
with_fileglob:
- "{{ playbook_dir }}/install-dir/openshift/99_openshift-cluster-api_master-machines-*.yaml"
- "{{ playbook_dir }}/install-dir/openshift/99_openshift-machine-api_master-control-plane-machine-set.yaml"

- name: Remove Worker MachineSet manifest
file:
Expand Down
10 changes: 9 additions & 1 deletion roles/common/tasks/pre_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@
- LICENSE.txt
- README.md

- name: Copy install-config.yaml file into install-dir
- name: Copy install-config.yaml file into install-dir for version < 4.16
template:
src: "{{ playbook_dir }}/roles/common/templates/install-config.yaml.j2"
dest: "{{ playbook_dir }}/install-dir/install-config.yaml"
mode: '0664'
when: config.cluster_base_version is version('4.16', '<', version_type='loose')

- name: Copy install-config.yaml file into install-dir for version >= 4.16
template:
src: "{{ playbook_dir }}/roles/common/templates/install-config.yaml.new.j2"
dest: "{{ playbook_dir }}/install-dir/install-config.yaml"
mode: '0664'
when: config.cluster_base_version is version('4.16', '>=', version_type='loose')

- name: Run steps pertaining to proxy, if any
include_tasks: handle_proxy.yml
Expand Down
75 changes: 75 additions & 0 deletions roles/common/templates/install-config.yaml.new.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: v1
baseDomain: {{ config.base_domain }}
compute:
- hyperthreading: Enabled
name: worker
{% if config.provider is defined and not 'none' in config.provider and worker_vms is defined %}
replicas: {{ worker_vms | length }}
{% else %}
replicas: 0
{% endif %}
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: {{ config.cluster_name }}
networking:
networkType: {{ config.networkType | default('OVNKubernetes') }}
{% if network_modifications is defined and network_modifications.enabled == true %}
clusterNetwork:
- cidr: {{ network_modifications.clusterNetwork[0].cidr }}
hostPrefix: {{ network_modifications.clusterNetwork[0].hostPrefix }}
serviceNetwork:
- {{ network_modifications.serviceNetwork[0].cidr }}
machineNetwork:
- cidr: {{ network_modifications.machineNetwork[0].cidr }}
{% endif %}
platform:
{% if config.provider is defined and 'none' in config.provider %}
none: {}
{% else %}
vsphere:
failureDomains:
- name: default
region: default_region
server: {{ vcenter.ip }}
topology:
computeCluster: "/{{ vcenter.datacenter }}/host/{{ vcenter.cluster }}"
datacenter: "{{ vcenter.datacenter }}"
datastore: "/{{ vcenter.datacenter }}/datastore/{{ vcenter.datastore }}"
networks:
- {{ vcenter.network }}
folder: "{{ vcenter.folder_absolute_path | default(omit) }}"
zone: default_cluster
vcenters:
- datacenters:
- {{ vcenter.datacenter }}
user: {{ vcenter.username }}
password: {{ vcenter.password }}
port: 443
server: {{ vcenter.ip }}
diskType: thin
{% endif %}
fips: {{ config.fips }}
pullSecret: '{{ config.pull_secret | to_json }}'
sshKey: '{{ installer_ssh_key }}'
{% if proxy is defined and proxy.enabled == true %}
proxy:
httpProxy: {{ proxy.http_proxy }}
httpsProxy: {{ proxy.https_proxy }}
noProxy: {{ proxy.no_proxy }}
{% endif %}
{% if registry is defined and registry.cert_content is defined %}
additionalTrustBundle: |
{{ registry.cert_content | indent(width=2, first=true) }}
{% endif %}
{% if registry is defined and registry.disconnected is defined and registry.disconnected == true %}
imageContentSources:
- mirrors:
- {{ registry.host }}:{{ registry.port }}/{{ registry.repo }}
source: quay.io/{{ registry.product_repo }}/{{ registry.product_release_name }}
- mirrors:
- {{ registry.host }}:{{ registry.port }}/{{ registry.repo }}
source: quay.io/{{ registry.product_repo }}/ocp-v4.0-art-dev
{% endif %}