Skip to content

Commit 0a36aa0

Browse files
committed
wip: Add steps for creating and associating a floating IP to the instane
1 parent 2d1e9e5 commit 0a36aa0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/create-instance.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ jobs:
3333
env:
3434
NUMBER: ${{ github.event.issue.number }}
3535

36+
- name: Create floating IP
37+
id: ip_create
38+
run: |
39+
source ~/app-cred-morpho-cloud-portal_github-runner-openrc.sh > /dev/null 2>&1
40+
source ~/venv/bin/activate
41+
42+
json_output=$(openstack floating ip create public -f json)
43+
echo $json_output
44+
45+
floating_ip_address=$(
46+
echo $json_output |
47+
jq -r ".floating_ip_address"
48+
)
49+
echo "floating_ip_address [$floating_ip_address]"
50+
echo "floating_ip_address=$floating_ip_address" >> $GITHUB_OUTPUT
51+
52+
- name: Associate floating IP with created instance
53+
run: |
54+
source ~/app-cred-morpho-cloud-portal_github-runner-openrc.sh > /dev/null 2>&1
55+
source ~/venv/bin/activate
56+
57+
openstack server add floating ip "$INSTANCE_NAME" $IP_ADDRESS
58+
env:
59+
IP_ADDRESS: ${{ steps.ip_create.outputs.floating_ip_address }}
60+
INSTANCE_NAME: ${{ steps.instance_create.outputs.instance_name }}
61+
3662
- name: Issue Forms Body Parser
3763
id: parse
3864
uses: zentered/[email protected]

0 commit comments

Comments
 (0)