Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to OpenTofu #349

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ ansible/files/csi-secret-cinderplugin.yaml.eqiad1.crypt filter=git-crypt diff=gi
ansible/files/csi-secret-cinderplugin.yaml.codfw1dev.crypt filter=git-crypt diff=git-crypt
paws/codfw-secrets.yaml filter=git-crypt diff=git-crypt
paws/files/minesweeper/secrets/** filter=git-crypt diff=git-crypt
terraform/secrets.tf filter=git-crypt diff=git-crypt
tofu/secrets.tf filter=git-crypt diff=git-crypt
25 changes: 10 additions & 15 deletions .github/workflows/terraform-fmt.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: "terraform fmt"
name: "tofu fmt"

'on':
pull_request:
Expand All @@ -11,23 +11,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: install terraform
- name: install tofu
run: |
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt-get install -y terraform
- name: terraform fmt
curl -s https://packagecloud.io/install/repositories/opentofu/tofu/script.deb.sh?any=true -o /tmp/tofu-repository-setup.sh
sudo bash /tmp/tofu-repository-setup.sh
sudo apt install tofu
- name: tofu fmt
run: |
shopt -s extglob
cd terraform
if ! terraform fmt -check -diff !(secrets).tf ; then
echo "please update your terraform code to match the above.";
echo 'or run `terraform fmt` to have terraform reformat it.';
cd tofu
if ! tofu fmt -check -diff !(secrets).tf ; then
echo "please update your tofu code to match the above.";
echo 'or run `tofu fmt` to have tofu reformat it.';
exit 1;
fi
10 changes: 5 additions & 5 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if ! command -v helm ; then
exit 1
fi

if ! command -v terraform ; then
echo "please install terraform"
if ! command -v tofu ; then
echo "please install tofu"
exit 1
fi

Expand All @@ -36,9 +36,9 @@ source .venv/deploy/bin/activate
pip install ansible==8.1.0 kubernetes==26.1.0


cd terraform
terraform init
terraform apply -var datacenter=${datacenter} # -auto-approve
cd tofu
tofu init
tofu apply -var datacenter=${datacenter} # -auto-approve
export KUBECONFIG=$(pwd)/kube.config

cd ../ansible
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading