Skip to content

Commit

Permalink
terraform: don't backup tf state
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Jan 4, 2025
1 parent 3c85b88 commit 6068723
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions ansible/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,6 @@ def _execute_shell():
else:
return json.loads(out_cmd)


def _backup_tf(tfstate):
# Crates a state backup in case we lose Consul
with open(TERRAFORM_BPK, 'w') as f:
f.write(json.dumps(tfstate.state_json))

def _backup_ansible(inventory):
# Crates a state backup in Ansible inventory format
text = '# NOTE: This file is generated by terraform.py\n'
Expand Down Expand Up @@ -437,8 +431,6 @@ def _main():
inventory.add_resource(resource)

sys.stdout.write(json.dumps(inventory.to_dict(), indent=2))
# backup raw TF state
_backup_tf(tfstate)
# backup ansible inventory
_backup_ansible(inventory)
except Exception:
Expand Down

0 comments on commit 6068723

Please sign in to comment.