Skip to content

Commit 100d0af

Browse files
authored
Merge pull request #378 from NHSDigital/apm-2545-timeout-terraform-locks-on-ecs-deploys
APM-2545 Add expiry time to terraform lock on ECS container deploys
2 parents 611b2ec + c621ff5 commit 100d0af

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

  • ansible/roles

ansible/roles/create-api-deployment-pre-reqs/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
when: item.state == 'file'
3737

3838
- name: terraform plan
39-
shell: "make -C {{ out_dir }}/terraform clean plan args='-no-color -out tfplan.out'" # noqa 305
39+
shell: "make -C {{ out_dir }}/terraform clean plan args='-no-color -lock-timeout=30m -out tfplan.out'" # noqa 305
4040
register: tfplan
4141
failed_when: tfplan.rc not in (0, 2)
4242
when: not do_not_terraform
4343

4444
- name: terraform apply
45-
shell: "make -C {{ out_dir }}/terraform apply-plan args='-no-color --auto-approve tfplan.out'" # noqa 305
45+
shell: "make -C {{ out_dir }}/terraform apply-plan args='-no-color -lock-timeout=30m --auto-approve tfplan.out'" # noqa 305
4646
register: tfapply
4747
when: not do_not_terraform
4848

ansible/roles/deploy-ecs-proxies/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@
7272
when: item.state == 'file'
7373

7474
- name: terraform plan
75-
shell: "make -C {{ out_dir }}/terraform clean plan args='-no-color -out tfplan.out'" # noqa 305
75+
shell: "make -C {{ out_dir }}/terraform clean plan args='-no-color -lock-timeout=30m -out tfplan.out'" # noqa 305
7676
register: tfplan
7777
failed_when: tfplan.rc not in (0, 2)
7878
when: not do_not_terraform
7979

8080
- name: terraform apply
81-
shell: "make -C {{ out_dir }}/terraform apply-plan args='-no-color --auto-approve tfplan.out'" # noqa 305
81+
shell: "make -C {{ out_dir }}/terraform apply-plan args='-no-color -lock-timeout=30m --auto-approve tfplan.out'" # noqa 305
8282
register: tfapply
8383
when: not do_not_terraform
8484

ansible/roles/destroy-api-deployment-pre-reqs/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
when: not do_not_terraform
4343

4444
- name: terraform destroy
45-
shell: "make -C {{ out_dir }}/terraform apply args='-no-color --auto-approve' tf-command=destroy" # noqa 305
45+
shell: "make -C {{ out_dir }}/terraform apply args='-no-color -lock-timeout=30m --auto-approve' tf-command=destroy" # noqa 305
4646
register: tfapply
4747
when: not do_not_terraform
4848

ansible/roles/destroy-ecs-proxies/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
when: not do_not_terraform
7676

7777
- name: terraform destroy
78-
shell: "make -C {{ out_dir }}/terraform apply args='-no-color --auto-approve' tf-command=destroy" # noqa 305
78+
shell: "make -C {{ out_dir }}/terraform apply args='-no-color -lock-timeout=30m --auto-approve' tf-command=destroy" # noqa 305
7979
register: tfapply
8080
when: not do_not_terraform
8181

0 commit comments

Comments
 (0)