semaphoreui / semaphore

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

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

Open mikch06 opened 1 year ago

mikch06 commented 1 year ago

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.

rwaffen commented 1 year ago

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.

mikch06 commented 1 year ago

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.

jb2barrels commented 5 months ago

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.

jimbytes commented 5 months ago
"{{ target_hosts | default('all') }}"

How can we tell more than one host ?

rwaffen commented 5 months ago

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

mikch06 commented 5 months ago

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

gudge25 commented 2 months ago

image

mikch06 commented 1 month ago

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.

fpaquet commented 3 weeks ago

Still no solution?