From 7ede2ce4fe747e8c28afdebf5da61b136b7b972e Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Mon, 28 Aug 2023 11:40:43 -0400 Subject: [PATCH] Add staging repositories from stagingyum.theforeman.org that come from Copr --- pipelines/pulpcore/02-install.yml | 7 ++++ pipelines/vars/forklift_pulpcore.yml | 4 +-- .../defaults/main.yml | 1 + .../tasks/_koji_staging_repo.yml | 10 ++++++ .../tasks/_stagingyum_staging_repo.yml | 10 ++++++ .../tasks/staging_repo.yml | 9 ++--- roles/foreman_repositories/defaults/main.yml | 1 + .../tasks/_koji_staging_repos.yml | 33 +++++++++++++++++ .../tasks/_stagingyum_staging_repos.yml | 20 +++++++++++ .../tasks/redhat_staging_repos.yml | 35 ++----------------- roles/katello_repositories/defaults/main.yml | 1 + .../tasks/_koji_staging_repos.yml | 26 ++++++++++++++ .../tasks/_stagingyum_staging_repos.yml | 20 +++++++++++ .../tasks/staging_repos.yml | 28 ++------------- 14 files changed, 137 insertions(+), 68 deletions(-) create mode 100644 roles/foreman_client_repositories/tasks/_koji_staging_repo.yml create mode 100644 roles/foreman_client_repositories/tasks/_stagingyum_staging_repo.yml create mode 100644 roles/foreman_repositories/tasks/_koji_staging_repos.yml create mode 100644 roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml create mode 100644 roles/katello_repositories/tasks/_koji_staging_repos.yml create mode 100644 roles/katello_repositories/tasks/_stagingyum_staging_repos.yml diff --git a/pipelines/pulpcore/02-install.yml b/pipelines/pulpcore/02-install.yml index 5b527a8dd..f053096bf 100644 --- a/pipelines/pulpcore/02-install.yml +++ b/pipelines/pulpcore/02-install.yml @@ -27,6 +27,13 @@ - ../vars/forklift_{{ pipeline_type }}.yml environment: DJANGO_SETTINGS_MODULE: pulpcore.app.settings + pre_tasks: + - when: pulpcore_staging_source != 'stagingyum' + set_fact: + pulp_pkg_repo: "http://koji.katello.org/releases/yum/pulpcore-{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/$basearch/" + - when: pulpcore_staging_source == 'stagingyum' + set_fact: + pulp_pkg_repo: "https://stagingyum.theforeman.org/pulpcore/{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/$basearch/" roles: - epel_repositories - pulp.pulp_installer.pulp_all_services diff --git a/pipelines/vars/forklift_pulpcore.yml b/pipelines/vars/forklift_pulpcore.yml index e5540fdb4..2466f3e99 100644 --- a/pipelines/vars/forklift_pulpcore.yml +++ b/pipelines/vars/forklift_pulpcore.yml @@ -6,7 +6,6 @@ forklift_boxes: "{{ {forklift_server_name: server_box} }}" pulp_install_source: packages -pulp_pkg_repo: "http://koji.katello.org/releases/yum/pulpcore-{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/$basearch/" pulp_pkg_repo_gpgcheck: False pulp_settings: secret_key: "unsafe_default" @@ -24,4 +23,5 @@ pulp_install_plugins: "{{ pulp_install_plugins_base | combine(pulp_install_plugi pulp_default_admin_password: password pulp_pkg_name_prefix_py36: "python3-" pulp_pkg_name_prefix_py38: "{{ 'tfm-pulpcore-python3-' if pipeline_os == 'centos7' else 'python38-' }}" -pulp_pkg_name_prefix: "{{ pulp_pkg_name_prefix_py38 if pipeline_version is version('3.15', '>=') else pulp_pkg_name_prefix_py36 }}" +pulp_pkg_name_prefix_py39: "{{ 'python39-' }}" +pulp_pkg_name_prefix: "{{ pulp_pkg_name_prefix_py39 if pipeline_version is version('3.15', '>=') else pulp_pkg_name_prefix_py36 }}" diff --git a/roles/foreman_client_repositories/defaults/main.yml b/roles/foreman_client_repositories/defaults/main.yml index 14c95cd02..64a405597 100644 --- a/roles/foreman_client_repositories/defaults/main.yml +++ b/roles/foreman_client_repositories/defaults/main.yml @@ -4,3 +4,4 @@ foreman_client_repositories_environment: release foreman_client_repositories_dists: RedHat: el Fedora: fc +foreman_client_repositories_staging_source: koji diff --git a/roles/foreman_client_repositories/tasks/_koji_staging_repo.yml b/roles/foreman_client_repositories/tasks/_koji_staging_repo.yml new file mode 100644 index 000000000..dab1903e8 --- /dev/null +++ b/roles/foreman_client_repositories/tasks/_koji_staging_repo.yml @@ -0,0 +1,10 @@ +--- +- name: 'Foreman {{ foreman_client_repositories_version }} Client Staging Repository' + yum_repository: + name: foreman-client-koji + description: "Foreman {{ foreman_client_repositories_version }} Client Koji Repository" + baseurl: "http://koji.katello.org/releases/yum/foreman-client-{{ foreman_client_repositories_version }}/{{ foreman_client_repositories_dists[ansible_os_family] }}{{ ansible_distribution_major_version }}/x86_64/" + priority: '1' + gpgcheck: no + tags: + - packages diff --git a/roles/foreman_client_repositories/tasks/_stagingyum_staging_repo.yml b/roles/foreman_client_repositories/tasks/_stagingyum_staging_repo.yml new file mode 100644 index 000000000..994ddd120 --- /dev/null +++ b/roles/foreman_client_repositories/tasks/_stagingyum_staging_repo.yml @@ -0,0 +1,10 @@ +--- +- name: 'Foreman {{ foreman_client_repositories_version }} Client Staging Repository' + yum_repository: + name: foreman-client-staging + description: "Foreman {{ foreman_client_repositories_version }} Client Staging Repository" + baseurl: "https://stagingyum.theforeman.org/client/{{ foreman_client_repositories_version }}/{{ foreman_client_repositories_dists[ansible_os_family] }}{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages diff --git a/roles/foreman_client_repositories/tasks/staging_repo.yml b/roles/foreman_client_repositories/tasks/staging_repo.yml index b5308dc6b..670ae0631 100644 --- a/roles/foreman_client_repositories/tasks/staging_repo.yml +++ b/roles/foreman_client_repositories/tasks/staging_repo.yml @@ -6,13 +6,8 @@ tags: - packages -- name: 'Foreman {{ foreman_client_repositories_version }} Client Staging Repository' - yum_repository: - name: foreman-client-koji - description: "Foreman {{ foreman_client_repositories_version }} Client Koji Repository" - baseurl: "http://koji.katello.org/releases/yum/foreman-client-{{ foreman_client_repositories_version }}/{{ foreman_client_repositories_dists[ansible_os_family] }}{{ ansible_distribution_major_version }}/x86_64/" - priority: '1' - gpgcheck: no +- ansible.builtin.include_tasks: + file: _{{ foreman_client_repositories_staging_source }}_staging_repo.yml - include_tasks: qpid.yml when: diff --git a/roles/foreman_repositories/defaults/main.yml b/roles/foreman_repositories/defaults/main.yml index f4270b86d..409e14e33 100644 --- a/roles/foreman_repositories/defaults/main.yml +++ b/roles/foreman_repositories/defaults/main.yml @@ -2,3 +2,4 @@ foreman_repositories_version: nightly foreman_repositories_environment: release foreman_repositories_plugins: true +foreman_repositories_staging_source: koji diff --git a/roles/foreman_repositories/tasks/_koji_staging_repos.yml b/roles/foreman_repositories/tasks/_koji_staging_repos.yml new file mode 100644 index 000000000..348bcebed --- /dev/null +++ b/roles/foreman_repositories/tasks/_koji_staging_repos.yml @@ -0,0 +1,33 @@ +--- +- name: 'Foreman {{ foreman_repositories_version }} Koji repository' + yum_repository: + name: foreman-koji + description: "Foreman {{ foreman_repositories_version }} Koji Repository" + baseurl: "http://koji.katello.org/releases/yum/foreman-{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages + +- name: 'Foreman {{ foreman_repositories_version }} Plugins Koji repository' + yum_repository: + name: foreman-plugins-koji + state: "{{ foreman_repositories_plugins | ternary('present', 'absent') }}" + description: "Foreman Plugins {{ foreman_repositories_version }} Koji Repository" + baseurl: "http://koji.katello.org/releases/yum/foreman-plugins-{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages + +- name: 'Set module_hotfixes=1' + lineinfile: + path: "/etc/yum.repos.d/{{ item }}.repo" + line: module_hotfixes=1 + loop: + - foreman-koji + - foreman-plugins-koji + tags: + - packages + when: + - foreman_repositories_version != 'nightly' diff --git a/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml b/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml new file mode 100644 index 000000000..b5869b932 --- /dev/null +++ b/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml @@ -0,0 +1,20 @@ +--- +- name: 'Foreman {{ foreman_repositories_version }} Staging repository' + yum_repository: + name: foreman-staging + description: "Foreman {{ foreman_repositories_version }} Staging Repository" + baseurl: "https://stagingyum.theforeman.org/foreman/{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages + +- name: 'Foreman {{ foreman_repositories_version }} Plugins Staging repository' + yum_repository: + name: foreman-plugins-staging + description: "Foreman {{ foreman_repositories_version }} Plugins Staging Repository" + baseurl: "https://stagingyum.theforeman.org/plugins/{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages diff --git a/roles/foreman_repositories/tasks/redhat_staging_repos.yml b/roles/foreman_repositories/tasks/redhat_staging_repos.yml index 5d839af44..2a9f72e38 100644 --- a/roles/foreman_repositories/tasks/redhat_staging_repos.yml +++ b/roles/foreman_repositories/tasks/redhat_staging_repos.yml @@ -6,39 +6,8 @@ tags: - packages -- name: 'Foreman {{ foreman_repositories_version }} Koji repository' - yum_repository: - name: foreman-koji - description: "Foreman {{ foreman_repositories_version }} Koji Repository" - baseurl: "http://koji.katello.org/releases/yum/foreman-{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" - priority: "1" - gpgcheck: no - tags: - - packages - -- name: 'Foreman {{ foreman_repositories_version }} Plugins Koji repository' - yum_repository: - name: foreman-plugins-koji - state: "{{ foreman_repositories_plugins | ternary('present', 'absent') }}" - description: "Foreman Plugins {{ foreman_repositories_version }} Koji Repository" - baseurl: "http://koji.katello.org/releases/yum/foreman-plugins-{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" - priority: "1" - gpgcheck: no - tags: - - packages - -- name: 'Set module_hotfixes=1' - lineinfile: - path: "/etc/yum.repos.d/{{ item }}.repo" - line: module_hotfixes=1 - loop: - - foreman-koji - - foreman-plugins-koji - tags: - - packages - when: - - foreman_repositories_version != 'nightly' - - foreman_repositories_version is version('3.1', '<=') +- ansible.builtin.include_tasks: + file: _{{ foreman_repositories_staging_source }}_staging_repos.yml - name: 'Enable foreman:el8 module' command: dnf module enable -y foreman:el8 diff --git a/roles/katello_repositories/defaults/main.yml b/roles/katello_repositories/defaults/main.yml index c35b30d82..54997fb55 100644 --- a/roles/katello_repositories/defaults/main.yml +++ b/roles/katello_repositories/defaults/main.yml @@ -2,3 +2,4 @@ katello_repositories_version: nightly katello_repositories_environment: "{{ foreman_repositories_environment | default('release') }}" katello_repositories_pulp_release: stable +katello_repositories_staging_source: 'koji' diff --git a/roles/katello_repositories/tasks/_koji_staging_repos.yml b/roles/katello_repositories/tasks/_koji_staging_repos.yml new file mode 100644 index 000000000..c6bb6b97b --- /dev/null +++ b/roles/katello_repositories/tasks/_koji_staging_repos.yml @@ -0,0 +1,26 @@ +--- +- name: 'Katello {{ katello_repositories_version }} Koji repository' + yum_repository: + name: katello-koji + description: "Katello {{ katello_repositories_version }} Koji Repository" + baseurl: "http://koji.katello.org/releases/yum/katello-{{ katello_repositories_version }}/katello/el{{ ansible_distribution_major_version }}/x86_64/" + priority: '1' + gpgcheck: no + +- name: 'Candlepin Koji repository' + yum_repository: + name: candlepin-koji + description: "Candlepin {{ katello_repositories_version }} Koji Repository" + baseurl: "http://koji.katello.org/releases/yum/katello-{{ katello_repositories_version }}/candlepin/el{{ ansible_distribution_major_version }}/x86_64/" + priority: '1' + gpgcheck: no + +- name: 'Set module_hotfixes=1' + lineinfile: + path: "/etc/yum.repos.d/{{ item }}.repo" + line: module_hotfixes=1 + loop: + - katello-koji + - candlepin-koji + when: + - katello_repositories_version != 'nightly' diff --git a/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml b/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml new file mode 100644 index 000000000..c67d0689f --- /dev/null +++ b/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml @@ -0,0 +1,20 @@ +--- +- name: 'Katello {{ katello_repositories_version }} Staging repository' + yum_repository: + name: katello-staging + description: "Katello {{ katello_repositories_version }} Staging Repository" + baseurl: "https://stagingyum.theforeman.org/katello/{{ katello_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages + +- name: 'Candlepin {{ katello_repositories_version }} Staging repository' + yum_repository: + name: candlepin-staging + description: "Candlepin {{ katello_repositories_version }} Staging Repository" + baseurl: "https://stagingyum.theforeman.org/candlepin/{{ katello_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" + priority: "1" + gpgcheck: no + tags: + - packages diff --git a/roles/katello_repositories/tasks/staging_repos.yml b/roles/katello_repositories/tasks/staging_repos.yml index b572bade7..8b3d9d0ab 100644 --- a/roles/katello_repositories/tasks/staging_repos.yml +++ b/roles/katello_repositories/tasks/staging_repos.yml @@ -4,32 +4,8 @@ name: katello-repos state: absent -- name: 'Katello {{ katello_repositories_version }} Koji repository' - yum_repository: - name: katello-koji - description: "Katello {{ katello_repositories_version }} Koji Repository" - baseurl: "http://koji.katello.org/releases/yum/katello-{{ katello_repositories_version }}/katello/el{{ ansible_distribution_major_version }}/x86_64/" - priority: '1' - gpgcheck: no - -- name: 'Candlepin Koji repository' - yum_repository: - name: candlepin-koji - description: "Candlepin {{ katello_repositories_version }} Koji Repository" - baseurl: "http://koji.katello.org/releases/yum/katello-{{ katello_repositories_version }}/candlepin/el{{ ansible_distribution_major_version }}/x86_64/" - priority: '1' - gpgcheck: no - -- name: 'Set module_hotfixes=1' - lineinfile: - path: "/etc/yum.repos.d/{{ item }}.repo" - line: module_hotfixes=1 - loop: - - katello-koji - - candlepin-koji - when: - - katello_repositories_version != 'nightly' - - katello_repositories_version is version('4.2', '<=') +- ansible.builtin.include_tasks: + file: _{{ katello_repositories_staging_source }}_staging_repos.yml - name: 'Enable katello:el8 module' command: dnf module enable -y katello:el8