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..4ecb582a7 --- /dev/null +++ b/roles/foreman_client_repositories/tasks/_koji_staging_repo.yml @@ -0,0 +1,8 @@ +--- +- 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 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..e864abe53 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_repos.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..e27630677 --- /dev/null +++ b/roles/foreman_repositories/tasks/_koji_staging_repos.yml @@ -0,0 +1,34 @@ +--- +- 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', '<=') 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/tasks/_koji_staging_repos.yml b/roles/katello_repositories/tasks/_koji_staging_repos.yml new file mode 100644 index 000000000..6ca98e017 --- /dev/null +++ b/roles/katello_repositories/tasks/_koji_staging_repos.yml @@ -0,0 +1,27 @@ +--- +- 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', '<=') 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