semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Run a task against one server out of inventory -> like limit

Open mikch06 opened this issue 2 years ago • 8 comments

It should be possible to create a tasks and limit it against a single host out of inventory. If possible by Dropdown or just with the written hostname.

  • Now you have to run a playbook against the whole inventory.
  • This is a feauture request more from system engineering side where we run a few small jobs against single hosts.

mikch06 avatar Nov 06 '23 14:11 mikch06

I have a workaround for this:

add the hosts line to your playbooks:

---
- name: Add logrotate configuration for docker logs
  hosts: "{{ target_hosts | default('all') }}"
  tasks:

and then add a survey variable in semaphore to your template.

rwaffen avatar Nov 07 '23 09:11 rwaffen

I have a workaround for this:

add the hosts line to your playbooks:

---
- name: Add logrotate configuration for docker logs
  hosts: "{{ target_hosts | default('all') }}"
  tasks:

and then add a survey variable in semaphore to your template.

Thx a lot! I know some workarounds but think it's too complicated for easy use and a genral inventory. But i'll give a try.

mikch06 avatar Nov 07 '23 11:11 mikch06

Came across this post. Was hoping to see if Semaphore finally added the Limit prompt similar to what AWX has.

Would love to see this feature in the future added to Semaphore, so playbooks don't have to be modified to add a simple prompt for the end user to run a task against a single machine.

jb2barrels avatar Jun 11 '24 17:06 jb2barrels

"{{ target_hosts | default('all') }}"

How can we tell more than one host ?

jimbytes avatar Jun 12 '24 02:06 jimbytes

it is possible to use a group or a host. but no list, thats true. if you refer to something like that

rwaffen avatar Jun 12 '24 11:06 rwaffen

My goal is still to have a dropdown or similar way to choose a single host out of a inventory. Just to run a single task (from template) against a single host. Typical to run a recap job. -> e.g. like --limit in ansible

mikch06 avatar Jun 12 '24 11:06 mikch06

image

gudge25 avatar Sep 13 '24 21:09 gudge25

Thx @gudge25, sorry just saw it now. I now how to handle it. But we like to handle a bunch of tasks to single or multiple hosts - spontaneously and also from not technical people. Thats why it's not too easy and we stay with other tools.

mikch06 avatar Oct 01 '24 14:10 mikch06

Still no solution?

fpaquet avatar Oct 26 '24 16:10 fpaquet

Any update on this? It's a bit annoying having to adjust all playbooks to be able to use basic Ansible funcionality in Semaphore. I don't need a dropdown, a simple text box with a wrapper for --limit would do just fine. 🙂

wntrstn avatar Nov 25 '24 15:11 wntrstn

Any update on this? It's a bit annoying having to adjust all playbooks to be able to use basic Ansible funcionality in Semaphore. I don't need a dropdown, a simple text box with a wrapper for --limit would do just fine. 🙂

Stronlgy vote for this 💯

mikch06 avatar Nov 26 '24 07:11 mikch06

Any update on this? It's a bit annoying having to adjust all playbooks to be able to use basic Ansible funcionality in Semaphore. I don't need a dropdown, a simple text box with a wrapper for --limit would do just fine. 🙂

Stronlgy vote for this 💯

Voting for this feature as well

jb2barrels avatar Nov 26 '24 16:11 jb2barrels

Seems to be a feature for the next release #2647

mikch06 avatar Jan 04 '25 10:01 mikch06

That would be a really useful function!

Skyfay avatar Feb 21 '25 13:02 Skyfay