ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.08k stars 3.43k forks source link

Feature: Provide list of hosts for limit option #1179

Open kvaps opened 6 years ago

kvaps commented 6 years ago
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
kvaps commented 6 years ago

This can be achieved with using ansible-playbook --list-hosts feature.

wenottingham commented 6 years ago

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).

kvaps commented 6 years ago

@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.

dc-jbd commented 6 years ago

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).

grahamneville commented 6 years ago

+1

mneumarkidg commented 6 years ago

+1

wenottingham commented 6 years ago

(+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.

grahamneville commented 6 years ago

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.

dc-jbd commented 6 years ago

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.

Junn-Sorran commented 4 years ago

+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.

RogueRaider commented 4 years ago

This would make things easier for my team. Remembering host names and the specific syntax is too much to ask in our environment.

impca commented 4 years ago

+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.

Beeez commented 4 years ago

+1 Lots of groups and its hard to keep track of them all or even memorize them.

mikemci commented 4 years ago

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.

Figrol commented 3 years ago

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!

arizon-dread commented 3 years ago

definitely +1 on this.

mboehm21 commented 3 years ago

another +1

jnemeiksis commented 3 years ago

raise hand for this. +1

lucab85 commented 3 years ago

+1 for case 02922298

ghost commented 3 years ago

+1

kadaj666 commented 2 years ago

+1

LeDOC666 commented 2 years ago

+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 !

dirkallaert commented 2 years ago

+1

feldsam commented 2 years ago

+1

aimcod commented 2 years ago

+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

gitwrckd commented 2 years ago

+1

cjreyn commented 2 years ago

+1

cristorrian commented 1 year ago

+1 plssss add this feature!!!

MarcusCaepio commented 1 year ago

+1

CJCShadowsan commented 1 year ago

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.

stefankaufmann commented 1 year ago

+1

g1lby commented 1 year ago

+1

FlorianGubler commented 10 months ago

+1

vitaliidom commented 8 months ago

+1 Or maybe add list to Survey

MikelH911 commented 2 months ago

+1