From d5a123c1b6d2695377ba45e346e7cf7c62b75fe4 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Sat, 1 Jul 2023 19:41:20 +0200 Subject: [PATCH] [DNM] test pulp mirror Signed-off-by: Christian Berendt --- files/ansible.cfg | 17 +++++++++++++++++ files/src/templates/requirements.yml.j2 | 18 +++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/files/ansible.cfg b/files/ansible.cfg index f42f382..d82c75e 100644 --- a/files/ansible.cfg +++ b/files/ansible.cfg @@ -16,3 +16,20 @@ gathering = smart [ssh_connection] pipelining = true + +# Use our Pulp mirror as primary source and use Ansible Galaxy as fallback. +# Mirrored content on Pulp can be viewed and extended in the following +# repository: https://github.com/osism/sbom/tree/main/mirrors/pulp +[galaxy] +server_list = mirror, galaxy + +[galaxy_server.mirror] +url = http://81.163.193.42:8080/pulp_ansible/galaxy/mirror/ + +# This account is only assigned viewer rights and we use this to provide +# access not completely public. +username = mirror +password = Ahphee6a + +[galaxy_server.galaxy] +url = https://galaxy.ansible.com/ diff --git a/files/src/templates/requirements.yml.j2 b/files/src/templates/requirements.yml.j2 index b63c52c..dd8494a 100644 --- a/files/src/templates/requirements.yml.j2 +++ b/files/src/templates/requirements.yml.j2 @@ -1,6 +1,14 @@ ---- # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN - +# +# Use our Pulp mirror as primary source and use Ansible Galaxy as +# fallback. +# +# Mirrored content on Pulp can be viewed and extended in the following +# repository: https://github.com/osism/sbom/tree/main/mirrors/pulp +# +# The used account is only assigned viewer rights and we use this to +# provide access not completely public. +--- roles: {% for name in ansible_roles.keys() %} - name: {{ name }} @@ -9,7 +17,7 @@ roles: type: git src: git+https://github.com/{{ ansible_role_names[name] }}.git {% else %} - source: https://galaxy.ansible.com + source: http://81.163.193.42:8080/pulp_ansible/galaxy/mirror/ {% endif %} {% endfor %} @@ -18,7 +26,7 @@ collections: {% if ansible_collection_names[name] %} {% if is_release == "true" and "osism" in name %} - name: {{ name }} - source: https://galaxy.ansible.com + source: http://81.163.193.42:8080/pulp_ansible/galaxy/mirror/ version: {{ ansible_collections[name] }} {% else %} - name: https://github.com/{{ ansible_collection_names[name] }}.git @@ -27,7 +35,7 @@ collections: {% endif %} {% else %} - name: {{ name }} - source: https://galaxy.ansible.com + source: http://81.163.193.42:8080/pulp_ansible/galaxy/mirror/ version: {{ ansible_collections[name] }} {% endif %} {% endfor %}