From a487ccee7dac619b51f604b1bdb89bd31b7903df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Matteo=20=C5=A0poljarevi=C4=87?= Date: Tue, 2 Dec 2025 19:17:10 +0100 Subject: [PATCH] Testing Ansible Community Collections Installation --- installation/ansibleCollections.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 installation/ansibleCollections.yml diff --git a/installation/ansibleCollections.yml b/installation/ansibleCollections.yml new file mode 100644 index 0000000..ee69172 --- /dev/null +++ b/installation/ansibleCollections.yml @@ -0,0 +1,32 @@ +--- +- name: Install useful Ansible community collections + hosts: all + become: true + gather_facts: false + + vars: + collections_to_install: + - containers.podman + - community.general + - ansible.posix + - community.kubernetes + + tasks: + - name: Ensure ansible‑galaxy is available + ansible.builtin.command: ansible-galaxy --version + register: galaxy_version + changed_when: false + + - name: Install the required Ansible collections + ansible.builtin.command: >- + ansible-galaxy collection install {{ item }} --force + loop: "{{ collections_to_install }}" + register: install_results + failed_when: install_results.rc != 0 + + - name: Summarise installation results + ansible.builtin.debug: + msg: | + {% for result in install_results.results %} + • {{ result.item }} → {{ 'OK' if result.rc == 0 else 'FAILED' }} + {% endfor %}