aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-10 09:03:58 -0300
committerEuAndreh <eu@euandre.org>2019-06-10 09:11:27 -0300
commit95fb2c190a2143ab84be1b18fdd2ec587e54d05e (patch)
tree52737ee757a87edc88227c3da8c378e134183689 /scripts
parentChange $TLD (diff)
downloadserver-95fb2c190a2143ab84be1b18fdd2ec587e54d05e.tar.gz
server-95fb2c190a2143ab84be1b18fdd2ec587e54d05e.tar.xz
Provision DNS entries using DigitalOcean instead of DNS registrar
This way we can implement dynamic (provision-time) Floating IP, instead of a hardcoded pre-created Floating IP address. Related changes: - remove =terraform-godaddy= provider, use =digitalocean_record= instead; - create =generated-known-hosts= after provisioning instead of during =setup.sh=: use the =$(terraform output public_floating_ip)= value to make this file dynamic; - remote the =$PINNED_IP= and =$TF_VAR_floating_ip= variables; - add type and descriptions to variable declarations in Terraform recipe.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/provision.sh3
-rwxr-xr-xscripts/ci/setup.sh1
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/ci/provision.sh b/scripts/ci/provision.sh
index 3b2d912..b1d23e5 100755
--- a/scripts/ci/provision.sh
+++ b/scripts/ci/provision.sh
@@ -28,7 +28,6 @@ ssh "$TLD" /home/vps/create-backup.sh || echo "FAILED TO CREATE BACKUP."
echo "Done."
echo "Initializing Terraform..."
-ln -s "$(command -v terraform-godaddy)" terraform-provider-godaddy
terraform --version
terraform init
echo "Done."
@@ -66,6 +65,8 @@ popd
echo "Done."
echo "Running the Ansible playbook..."
+
+echo "${TLD},$(terraform output public_floating_ip) ssh-rsa $(awk '{print $2}' < ./secrets/ssh/vps-box-server.pub)" > ./generated-known-hosts.txt
ansible-playbook provision.yaml
echo "Done."
diff --git a/scripts/ci/setup.sh b/scripts/ci/setup.sh
index f134c6a..d9ac70c 100755
--- a/scripts/ci/setup.sh
+++ b/scripts/ci/setup.sh
@@ -33,7 +33,6 @@ export SSH_SERVER_PUBLIC_KEY
# https://stackoverflow.com/questions/24963705/is-there-an-escape-character-for-envsubst
export DOLLAR='$'
-echo "${TLD},${PINNED_IP} ssh-rsa $(echo "${SSH_SERVER_PUBLIC_KEY}" | awk '{print $2}')" > ./generated-known-hosts.txt
envsubst < ./ssh.env.conf >> ~/.ssh/config
envsubst < ./hosts.env > ./hosts
envsubst < ./docker-compose.env.yaml > ./docker-compose.yaml