forked from karmab/kcli-ztp
-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (90 loc) · 3.02 KB
/
lab_without_installer.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: lab-without-installer
on:
workflow_dispatch:
inputs:
RUNNER:
description: 'Runner Name'
required: true
default: 'u08'
INFRAPARAMFILE:
description: 'infraparamfile'
required: false
default: paramfiles/lab.yml
EXTRAPARAMS:
description: 'Extra params'
default: ''
PARAMFILE:
description: 'paramfile'
required: false
default: paramfiles/lab_without_installer.yml
PULLSECRET:
description: 'pullsecret'
required: false
default: /root/openshift_pull.json
VERSION:
description: 'version'
required: false
default: stable
TAG:
description: 'tag'
required: false
default: "4.10"
env:
HOME: /root
PYTHONUNBUFFERED: true
CLIENT: ${{github.event.inputs.CLIENT}}
PLAN: lab
INFRAPARAMFILE: ${{github.event.inputs.INFRAPARAMFILE}}
PARAMFILE: ${{github.event.inputs.PARAMFILE}}
EXTRAPARAMS: ${{github.event.inputs.EXTRAPARAMS}}
PULLSECRET: ${{github.event.inputs.PULLSECRET}}
VERSION: ${{github.event.inputs.VERSION}}
TAG: ${{github.event.inputs.TAG}}
jobs:
requirements:
runs-on: ${{github.event.inputs.RUNNER}}
steps:
- uses: actions/checkout@v2
- run: git pull origin ${GITHUB_REF##*/}
- name: Install kcli
run: |
curl https://raw.githubusercontent.com/karmab/kcli/master/install.sh | bash
# kcli create pool -p /var/lib/libvirt/images default
# sudo setfacl -m u:$(id -un):rwx /var/lib/libvirt/images
deploy-infra-plan:
needs: requirements
runs-on: ${{github.event.inputs.RUNNER}}
steps:
- name: Deploy infra
run: kcli create plan --force -f kcli_plan_infra.yml --paramfile $INFRAPARAMFILE $PLAN
install-redfish:
needs: deploy-infra-plan
runs-on: ${{github.event.inputs.RUNNER}}
steps:
- name: Render sushy
run: kcli render -f helpers/sushy.conf --paramfile $INFRAPARAMFILE > /etc/sushy.conf
- name: Install redfish
run: |
pip3 install sushy-tools
cp -f helpers/sushy.service /usr/lib/systemd/system
### temp hack ###
sed -i 's@8000@80@' /etc/sushy.conf
systemctl restart sushy
#################
# systemctl enable --now sushy
render-redfish-in-parameter-file:
needs: install-redfish
runs-on: ${{github.event.inputs.RUNNER}}
steps:
- name: Render redfish in parameter file
run: kcli render -f virtual_platform_hosts.yml --paramfile $INFRAPARAMFILE --paramfile $PARAMFILE >> $PARAMFILE
deploy-cluster:
needs: render-redfish-in-parameter-file
runs-on: ${{github.event.inputs.RUNNER}}
steps:
- name: Deploy cluster
run: |
### temp hack ###
sed -i 's@:8000@:80@' $PARAMFILE
#################
kcli --debug create cluster openshift --paramfile $PARAMFILE -P pull_secret="$PULLSECRET" $PLAN-cluster $EXTRAPARAMS --force