Skip to content

Commit 594786e

Browse files
committed
Add optional variable for sec groups
1 parent 300a504 commit 594786e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/deploy-aufn.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ jobs:
112112
if [ "${{ inputs.deployment_type }}" = "Deployment" ]; then
113113
echo 'bastion_floating_ip = "185.45.78.149"' >> terraform.tfvars
114114
fi
115+
116+
if [ "${{ inputs.deployment_type }}" = "Test" ]; then
117+
echo 'reg_sec_grp = ["default","aufn-lab-rules"]' >> terraform.tfvars
118+
fi
115119
env:
116120
LAB_IMAGE_ID: ${{ inputs.os_image == 'Rocky9' && vars.LAB_OS_IMAGE_ROCKY || inputs.os_image == 'Ubuntu' && vars.LAB_OS_IMAGE_UBUNTU }}
117121
LAB_IMAGE_NAME: ${{ inputs.os_image == 'Ubuntu' && 'Ubuntu-22.04' || inputs.os_image }}
@@ -137,8 +141,6 @@ jobs:
137141
138142
# Need to add a check to see which part failed and then
139143
# taint and retry once more before declating failure
140-
141-
terraform destroy -auto-approve
142144
sleep 60
143145
done
144146
echo "Failed to create infrastructure after $attempt attempts"

openstack-device.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource "openstack_compute_instance_v2" "registry" {
5656
name = "${var.lab_prefix}-registry"
5757
flavor_name = var.registry_flavor
5858
key_pair = openstack_compute_keypair_v2.ufn_lab_key.name
59-
security_groups = ["default"]
59+
security_groups = var.reg_sec_grp
6060

6161
block_device {
6262
uuid = var.image_id

vars.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ variable "dns_zone_name" {
8686
nullable = true
8787
default = null
8888
}
89+
90+
variable "reg_sec_grp" {
91+
description = "Security group for the registry instance"
92+
default = ["default"]
93+
}

0 commit comments

Comments
 (0)