mirror of
https://github.com/Dannecron/netology-devops-gw-infra.git
synced 2025-12-25 23:32:35 +03:00
[stage-2] add cluster terraform-configuration
This commit is contained in:
@@ -41,19 +41,20 @@
|
||||
- "'AlreadyExists' not in bucket_create_result.stderr"
|
||||
- name: Terraform - Create variables.tf
|
||||
ansible.builtin.template:
|
||||
src: "templates/variables.tf.j2"
|
||||
dest: "terraform/variables.tf"
|
||||
src: "{{ playbook_dir }}/templates/terraform/variables.tf.j2"
|
||||
dest: "{{ playbook_dir }}/terraform/variables.tf"
|
||||
- name: Terraform - init
|
||||
ansible.builtin.command:
|
||||
chdir: ./terraform
|
||||
chdir: "{{ playbook_dir }}/terraform"
|
||||
cmd: >-
|
||||
terraform init
|
||||
-reconfigure
|
||||
-backend-config="bucket={{ terraform_yandex_bucket_name }}"
|
||||
-backend-config="access_key={{ service_account_key_id }}"
|
||||
-backend-config="secret_key={{ service_account_secret }}"
|
||||
- name: Terraform - create workspace
|
||||
ansible.builtin.command:
|
||||
chdir: ./terraform
|
||||
chdir: "{{ playbook_dir }}/terraform"
|
||||
cmd: terraform workspace new prod
|
||||
register: terraform_new_workspace_result
|
||||
failed_when:
|
||||
|
||||
Reference in New Issue
Block a user