From d97b114d332dd3e3f18dc177fe52b25b9ef66e0c Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 24 Aug 2020 09:56:38 +1000 Subject: [PATCH] Ansible devel testing: install ansible-collections from checkout Allow speculative testing of ansible collections in the -devel test job by linking in the git checkouts from the dependent change. Depends-On: https://review.opendev.org/747596 Change-Id: I014701f41fb6870360004aa64990e16e278381ed --- .../tasks/install_ansible_collection.yaml | 7 ++++--- playbooks/roles/install-ansible/tasks/main.yaml | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/playbooks/roles/install-ansible/tasks/install_ansible_collection.yaml b/playbooks/roles/install-ansible/tasks/install_ansible_collection.yaml index b54281bc37..f7b79073e1 100644 --- a/playbooks/roles/install-ansible/tasks/install_ansible_collection.yaml +++ b/playbooks/roles/install-ansible/tasks/install_ansible_collection.yaml @@ -4,7 +4,8 @@ state: directory mode: 0755 -- name: 'Clone {{ item.namespace }}/{{ item.name }} collection' - git: - repo: '{{ item.repo }}' +- name: 'Link in {{ item.namespace }}/{{ item.name }} collection' + file: + src: '{{ ansible_user_dir}}/src/github.com/{{repo}}' dest: '/root/.ansible/collections/ansible_collections/{{ item.namespace }}/{{ item.name }}' + state: link diff --git a/playbooks/roles/install-ansible/tasks/main.yaml b/playbooks/roles/install-ansible/tasks/main.yaml index 7b5dba00fe..a99eefb8ac 100644 --- a/playbooks/roles/install-ansible/tasks/main.yaml +++ b/playbooks/roles/install-ansible/tasks/main.yaml @@ -46,18 +46,18 @@ include_tasks: install_ansible_collection.yaml when: _install_ansible_from_devel is defined loop: + - namespace: ansible + name: netcommon + repo: ansible-collections/ansible.netcommon - namespace: ansible name: posix - repo: https://github.com/ansible-collections/ansible.posix + repo: ansible-collections/ansible.posix - namespace: community name: general - repo: https://github.com/ansible-collections/community.general + repo: ansible-collections/community.general - namespace: community name: crypto - repo: https://github.com/ansible-collections/community.crypto - - namespace: ansible - name: netcommon - repo: https://github.com/ansible-collections/ansible.netcommon + repo: ansible-collections/community.crypto - name: Ensure required Ansible build packages for non-wheel architectures apt: