Fixing of running.
This commit is contained in:
parent
4e089a019b
commit
64b5aafcbd
@ -93,13 +93,13 @@ vm = proxmox.vm.VirtualMachine("vm",
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Getting local IP
|
|
||||||
# First item of the ipv4_addresses is of the loopback interface (so the usual 127.0.0.1). Let's get the second and grab only the text.
|
# First item of the ipv4_addresses is of the loopback interface (so the usual 127.0.0.1). Let's get the second and grab only the text.
|
||||||
lanip = vm.ipv4_addresses[1][0]
|
|
||||||
|
|
||||||
# Creating the inventory file.
|
# Creating the inventory file.
|
||||||
with open('inventory', 'w') as f:
|
with open('inventory', 'w') as f:
|
||||||
f.write(f"{vm_name} ansible_host={lanip} ansible_user={vm_username}")
|
vm.ipv4_addresses[1][0].apply(
|
||||||
|
lambda lanip: f.write(f"{vm_name} ansible_host={lanip} ansible_user={vm_username}")
|
||||||
|
)
|
||||||
|
|
||||||
# Try the deployment with ansible
|
# Try the deployment with ansible
|
||||||
|
|
||||||
@ -110,4 +110,4 @@ execute_ansible = command.local.Command("ansible",
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Outputs
|
# Outputs
|
||||||
pulumi.export("ip", lanip)
|
pulumi.export("ip", vm.ipv4_addresses[1][0])
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
collections_on_ansible_version_mismatch = False
|
collections_on_ansible_version_mismatch = ignore
|
||||||
action_warnings = False
|
action_warnings = False
|
||||||
host_key_checking = False
|
host_key_checking = False
|
||||||
inventory = inventory
|
inventory = inventory
|
||||||
|
Loading…
Reference in New Issue
Block a user