semaphoreui / semaphore

Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools.
https://semaphoreui.com
MIT License
10.71k stars 1.07k forks source link

Feature: Limit as own Task-Form Field #1357

Open ansibleguy opened 1 year ago

ansibleguy commented 1 year ago

Greetings!

--limit is a very commonly used flag that deserves its own form-field as the JSON block is not so 'nice' to work with (especially on a per-task basis)

Related to:

fiftin commented 1 year ago

Hi @ansibleguy Thank you!

kyberorg commented 1 year ago

Hi @ansibleguy , thanks for raising this issue. I personally, use --limit almost every run.

ansibleguy commented 1 year ago

Possible Workaround for now: 'ansible_limit' via Survey vars

stevmills commented 1 year ago

@ansibleguy, concur strongly!

craigarms commented 1 year ago

I've noticed that the limit field has been created in the Database and API in this commit : 23c3947e183fec353a46e1f05c601bccf514eaec

So i guess Its just a matter of time before it gets introduced into the GUI

I'd like to have the ability on a template to say that limit is required or not in the same fashion as Survey Variables, this could help stop people from launching a playbook on all hosts at once,

Pushing this idea further would be to be able to put the limit in the template and at run time any limit passed would be additional.

I work with Netbox source inventories and for example would like the user that is allow to run the playbooks on only the dev env have the dev group "hardcoded" in the limit and any additional limit the user enters is for is run "confort"

PierrickBrun commented 1 year ago

I've added the field to the view in this commit: https://github.com/PierrickBrun/semaphore/commit/7a3a8c5ec5a4a3d1c22575614a7241020fa47b24

It worked without adding anything else since the field is already present in the API.

I made it to my own use so I made the field required but if you want to test it I created a release including the commit. https://github.com/PierrickBrun/semaphore/pkgs/container/semaphore

papierkorp commented 10 months ago

Is there a update on when the limit field is coming?

r3nor commented 7 months ago

I am also looking forward to this

bmcatherasoo commented 3 months ago

Can this feature be added soon, since the CLI Arguments Box doesn't exist anymore in the Version: v2.10.22-e44910d-1721658561 I can't use --limit anymore

Jibux commented 1 month ago

We are looking forward this too!

Gnyblast commented 1 month ago

@fiftin I'm interested on doing this development because it's some needed feature and I actually managed to make it but I need to know how do you manage database migrations? It's not documented and I'm not sure, do you edit the model (go struct) and run some generator to generate the sql for the migration or do you also create a versioned sql file into migrations by hand? I created it by hand and when I ran the semaphore it automatically migrated the DB, but yeah what's the way of creating the migration SQL scripts?