From b6f2c5b33f5aa4cedd68ed42fdbdd153eba6fc86 Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sat, 4 Mar 2023 23:21:41 +0000 Subject: [PATCH] adding terraform to sarpdate --- sarpdate | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/sarpdate b/sarpdate index 2c68ba3..f47e656 100755 --- a/sarpdate +++ b/sarpdate @@ -1,33 +1,44 @@ #!/usr/bin/env bash echo ">> updating everything....." -echo -echo echo ">> updating local brew dependencies...." -echo brew update -echo -echo + echo ">> which leaves these outdated...." -echo brew outdated echo read -p ">> upgrade? (y/n) " updatebrew -if [ updatebrew = "y" ]; then +if [ $updatebrew == "y" ]; then echo ">> upgrading......" brew upgrade fi -echo -echo -echo ">> updating ansible environment...." -cd ~/dev/infra/ansible -poetry update +echo +echo ">> checking terraform diff...." +cd ~/dev/infra/terraform +terraform plan echo +read -p ">> apply terraform changes? (y/n) " updateterraform + +if [ $updateterraform == "y" ]; then + echo ">> applying......" + terraform apply -auto-approve +fi + +echo +read -p ">> update ansible environment? (y/n) " updateansible + +if [ $updateansible == "y" ]; then + echo ">> upgrading......" + cd ~/dev/infra/ansible + poetry update +fi + echo echo ">> running a few playbooks...." echo +cd ~/dev/infra/ansible ./update \ No newline at end of file