From c5b9472cd32a0b24de09576ed139d5e1d33793d9 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Mon, 4 Mar 2024 17:33:53 +0100 Subject: [PATCH 1/2] Add way to import EE from remote registries --- group_vars/all/ah_ee_images.yml | 2 ++ group_vars/all/ah_ee_registries.yml | 28 +++++++++++++++------------ group_vars/all/ah_ee_repositories.yml | 20 ++++++++++++++----- playbooks/hub_config.yml | 25 ++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 17 deletions(-) diff --git a/group_vars/all/ah_ee_images.yml b/group_vars/all/ah_ee_images.yml index b016ff0..9be0369 100644 --- a/group_vars/all/ah_ee_images.yml +++ b/group_vars/all/ah_ee_images.yml @@ -1,4 +1,6 @@ --- +# Documentation: +# https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_image/README.md # ah_ee_images: # - name: # state: "{{ target_state }}" diff --git a/group_vars/all/ah_ee_registries.yml b/group_vars/all/ah_ee_registries.yml index 94db28b..867ff9d 100644 --- a/group_vars/all/ah_ee_registries.yml +++ b/group_vars/all/ah_ee_registries.yml @@ -1,15 +1,19 @@ --- +# Documentations: +# - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry/README.md +# - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry_index/README.md +# - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry_sync/README.md # ah_ee_registries: -# - name: -# new_name: -# url: -# username: -# password: -# tls_validation: -# proxy_url: -# proxy_username: -# proxy_password: -# download_concurrency: -# rate_limit: -# state: "{{ target_state }}" +# - name: registry_redhat_io +# url: https://registry.redhat.io +# username: "{{ rh_username }}" +# password: "{{ rh_password }}" +# tls_validation: true +# download_concurrency: 10 +# rate_limit: 8 +# proxy_url: "" +# proxy_username: "" +# proxy_password: "" +# wait: true +# state: present ... diff --git a/group_vars/all/ah_ee_repositories.yml b/group_vars/all/ah_ee_repositories.yml index d57d7a7..faddf0d 100644 --- a/group_vars/all/ah_ee_repositories.yml +++ b/group_vars/all/ah_ee_repositories.yml @@ -1,8 +1,18 @@ --- +# Documentation: +# https://github.com/ansible/galaxy_collection/tree/devel/roles/ee_repository # ah_ee_repositories: -# - name: -# description: -# readme: -# readme_file: -# state: "{{ target_state }}" +# - name: ansible-automation-platform/ee-minimal-rhel8 +# readme: "" # mutex with readme_file +# readme_file: "" # mutex with readme +# description: >- +# ee-minimal is an automation execution environment for Red Hat Ansible +# Automation Platform. +# registry: registry_redhat_io +# upstream_name: ansible-automation-platform/ee-minimal-rhel8 +# include_tags: +# - 2.16.3-1 +# exclude_tags: +# - latest # https://access.redhat.com/solutions/6980874 +# state: present ... diff --git a/playbooks/hub_config.yml b/playbooks/hub_config.yml index 6c2de60..62405e7 100644 --- a/playbooks/hub_config.yml +++ b/playbooks/hub_config.yml @@ -29,6 +29,31 @@ ansible.builtin.include_role: name: infra.ah_configuration.publish + - name: Include ee_registry role + ansible.builtin.include_role: + name: infra.ah_configuration.ee_registry + when: ah_ee_registries | length is not match('0') + + - name: Include ee_registry_index role + ansible.builtin.include_role: + name: infra.ah_configuration.ee_registry_index + when: ah_ee_registries | length is not match('0') + + - name: Include ee_registry_sync role + ansible.builtin.include_role: + name: infra.ah_configuration.ee_registry_sync + when: ah_ee_registries | length is not match('0') + + - name: Include ee_repository role + ansible.builtin.include_role: + name: infra.ah_configuration.ee_repository + when: ah_ee_repositories | length is not match('0') + + - name: Include ee_image role + ansible.builtin.include_role: + name: infra.ah_configuration.ee_image + when: ah_ee_images | length is not match('0') + - name: Include group role ansible.builtin.include_role: name: infra.ah_configuration.group From b861cf2e7ce82263ef217e7adffc3a69e7da1924 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Wed, 13 Mar 2024 14:50:50 +0100 Subject: [PATCH 2/2] Fix undefined variables --- group_vars/all/ah_ee_images.yml | 2 +- group_vars/all/ah_ee_namespaces.yml | 2 +- group_vars/all/ah_ee_registries.yml | 2 +- group_vars/all/ah_ee_repositories.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/group_vars/all/ah_ee_images.yml b/group_vars/all/ah_ee_images.yml index 9be0369..6d43304 100644 --- a/group_vars/all/ah_ee_images.yml +++ b/group_vars/all/ah_ee_images.yml @@ -1,7 +1,7 @@ --- # Documentation: # https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_image/README.md -# ah_ee_images: +ah_ee_images: [] # - name: # state: "{{ target_state }}" # append: false diff --git a/group_vars/all/ah_ee_namespaces.yml b/group_vars/all/ah_ee_namespaces.yml index 664b043..410d3e6 100644 --- a/group_vars/all/ah_ee_namespaces.yml +++ b/group_vars/all/ah_ee_namespaces.yml @@ -1,5 +1,5 @@ --- -# ah_ee_namespaces: +ah_ee_namespaces: [] # - name: # append: # groups: diff --git a/group_vars/all/ah_ee_registries.yml b/group_vars/all/ah_ee_registries.yml index 867ff9d..7053ca2 100644 --- a/group_vars/all/ah_ee_registries.yml +++ b/group_vars/all/ah_ee_registries.yml @@ -3,7 +3,7 @@ # - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry/README.md # - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry_index/README.md # - https://github.com/ansible/galaxy_collection/blob/devel/roles/ee_registry_sync/README.md -# ah_ee_registries: +ah_ee_registries: [] # - name: registry_redhat_io # url: https://registry.redhat.io # username: "{{ rh_username }}" diff --git a/group_vars/all/ah_ee_repositories.yml b/group_vars/all/ah_ee_repositories.yml index faddf0d..be18cad 100644 --- a/group_vars/all/ah_ee_repositories.yml +++ b/group_vars/all/ah_ee_repositories.yml @@ -1,7 +1,7 @@ --- # Documentation: # https://github.com/ansible/galaxy_collection/tree/devel/roles/ee_repository -# ah_ee_repositories: +ah_ee_repositories: [] # - name: ansible-automation-platform/ee-minimal-rhel8 # readme: "" # mutex with readme_file # readme_file: "" # mutex with readme