0

I have one question, I will try to describe to you my problem, please check and tell me is that possible to do.

I'm using molecule and DroneCI for automatic testing my playbooks. Because molecule doesn't have support for Proxmox natively, but Ansible has Proxmox module, I wrote prepare playbook which creates LXC container on Proxmox server. That works well, but problem is that because my LXC container get IP from DHCP server and I don't have a solution to run my playbook on that newly created LXC because I don't have that IP in my inventory.

Does exists some solution for this problem or does anyone have some idea how can I do this?

Thank you.

Petar
  • 37
  • 9

1 Answers1

1

Both prepare.yml and playbook.yaml are ansible playbooks, so it is fully up to you what you use on hosts: .... Feel free to use whatever host or group you want instead of all.

sorin
  • 161,544
  • 178
  • 535
  • 806
  • Yes, I know that, but my prepare playbook create container on Proxmox where new container get IP from DHCP and I don't know which is IP before to enter in hosts file. – Petar Oct 01 '19 at 07:44
  • 4
    In this case your question has nothing to do with molecule, you probably want to look at ansible dynamic inventory, maybe add_host module. – sorin Oct 01 '19 at 15:39
  • That's it @sorin. Thank you very much. – Petar Oct 02 '19 at 07:29