Update Packet server from 16.04 -> 18.04
This commit is contained in:
@@ -37,7 +37,7 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
## Provision a Type1 baremetal Packet.net server
|
## Provision a Type1 baremetal Packet.net server
|
||||||
echo "[$(date +%H:%M:%S)]: Provisioning a server on Packet.net"
|
echo "[$(date +%H:%M:%S)]: Provisioning a server on Packet.net"
|
||||||
DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" -d '{ "facility": "sjc1", "plan": "baremetal_1", "hostname": "detectionlab", "description": "testing", "billing_cycle": "hourly", "operating_system": "ubuntu_16_04", "userdata": "", "locked": "false", "project_ssh_keys": ["315a9565-d5b1-41b6-913d-fcf022bb89a6", "755b134a-f63c-4fc5-9103-c1b63e65fdfc"] }' 'https://api.packet.net/projects/0b3f4f2e-ff05-41a8-899d-7923f620ca85/devices' | jq ."id" | tr -d '"')
|
DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" -d '{ "facility": "sjc1", "plan": "baremetal_1", "hostname": "detectionlab", "description": "testing", "billing_cycle": "hourly", "operating_system": "ubuntu_18_04", "userdata": "", "locked": "false", "project_ssh_keys": ["315a9565-d5b1-41b6-913d-fcf022bb89a6", "755b134a-f63c-4fc5-9103-c1b63e65fdfc"] }' 'https://api.packet.net/projects/0b3f4f2e-ff05-41a8-899d-7923f620ca85/devices' | jq ."id" | tr -d '"')
|
||||||
echo $DEVICE_ID > /tmp/device_id
|
echo $DEVICE_ID > /tmp/device_id
|
||||||
# Make sure the device ID is sane.
|
# Make sure the device ID is sane.
|
||||||
# TODO: maybe make this a regex
|
# TODO: maybe make this a regex
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
echo "[$(date +%H:%M:%S)]: Server may have failed provisionining. Device ID is set to: $DEVICE_ID"
|
echo "[$(date +%H:%M:%S)]: Server may have failed provisionining. Device ID is set to: $DEVICE_ID"
|
||||||
echo "[$(date +%H:%M:%S)]: This usually happens if there are no servers available in the selected datacenter."
|
echo "[$(date +%H:%M:%S)]: This usually happens if there are no servers available in the selected datacenter."
|
||||||
echo "[$(date +%H:%M:%S)]: Attempting to retry in another datacenter..."
|
echo "[$(date +%H:%M:%S)]: Attempting to retry in another datacenter..."
|
||||||
export DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" -d '{ "facility": "ewr1", "plan": "baremetal_1", "hostname": "detectionlab", "description": "testing", "billing_cycle": "hourly", "operating_system": "ubuntu_16_04", "userdata": "", "locked": "false", "project_ssh_keys": ["315a9565-d5b1-41b6-913d-fcf022bb89a6", "755b134a-f63c-4fc5-9103-c1b63e65fdfc"] }' 'https://api.packet.net/projects/0b3f4f2e-ff05-41a8-899d-7923f620ca85/devices' | jq ."id" | tr -d '"')
|
export DEVICE_ID=$(curl -s -X POST --header 'Accept: application/json' --header 'Content-Type: application/json' --header 'X-Auth-Token: '"$PACKET_API_TOKEN" -d '{ "facility": "ewr1", "plan": "baremetal_1", "hostname": "detectionlab", "description": "testing", "billing_cycle": "hourly", "operating_system": "ubuntu_18_04", "userdata": "", "locked": "false", "project_ssh_keys": ["315a9565-d5b1-41b6-913d-fcf022bb89a6", "755b134a-f63c-4fc5-9103-c1b63e65fdfc"] }' 'https://api.packet.net/projects/0b3f4f2e-ff05-41a8-899d-7923f620ca85/devices' | jq ."id" | tr -d '"')
|
||||||
if [ "$(echo -n $DEVICE_ID | wc -c)" -ne 36 ]; then
|
if [ "$(echo -n $DEVICE_ID | wc -c)" -ne 36 ]; then
|
||||||
echo "[$(date +%H:%M:%S)]: This script was still unable to successfully provision a server. Exiting."
|
echo "[$(date +%H:%M:%S)]: This script was still unable to successfully provision a server. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user