add: proxmox project with terraform_user.yml
This commit is contained in:
31
ansible/ansiform/playbooks/deploy_tf.yml
Normal file
31
ansible/ansiform/playbooks/deploy_tf.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Deploy a Terraform infrastructure
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- ansible.builtin.import_role:
|
||||
name: terraform_vm
|
||||
vars:
|
||||
terraform_vm_state: "{{ state | default(omit) }}"
|
||||
terraform_vm_project_path: /home/vez/homelab/terraform/projects/terransible
|
||||
terraform_vars_vm_env: "{{ env | default('lab')}}"
|
||||
terraform_vars_vm_tags:
|
||||
- "{{ env | default('lab')}}"
|
||||
terraform_vars_multi_node_deployment: "{{ multi_node_deployment | default(true) }}"
|
||||
terraform_vars_target_node: "{{ target_node | default(omit) }}"
|
||||
terraform_vars_vm_attr: {"master": { "ram": 2048, "cpu": 2, "vlan": 66 }, "worker": { "ram": 1024, "cpu": 1, "vlan": 66 }}
|
||||
|
||||
- name: Ping
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Ping all the hosts
|
||||
ansible.builtin.ping:
|
||||
|
||||
delegate_to:
|
||||
- name: Ping the master
|
||||
ansible.builtin.ping:
|
||||
when: inventory_hostname in groups['master']
|
||||
|
||||
- name: Ping the worker
|
||||
ansible.builtin.ping:
|
||||
when: inventory_hostname in groups['worker']
|
||||
Reference in New Issue
Block a user