According to your need, what i understand. It may be work for you.



*- name: Refresh Inventory File meta: refresh_inventory- pause: minutes: 1*

Add these line in last of CreateAzurevm playbook.

On Saturday, 5 June 2021 at 09:25:42 UTC+5:30 raja...@gmail.com wrote:

> I have developed the playbook which created a vm in azure(playbook name is 
> CreateAzureVM.yml) and I have another playbooks which Installs softwares on 
> the VM(install_software.yml).
>
> I have imported install_software.yml in the CreateAzureVM.yml playbook. 
> install_software.yml takes the host info from inventory file which contains 
> ansible_connection=ssh ansible_ssh_pass=XYZ ansible_host=IPaddressOfTheHost
>
> Now my requirement is that I want to pass the IP address of the newly 
> created machine to the Imported playbook so instead of taking the static IP 
> provided in the inventory it can take it dynamically from the 
> CreateAzureVM.yml.
>
> I already tried to update the inventory file but looks like updating the 
> inventory file in the middle of CreateAzureVM playbook does not help 
> because inventory file is already loaded and updating it afterward does not 
> help.
>
> Any quick help would be greatly appreciated.
>
> Regards 
>
> Rajaniesh
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/17db06b0-ae5a-4d0c-aa16-3df2700b8460n%40googlegroups.com.

Reply via email to