add: proxmox project with terraform_user.yml
This commit is contained in:
25
ansible/ansiform/roles/terraform_vm/tasks/main.yml
Normal file
25
ansible/ansiform/roles/terraform_vm/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Deploy a Terraform infrastructure
|
||||
delegate_to: localhost
|
||||
cloud.terraform.terraform:
|
||||
project_path: "{{ terraform_vm_project_path }}"
|
||||
state: "{{ terraform_vm_state }}"
|
||||
workspace: "{{ terraform_vars_vm_env | default(omit)}}"
|
||||
parallelism: 3
|
||||
complex_vars: true
|
||||
variables:
|
||||
multi_node_deployment: "{{ terraform_vars_multi_node_deployment | default(omit)}}"
|
||||
target_node: "{{ terraform_vars_target_node | default(omit)}}"
|
||||
vm_attr: "{{ terraform_vars_vm_attr | default(omit)}}"
|
||||
vm_env: "{{ terraform_vars_vm_env | default(omit)}}"
|
||||
vm_tags: "{{ terraform_vars_vm_tags | default(omit)}}"
|
||||
|
||||
- name: Update Terraform workspace path
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ terraform_ansible_inventory }}"
|
||||
regexp: '^state_file:.*tfstate$'
|
||||
line: "state_file: terraform.tfstate.d/{{ terraform_vars_vm_env }}/terraform.tfstate"
|
||||
when: terraform_vars_vm_env is defined
|
||||
|
||||
- name: Refresh inventory
|
||||
ansible.builtin.meta: refresh_inventory
|
||||
Reference in New Issue
Block a user