Commit 15a783aa authored by AdamSimpson's avatar AdamSimpson
Browse files

fix builder OpenStack credential propagation

parent 557cf061
Pipeline #11550 failed with stages
in 68 minutes and 37 seconds
......@@ -48,12 +48,11 @@ ssh -o StrictHostKeyChecking=no -i ${KEY_FILE} cades@${VM_IP} 'sudo bash -s' < $
# Copy OpenStack credentials to VM and then move to correct directory
# These credentials are available as environment variables to the runners
printenv | grep ^OS_ > ./queue_profile # "Reconstruct" openrc.sh
awk '{print "export "$0}' ./queue_profile > tmp_awk && mv tmp_awk ./queue_profile
scp -o StrictHostKeyChecking=no -i ${KEY_FILE} ./queue_profile cades@${VM_IP}:/home/cades/queue_profile
ssh -o StrictHostKeyChecking=no -i ${KEY_FILE} cades@${VM_IP} 'sudo mv /home/cades/queue_profile /home/queue/.profile'
printenv | grep ^OS_ > ./openrc.sh # "Reconstruct" openrc.sh
scp -o StrictHostKeyChecking=no -i ${KEY_FILE} ./openrc.sh cades@${VM_IP}:/home/cades/openrc.sh
ssh -o StrictHostKeyChecking=no -i ${KEY_FILE} cades@${VM_IP} 'sudo mv /home/cades/openrc.sh /home/queue/openrc.sh'
# Reboot to ensure Queue service, added in provisioning, is started
# Reboot to start queue service added in provisioning
openstack server reboot --wait ${VM_UUID}
echo "Started ${VM_UUID} with external IP ${VM_IP} using ${KEY_FILE}"
......
......@@ -47,6 +47,7 @@ After=network.target
[Service]
Type=simple
User=queue
EnvironmentFile="/home/queue/openrc.sh"
Environment="LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib"
WorkingDirectory=/home/queue
ExecStart=/usr/local/bin/builder-queue
......@@ -56,6 +57,4 @@ Restart=no
WantedBy=multi-user.target
EOF
# There appears to be some weird issues with starting systemd services inside of a cloud-init script
# The easiest thing to do is just reboot after enabling the service
systemctl enable builder-queue
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment