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

Not possible to set working directory for a template task #1984

Open mikaelparkefelt opened 6 months ago

mikaelparkefelt commented 6 months ago

I have a repository with different folders for different Ansible playbooks:

folder 1:
  ansible.cfg
  collections/requirements.cfg
  roles/requirements.cfg
folder 2:
  ansible.cfg
  collections/requirements.cfg
  roles/requirements.cfg

Every folder has different files as described as above.

When I run a tasks I get the following output:

No collections/requirements.yml file found. Skip galaxy install process.
No roles/requirements.yml file found. Skip galaxy install process.

What I need is a way to specify the working directory for a templates to set the root folder for Ansible and all its configurations files.

E.g. for folder 1 I need to set working directory to the folder 1 so ansible can find the ansible cfg file.

How can I do this? Is it possible as of now and how should i do it?

mikaelparkefelt commented 6 months ago

Today I need to prefix all path to playbook with folder 1, folder 2 etc.

It would be nice to set working directory and the use relative paths from there.