fix(semaphore/collections): use full ansible-galaxy path from Semaphore venv
ansible-galaxy is not on the system PATH on figment — Semaphore manages its own venv under /opt/semaphore/apps/ansible/<ver>/venv/bin/. Discover the binary dynamically rather than relying on PATH.
This commit is contained in:
@@ -17,10 +17,17 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Find ansible-galaxy binary on host
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: "find /opt/semaphore/apps/ansible -name ansible-galaxy -type f | sort -V | tail -1"
|
||||||
|
register: ansible_galaxy_bin
|
||||||
|
changed_when: false
|
||||||
|
failed_when: ansible_galaxy_bin.stdout == ""
|
||||||
|
|
||||||
- name: Install Ansible collections into host collections directory
|
- name: Install Ansible collections into host collections directory
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: >
|
cmd: >
|
||||||
ansible-galaxy collection install
|
{{ ansible_galaxy_bin.stdout }} collection install
|
||||||
{{ item.name }}{% if item.version is defined %}:{{ item.version }}{% endif %}
|
{{ item.name }}{% if item.version is defined %}:{{ item.version }}{% endif %}
|
||||||
-p {{ semaphore_collections_dir }}
|
-p {{ semaphore_collections_dir }}
|
||||||
--force
|
--force
|
||||||
|
|||||||
Reference in New Issue
Block a user