Open kvaps opened 6 years ago
This can be achieved with using ansible-playbook --list-hosts
feature.
This data is actually already in the database under the related inventory for the job template. (It's obviously not going to be 100% correct and up to date for an update-on-launch inventory, but it can be used for hints).
@wenottingham, My idea is save only patterns from output of this command, but not hosts, because inventory can be upgraded in any time. But when template is execute, we can find any hosts that match this patterns for provide list for choose.
I'd like to see a separate drop down for groups for the inventory (under job templates) besides the limit hostname pattern matching. My particular problem is that my current dynamic inventory takes ~60 min to run against VCenter. It generates about 40+ groups and nobody is going to remember what the correct one is and they are long names based on VCenter folder paths. If I have to have separate custom inventory scripts for each possible group, a daily refresh would not be possible. It would be easier to get a dropdown of the groups and pick one or more - but the picking needs to allow for basic pattern matching (AND, OR, NOT - something like that).
+1
+1
(+1 comments with lots of mail-gateway noise edited)
A very simple team AWS account that I have an example of has over 350 groups in it, despite having less than 200 hosts. Whatever solution is chosen here, I don't think a static dropdown scales.
A dropdown probably won't scale, but a multipage view similar to how the inventory is chosen could work especially if there is a search field for pattern matching.
Maybe the multipage group view would let you select group names one at a time and use that to populate a search string text box where you can free form whatever pattern match combinations you want. The final result is basically another limit pattern match field but just for groups. If I understand this right.
+1 Any news on this feature? I would be very cool for helpdesk user to just have to check a box to launch something on some specific hosts.
This would make things easier for my team. Remembering host names and the specific syntax is too much to ask in our environment.
+1 Any news on this feature? I would be very cool for helpdesk user to just have to check a box to launch something on some specific hosts.
You can already do that by using the AWX api - https://docs.ansible.com/ansible-tower/3.2.5/html/towerapi/launch_jobtemplate.html (limit: A string that represents a comma-separated list of hosts or groups to operate on). Prepare the most commonly used jobs beforehand and your staff can then use them - launch via scripts or a webapp.
+1 Lots of groups and its hard to keep track of them all or even memorize them.
I would like this feature implemented as described below for both groups and hosts. We are using Ansible Tower 3.7 Prompt on Launch for LIMIT in Ansible Tower job template is set. Currently you have to input values for group(s) or host(s) in LIMIT.
Launch of job template should have choice to select by group or select by host for LIMIT.
If select by group Launch of job template should show list of groups to select group(s) within inventory. The list of groups can be searched. Multipage group view in user interface if many groups.
If select by host Launch of job template should show list of host to select hosts(s) within inventory. The list of hosts can be searched. Multipage host view in user interface with many hosts.
Is there any update on this issue? Limiting playbooks is very difficult just using groups and having to write out a pattern is not really safe enough for a non-administrator. They may easily automate against the wrong host etc. I can inject variables into the hosts field in the playbook but having the ability for the user to select from a dropdown of groups would be much more useful!
definitely +1 on this.
another +1
raise hand for this. +1
+1 for case 02922298
+1
+1
+1 for that feature. currently I have to manually set host for limit. A list of selection with all host from Inventory (like already exists in Inventory selection) would be easier for single runs !
+1
+1
+1 for this as well. Can't use the API to limit hosts. Job runs on all hosts in group. What I have done is created a group for each host I add, then change the job to run on said group, then run the job, but it is a bit convoluted and....clutterey
+1
+1
+1 plssss add this feature!!!
+1
Why not allow proper host range notation?
host[10:29]
doesn't work, but a horrible regex of ~host(1[0-9]|2[0-9])
does.
+1
+1
+1
+1 Or maybe add list to Survey
+1
ISSUE TYPE
COMPONENT NAME
SUMMARY
When using "Limit" option, we need to query playbook and inventory file for provide list of hosts (or groups) selection for execution. Most actual when using "Prompt on launch" option.
ENVIRONMENT