Skip to content

Commit

Permalink
migrate to aicli
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Dec 21, 2023
1 parent 747b5c9 commit da7c041
Show file tree
Hide file tree
Showing 27 changed files with 143 additions and 573 deletions.
50 changes: 50 additions & 0 deletions aicli_parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% if virtual_ctlplanes %}
{% set extra_ctlplanes = [] %}
{% for num in range(0, virtual_ctlplanes_number) %}
{% do extra_ctlplanes.append([]) %}
{% endfor %}
{% set ctlplanes = extra_ctlplanes + ctlplanes %}
{% endif %}
{% if virtual_workers and virtual_workers_deploy %}
{% set extra_workers = [] %}
{% for num in range(0, virtual_workers_number) %}
{% do extra_workers.append([]) %}
{% endfor %}
{% set workers = extra_workers + workers %}
{% endif %}
base_dns_domain: {{ domain }}
api_vip: {{ api_ip }}
ingress_vip: {{ ingress_ip }}
bmc_user: {{ bmc_user }}
bmc_password: {{ bmc_password }}
hosts:
{% for ctlplane in ctlplanes %}
{% set num = loop.index0|string %}
- name: {{ cluster }}-ctlplane-{{ num }}
role: master
bmc_url: {{ ctlplane['redfish_address']|default("http://CHANGEME:9000/redfish/v1/Systems/kcli/%s-ctlplane-%s" % (cluster, num)) }}
{% if 'bmc_user' in ctlplane %}
bmc_user: {{ ctlplane['bmc_user'] }}
{% endif %}
{% if 'bmc_password' in ctlplane %}
bmc_password: {{ ctlplane['bmc_password'] }}
{% endif %}
{% if 'disk' in ctlplane %}
disk: "/dev/{{ ctlplane['disk'] | basename }}"
{% endif %}
{% endfor %}
{% for worker in workers %}
{% set num = loop.index0|string %}
- name: {{ cluster }}-worker-{{ num }}
role: worker
bmc_url: {{ worker['redfish_address']|default("http://CHANGEME:9000/redfish/v1/Systems/kcli/%s-worker-%s" % (cluster, num)) }}
{% if 'bmc_user' in worker %}
bmc_user: {{ worker['bmc_user'] }}
{% endif %}
{% if 'bmc_password' in worker %}
bmc_password: {{ worker['bmc_password'] }}
{% endif %}
{% if 'disk' in worker %}
disk: "/dev/{{ worker['disk'] | basename }}"
{% endif %}
{% endfor %}
3 changes: 0 additions & 3 deletions bin/clean.sh

This file was deleted.

11 changes: 1 addition & 10 deletions envfiles/bashrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# .bashrc
{% set libvirt_user = 'root' if config_user == 'apache' else config_user %}
{% set libvirt_ip = config_host if config_host not in ['127.0.0.1', 'localhost'] else baremetal_net|local_ip %}
{% set libvirt_ip = libvirt_ip|replace(':', '-') + '.sslip.io' %}
{% set libvirt_url = 'qemu+ssh://' + libvirt_user + '@' + libvirt_ip + '/system' %}

# User specific aliases and functions

Expand All @@ -14,13 +10,8 @@ alias mv='mv -i'
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export KUBECONFIG=/root/ocp/auth/kubeconfig
export OS_CLOUD=metal3-bootstrap
export KUBECONFIG=/root/kubeconfig.{{ cluster }}
export PATH=/usr/local/bin:/root/bin:$PATH
export LIBVIRT_DEFAULT_URI={{ libvirt_url }}
export REGISTRY_PASSWORD={{ disconnected_password }}
export REGISTRY_USER={{ disconnected_user }}

alias hypershift='podman run -it --rm --security-opt label=disable --entrypoint=/usr/bin/hypershift -e KUBECONFIG=/k/kubeconfig -v /root/ocp/auth:/k quay.io/hypershift/hypershift-operator:latest'

export PYTHONUNBUFFERED=true
243 changes: 0 additions & 243 deletions install-config.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions kcli_pre.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

# OFFLINE TOKEN
{% if saas %}
[ ! -f {{ offlinetoken }} ] && echo offlinetoken not found in {{ offlinetoken }} && exit 1
{% endif %}

# NETWORK CHECK
{% if baremetal_cidr == None %}
echo baremetal_cidr not set. No network, no party!
Expand Down
1 change: 0 additions & 1 deletion paramfiles/lab_static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ localhost_fix: true
virtual_ctlplanes_static_network: true
lab_dhcp: false
installer_ip: 192.168.130.250
baremetal_bootstrap_ip: 192.168.130.251
notify: true
nfs: true
1 change: 0 additions & 1 deletion paramfiles/lab_static_bonding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ baremetal_macs:
localhost_fix: true
lab_dhcp: false
installer_ip: 192.168.130.250
baremetal_bootstrap_ip: 192.168.130.251
notify: true
nfs: true
vmrules:
Expand Down
16 changes: 7 additions & 9 deletions plans/kcli_plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% if deploy_openshift %}
notifyscript: {{ notifyscript }}
{% elif launch_steps %}
notifycmd: /root/bin/openshift-install version
notifycmd: aicli list cluster
{% else %}
notifycmd: echo machine $(hostname) ready at $(hostname -I)
{% endif %}
Expand All @@ -43,13 +43,10 @@
disks:
- {{ installer_disk_size or disk_size }}
files:
- install-config.yaml
- aicli_parameters.yml
{% if motd != None %}
- path: /etc/motd
origin: {{ motd }}
{% endif %}
{% if baremetal_bootstrap_ip != None %}
- static_network/ifcfg-bootstrap
{% endif %}
- path: /root/.bashrc
origin: envfiles/bashrc
Expand All @@ -61,7 +58,11 @@
- mirror-registry/quay_haproxy.cfg
{% endif %}
- origin: {{ pullsecret }}
path: /root/openshift_pull.json
path: /root/openshift_pull.json
{% if saas %}
- origin: {{ offlinetoken }}
path: /root/.aicli/offlinetoken.txt
{% endif %}
- path: /etc/systemd/system/registry.service
origin: bin/registry.service
{% for ca in cas %}
Expand All @@ -74,9 +75,6 @@
- path: /root/scripts/proxy.sh
origin: envfiles/proxy.sh
mode: 644
{% endif %}
{% if baremetal_bootstrap_ip != None %}
- static_network/ifcfg-bootstrap
{% endif %}
- path: /root/bin/mapping_to_icsp.py
origin: bin/mapping_to_icsp.py
Expand Down
Loading

0 comments on commit da7c041

Please sign in to comment.