Add bug which didnt allow to change s3 bucket name

This commit is contained in:
Arsenii Petrovich 2019-02-27 15:40:23 +03:00
parent 14f7b48bda
commit bb3604b74f
2 changed files with 14 additions and 3 deletions

View File

@ -22,6 +22,17 @@
src: backend.tfvars.j2
dest: roles/main_infra/files/backend.tfvars
when: backend|bool == true
- name: Check if .terraform folder exists
stat:
path: "roles/main_infra/files/.terraform/"
register: stat_result
- name: Remove .terraform folder
file:
path: roles/main_infra/files/.terraform/
state: absent
when: stat_result.stat.exists == True
#Workaround since terraform module return unexpected error.
- name: Terraform plan construct

View File

@ -31,10 +31,10 @@
when: upload_config_to_s3|bool == True
- name: Remove insecure variables
lineinfile:
replace:
path: "{{ playbook_dir }}/group_vars/all.yml.temp"
regexp: 'aws_.*'
line: '<There was and aws-related insecure variable to keep at S3. Removed>'
replace: '<There was and aws-related insecure variable to keep at S3. Removed>'
when: upload_config_to_s3|bool == True
- name: Upload config to S3 bucket
@ -47,6 +47,6 @@
- name: Remove temp file
file:
path: "{{ playbook_dir }}/group_vars/all.yml"
path: "{{ playbook_dir }}/group_vars/all.yml.temp"
state: absent
when: upload_config_to_s3|bool == True