Skip to content

Commit

Permalink
Fix Error reading tfstate file: 0.12 format
Browse files Browse the repository at this point in the history
Seems like we need to provide the path to the directory with the
.tfstate file. Adding ./ does this.

See adammck/terraform-inventory#121
  • Loading branch information
pli888 committed Mar 31, 2022
1 parent 509f557 commit 024854d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ops/infrastructure/inventories/terraform-inventory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# bash shell wrapper for terraform-inventory.
# How to install the https://github.com/adammck/terraform-inventory command:
# brew install terraform-inventory
terraform-inventory $@
terraform-inventory $@ ./
2 changes: 1 addition & 1 deletion ops/scripts/ansible_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cp ../../dockerhost_playbook.yml .
cp ../../bastion_playbook.yml .

# Update Gitlab gigadb_db_host variable with RDS instance address from terraform-inventory
rds_inst_addr=$(../../inventories/terraform-inventory.sh --list | jq -r '.all.vars.rds_instance_address')
rds_inst_addr=$(../../inventories/terraform-inventory.sh --list ./ | jq -r '.all.vars.rds_instance_address')
curl -s --request PUT --header "PRIVATE-TOKEN: $GITLAB_PRIVATE_TOKEN" "$PROJECT_VARIABLES_URL/gigadb_db_host?filter%5benvironment_scope%5d=$target_environment" --form "value=$rds_inst_addr"

# Update properties file with values from GitLab so Ansible can configure the services
Expand Down

0 comments on commit 024854d

Please sign in to comment.