1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-20 10:48:59 +00:00

[PR #11646/8d403dde backport][stable-12] ansible_galaxy_install: new param executable (#11651)

ansible_galaxy_install: new param executable (#11646)

* ansible_galaxy_install: new param executable

* add changelog frag

(cherry picked from commit 8d403dde5b)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2026-03-22 20:33:41 +01:00 committed by GitHub
parent 12808f67d5
commit a425d16e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 3 deletions

View file

@ -141,3 +141,43 @@
that:
- upgrade_c1 is changed
- upgrade_c2 is not changed
###################################################
- name: Find ansible-galaxy executable path
ansible.builtin.command: which ansible-galaxy
register: galaxy_which
changed_when: false
- name: Make directory exec_c
ansible.builtin.file:
path: "{{ remote_tmp_dir }}/exec_c"
state: directory
- name: Install collection using explicit executable path
community.general.ansible_galaxy_install:
type: collection
name: netbox.netbox
dest: "{{ remote_tmp_dir }}/exec_c"
executable: "{{ galaxy_which.stdout }}"
register: exec_c0
- name: Assert collection was installed using explicit executable
assert:
that:
- exec_c0 is changed
- '"netbox.netbox" in exec_c0.new_collections'
- exec_c0.executable == galaxy_which.stdout
- name: Fail to install collection using bad executable path
community.general.ansible_galaxy_install:
type: collection
name: netbox.netbox
dest: "{{ remote_tmp_dir }}/exec_c"
executable: /nonexistent/ansible-galaxy
register: exec_c_fail
ignore_errors: true
- name: Assert bad executable caused failure
assert:
that:
- exec_c_fail is failed