Hi, 

I need to integrate Ansible into our automation platform. I'm planning to 
create an Flask service that uses ansible-runner to run the playbooks. I'm 
wondering how I should implement the variable set of hosts where my 
playbook need to run? At the moment I see two solutions:
* Via the inventory. I can generate a custom inventory for every run and 
configure the 'hosts' in the playbook file as 'all'. This way of working is 
okay but will cause problems when I'm using things like 'delegate_to', 
because you can't delegate to a host which is not defined in the inventory. 
(I know there are workarounds but I like to do it properly.)
* Via the hosts parameter in the playbook file. I could modify the playbook 
before every run and set a custom value for the hosts parameter. Then I can 
use the same full (static) inventory for every run. This looks like a good 
solution but I never saw anyone using this on the internet and I'm not sure 
if this is the intended way of doing it? 

I know both options could work, but I'm interested to know the proper way 
of doing it. Also if there are other ways to tackle this problem I'm 
interested to know how.

Kind Regards
Sander Descamps  


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/5ec14e92-f374-4028-b0da-47235ad83110n%40googlegroups.com.

Reply via email to