Hi, you can use multiple different inventory sources at the same time - so use your file + ovirt4.py
https://docs.ansible.com/ansible/2.5/user_guide/intro_dynamic_inventory.html#using-inventory-directories-and-multiple-inventory-sources Best regards Martin Sivak On Tue, May 22, 2018 at 9:50 AM, Sumit Bharadia <[email protected]> wrote: > Thanks. > > Is there a way to use an existing inventory file? > > I asked because the server where the engineVM is running is listed into my > existing a ansible inventory file on my local machine, but how do I > specify/run the subsequent tasks which I want to run on vms running on > engineVM as I don't see the /etc/hosts file updated where engineVM runs. How > would my local ansible playbook know which vms are available, etc? > > > > On Tue, 22 May 2018, 8:36 am Ondra Machacek, <[email protected]> wrote: >> >> On 05/21/2018 11:51 AM, [email protected] wrote: >> > I have a self-hosted-engine (4.2) running on a centos 7.4 server. >> > >> > I have downloaded ovirt ansible roles from ansible-galaxy and can run >> > them from the server where the engineVM is running and able to deploy new >> > vms, clusters, dc, etc. >> > >> > I have seen the use of ovirt4.py file to target and group hosts which >> > you can target for specific plays. However, the box where >> > self-hosted-engine >> > is running is a physical server but I am looking to run ansible from my >> > local machine instead to manage vms running on engineVM. Is there a way to >> > achieve this? >> >> Sure you can use your own computer to manage the VMs. >> >> In your playbook you just need to specify group/host where the tasks of >> the playbook should run. >> >> So if using the ovirt4.py script as your inventory file, you need to >> just specify specific group where you want to run the tasks in your >> playbook like this: >> >> - hosts: tag_httpd >> tasks: >> ... >> >> If you want to Create/Delete VMs using ovirt_* modules, you can do it >> from your computer as well, but you need to install Python SDK version >> 4. You can download it from pip using following command: pip install >> ovirt-engine-sdk-python. >> >> > >> > Thank you in advance. >> > >> > _______________________________________________ >> > Users mailing list -- [email protected] >> > To unsubscribe send an email to [email protected] >> > > > > _______________________________________________ > Users mailing list -- [email protected] > To unsubscribe send an email to [email protected] > _______________________________________________ Users mailing list -- [email protected] To unsubscribe send an email to [email protected]

