-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to set or override the inventory selection using Survey variables? #1354
Comments
Yes - you can supply the limit inside the task or task-template JSON field: ["--limit", "host1,host2"] Also: I opened a specific feature-request for adding a Regarding multiple inventories - you could try to also supply them using the 'JSON' field as those variables seem to be directly passed to Ansible. |
Yes, you can do with survery variable. And update the host variable in your playbook like the following: |
@Ye-Min-Tun The question was more about if we can select a different inventory file using a survey variable. |
I second this. I am in a situation where it would be very helpful to have a selectable inventory at runtime. |
That way one should be able to 'override' the inventory-file configured in the 'task-template' when running a 'task' - that's the idea? Or did I get it wrong? ["--inventory", "inv2", "--inventory", "inv3"] They should be passed 1-to-1 to the ansible-playbook execution |
Not sure about selecting the inventory file . |
Is it possible that variables can only by have underscores and no dashes? Because this just works when the variable has no dash in it. |
@josefglatz See Ansible Documentation for variables
|
We have a number of inventory lists, each with several servers, a very common configuration I am sure. But there are times we want to run a task against a single node, maybe a reboot etc.
Whilst I can easily override the host / group name using a survey variable, I still end up with needing to create a reboot task template for each inventory list. Is it possible to override the inventory selection using a survey variable or some other way at runtime?
The text was updated successfully, but these errors were encountered: