@@ -101,29 +101,47 @@ jobs:
101
101
102
102
- name : Initialise terraform
103
103
run : terraform init
104
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
104
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
105
105
106
106
- name : Generate SSH keypair
107
107
run : ssh-keygen -f id_rsa -N ''
108
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
108
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
109
109
110
110
- name : Generate clouds.yaml
111
111
run : |
112
112
cat << EOF > clouds.yaml
113
113
${{ secrets.CLOUDS_YAML }}
114
114
EOF
115
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
116
-
117
- - name : Add tags to tfvars file
118
- run : |
119
- echo -e '\nhost_image_builder_tags = ${{ env.VM_TAGS }}' >> terraform.tfvars
120
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
115
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
116
+
117
+ - name : Generate terraform.tfvars
118
+ run : |
119
+ cat << EOF > terraform.tfvars
120
+ ssh_public_key = "id_rsa.pub"
121
+ ssh_username = "rocky"
122
+ aio_vm_name = "skc-host-image-builder"
123
+ # Must be a Rocky Linux 9 host to successfully build all images
124
+ # This MUST NOT be an LVM image. It can cause confusing conficts with the built image.
125
+ aio_vm_image = "Rocky-9-GenericCloud-Base-9.3-20231113.0.x86_64.qcow2"
126
+ aio_vm_flavor = "en1.medium"
127
+ aio_vm_network = "stackhpc-ci"
128
+ aio_vm_subnet = "stackhpc-ci"
129
+ aio_vm_interface = "eth0"
130
+ EOF
131
+ working-directory : ${{ github.workspace }}src/kayobe-config/terraform/aio
121
132
env :
133
+ SSH_USERNAME : " id_rsa.pub"
134
+ VM_NAME : " skc-host-image-builder-${{ github.run_id }}"
135
+ VM_IMAGE :
136
+ VM_FLAVOR :
137
+ VM_NETWORK :
138
+ VM_SUBNET :
139
+ VM_INTERFACE : ${{ inputs.vm_interface }}
122
140
VM_TAGS : ' ["skc-host-image-build", "ref=${{ github.ref_name }}"]'
123
141
124
142
- name : Terraform Plan
125
143
run : terraform plan
126
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
144
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
127
145
env :
128
146
OS_CLOUD : " openstack"
129
147
OS_APPLICATION_CREDENTIAL_ID : ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
@@ -143,7 +161,7 @@ jobs:
143
161
done
144
162
echo "Failed to create infrastructure after $attempt attempts"
145
163
exit 1
146
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
164
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
147
165
env :
148
166
OS_CLOUD : " openstack"
149
167
OS_APPLICATION_CREDENTIAL_ID : ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
@@ -153,7 +171,7 @@ jobs:
153
171
id : tf_outputs
154
172
run : |
155
173
terraform output -json
156
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
174
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
157
175
158
176
- name : Write Terraform outputs
159
177
run : |
@@ -182,8 +200,8 @@ jobs:
182
200
run : |
183
201
mkdir -p ~/.ssh
184
202
touch ~/.ssh/authorized_keys
185
- cat src/kayobe-config/terraform/host-image-builder /id_rsa.pub >> ~/.ssh/authorized_keys
186
- cp src/kayobe-config/terraform/host-image-builder /id_rsa* ~/.ssh/
203
+ cat src/kayobe-config/terraform/aio /id_rsa.pub >> ~/.ssh/authorized_keys
204
+ cp src/kayobe-config/terraform/aio /id_rsa* ~/.ssh/
187
205
188
206
- name : Bootstrap the control host
189
207
run : |
@@ -501,7 +519,7 @@ jobs:
501
519
502
520
- name : Destroy
503
521
run : terraform destroy -auto-approve
504
- working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/host-image-builder
522
+ working-directory : ${{ github.workspace }}/src/kayobe-config/terraform/aio
505
523
env :
506
524
OS_CLOUD : openstack
507
525
OS_APPLICATION_CREDENTIAL_ID : ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
0 commit comments