Add dynamic ansible inventory from terraform state
This commit is contained in:
parent
bccc07f806
commit
70578f2a13
11 changed files with 84 additions and 51 deletions
3
inventory/opentofu.yml
Normal file
3
inventory/opentofu.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
plugin: cloud.terraform.terraform_provider
|
||||
project_path: .
|
||||
binary_path: tofu
|
|
@ -1,35 +0,0 @@
|
|||
all:
|
||||
children:
|
||||
serguzim_net:
|
||||
hosts:
|
||||
node001:
|
||||
node003:
|
||||
hosts:
|
||||
local-dev:
|
||||
ansible_connection: local
|
||||
|
||||
node001:
|
||||
ansible_host: "{{ opentofu.hosts.node001.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node001.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node001.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node001.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node001.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node001.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node001.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node001.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node001.backup.gatus_token }}"
|
||||
|
||||
node003:
|
||||
ansible_host: "{{ opentofu.hosts.node003.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node003.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node003.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node003.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node003.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node003.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node003.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node003.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node003.backup.gatus_token }}"
|
Loading…
Add table
Add a link
Reference in a new issue