diff --git a/README.md b/README.md index a57b7879e..0343d67d3 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ hostmanager_ip_resolver_device: 'eth1' Sometimes you want to spin up the same box type (e.g. centos8-katello-devel) from within the forklift directory. While this can be added to the Vagrantfile directly, updates to the forklift repository could wipe out your local changes. To help with this, you can define a custom box re-using the configuration within the Vagrantfile. To do so, create a `99-local.yaml` file in vagrant/boxes.d/. For example, to create a custom box on CentOS 8 Stream with nightly and run the installers reset command: ```yaml -my-nightly-koji: +my-nightly-staging: box: centos8-stream ansible: playbook: playbooks/katello.yml diff --git a/docs/development.md b/docs/development.md index 96d9dd8ab..0c816784e 100644 --- a/docs/development.md +++ b/docs/development.md @@ -8,7 +8,6 @@ This covers how to setup and configure a development environment using the Forkl * [Starting the Development Server](#starting-the-development-server) * [Customizing the Development Environment](#customizing-the-development-environment) * [Reviewing Pull Requests](#reviewing-pull-requests) - * [Use Koji Scratch Builds](#koji-scratch-builds) * [Packit PR Builds](#packit-pr-builds) * [Test Puppet Module Pull Requests](#test-puppet-module) * [Hammer Development](#hammer-development) @@ -176,37 +175,6 @@ Once reviewing is finished, the repository can be reset to develop/master branch If `rpr` is used in project with `config/database.yml` it will also create a backup of the db in ./tmp/. When `rrpr` is called later and in case previous backup was found, it asks whether it should be restored. -## Koji Scratch Builds - -Forklift supports using Koji scratch builds to make RPMs available for testing purposes. For example, if you want to test a change to nightly, with a scratch build of rubygem-katello. This is done by fetching the scratch builds, and deploying a local yum repo to the box you are deploying on. Multiple scratch builds are also supported for testing changes to multiple components at once (e.g. the installer and the rubygem), see examples below. Also, this option may be specified from within `99-local.yaml` via the `options:` option. - - -An Ansible role is provided that can setup and configure a Koji scratch build for testing. If you had an existing playbook such as: - -```yaml -- hosts: server - roles: - - etc_hosts - - foreman_repositories - - katello_repositories - - katello -``` - -The Koji role and task ID variable can be added to download and configure a repository with priority: - -```yaml -- hosts: server - vars: - koji_task_ids: - - 321231 - roles: - - etc_hosts - - koji - - foreman_repositories - - katello_repositories - - katello -``` - ## Packit PR Builds Forklift supports using Packit PR builds for testing purposes. To use those one needs to define the `packit_prs` variable to the list of PRs (in the form of `//` or as full PR links): diff --git a/pipelines/vars/repos_staging.yml b/pipelines/vars/repos_staging.yml index e4525dd92..e7a852509 100644 --- a/pipelines/vars/repos_staging.yml +++ b/pipelines/vars/repos_staging.yml @@ -1,6 +1,3 @@ katello_repositories_environment: staging foreman_repositories_environment: staging foreman_client_repositories_environment: staging -foreman_repositories_staging_source: "{{ 'stagingyum' if (pipeline_version == 'nightly' or pipeline_version is version('3.9', '>=')) else 'koji' }}" -foreman_client_repositories_staging_source: "{{ 'stagingyum' if (pipeline_version == 'nightly' or (pipeline_type == 'katello' and pipeline_version is version('4.11', '>=')) or (pipeline_type != 'katello' and pipeline_version is version('3.9', '>='))) else 'koji' }}" -katello_repositories_staging_source: "{{ 'stagingyum' if (pipeline_version == 'nightly' or pipeline_version is version('4.11', '>=')) else 'koji' }}" diff --git a/roles/foreman/meta/main.yml b/roles/foreman/meta/main.yml index 2909464cc..1c47b96d1 100644 --- a/roles/foreman/meta/main.yml +++ b/roles/foreman/meta/main.yml @@ -5,7 +5,6 @@ dependencies: - role: fapolicyd when: foreman_fapolicyd | default(false) - role: etc_hosts - - role: koji - role: packit - role: foreman_server_repositories - role: foreman_installer diff --git a/roles/foreman_client_repositories/defaults/main.yml b/roles/foreman_client_repositories/defaults/main.yml index 64a405597..14c95cd02 100644 --- a/roles/foreman_client_repositories/defaults/main.yml +++ b/roles/foreman_client_repositories/defaults/main.yml @@ -4,4 +4,3 @@ 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 deleted file mode 100644 index dcf0b9af9..000000000 --- a/roles/foreman_client_repositories/tasks/_koji_staging_repo.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- 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/" - 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 deleted file mode 100644 index ad70dd66f..000000000 --- a/roles/foreman_client_repositories/tasks/_stagingyum_staging_repo.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- 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/" - 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 3a2c1ff7c..80ab41a9c 100644 --- a/roles/foreman_client_repositories/tasks/staging_repo.yml +++ b/roles/foreman_client_repositories/tasks/staging_repo.yml @@ -6,5 +6,11 @@ tags: - packages -- ansible.builtin.include_tasks: - file: _{{ foreman_client_repositories_staging_source }}_staging_repo.yml +- 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/" + gpgcheck: no + tags: + - packages diff --git a/roles/foreman_repositories/defaults/main.yml b/roles/foreman_repositories/defaults/main.yml index 409e14e33..f4270b86d 100644 --- a/roles/foreman_repositories/defaults/main.yml +++ b/roles/foreman_repositories/defaults/main.yml @@ -2,4 +2,3 @@ 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 deleted file mode 100644 index 30d5010e1..000000000 --- a/roles/foreman_repositories/tasks/_koji_staging_repos.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- 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/" - 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/" - gpgcheck: no - tags: - - packages diff --git a/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml b/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml deleted file mode 100644 index cd9875864..000000000 --- a/roles/foreman_repositories/tasks/_stagingyum_staging_repos.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- 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/" - 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/" - 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 2a9f72e38..60237a127 100644 --- a/roles/foreman_repositories/tasks/redhat_staging_repos.yml +++ b/roles/foreman_repositories/tasks/redhat_staging_repos.yml @@ -6,8 +6,23 @@ tags: - packages -- ansible.builtin.include_tasks: - file: _{{ foreman_repositories_staging_source }}_staging_repos.yml +- 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/" + 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/" + gpgcheck: no + tags: + - packages - 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 c77b2ed39..6403a50c8 100644 --- a/roles/katello_repositories/defaults/main.yml +++ b/roles/katello_repositories/defaults/main.yml @@ -1,4 +1,3 @@ --- katello_repositories_version: nightly katello_repositories_environment: "{{ foreman_repositories_environment | default('release') }}" -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 deleted file mode 100644 index 1b434e14f..000000000 --- a/roles/katello_repositories/tasks/_koji_staging_repos.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- 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/" - 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/" - gpgcheck: no diff --git a/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml b/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml deleted file mode 100644 index 9aa9152bf..000000000 --- a/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- 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/" - gpgcheck: no - tags: - - packages diff --git a/roles/katello_repositories/tasks/staging_repos.yml b/roles/katello_repositories/tasks/staging_repos.yml index 364f75604..0c3d77c6d 100644 --- a/roles/katello_repositories/tasks/staging_repos.yml +++ b/roles/katello_repositories/tasks/staging_repos.yml @@ -4,8 +4,14 @@ name: katello-repos state: absent -- ansible.builtin.include_tasks: - file: _{{ katello_repositories_staging_source }}_staging_repos.yml +- 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/" + gpgcheck: no + tags: + - packages - name: 'Enable katello:el8 module' command: dnf module enable -y katello:el8 diff --git a/roles/koji/defaults/main.yml b/roles/koji/defaults/main.yml deleted file mode 100644 index b377e37ec..000000000 --- a/roles/koji/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -koji_host: 'http://koji.katello.org/kojihub' -koji_task_ids: [] -koji_build_ids: [] -koji_repo_directory: "/tmp/koji-repo" -koji_topurl: 'http://koji.katello.org/kojifiles' diff --git a/roles/koji/tasks/download.yml b/roles/koji/tasks/download.yml deleted file mode 100644 index f20cc9048..000000000 --- a/roles/koji/tasks/download.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: 'Install koji package' - yum: - name: 'koji' - state: 'present' - -- name: 'Make repo directory' - file: - path: '{{ koji_repo_directory }}' - state: 'directory' - -- name: 'Download RPMs from tasks' - command: "koji --server {{ koji_host }} --topurl {{ koji_topurl }} download-task {{ item }}" - args: - chdir: "{{ koji_repo_directory }}" - with_items: "{{ koji_task_ids }}" - -- name: 'Download RPMs from builds' - command: "koji --server {{ koji_host }} --topurl {{ koji_topurl }} download-build {{ item }}" - args: - chdir: "{{ koji_repo_directory }}" - with_items: "{{ koji_build_ids }}" - -- name: 'Install createrepo' - yum: - name: 'createrepo' - state: 'present' - -- name: 'Create repo' - command: "createrepo {{ koji_repo_directory }}" - -- name: 'Add repo file' - yum_repository: - name: "koji-forklift-task-repo" - description: 'Local repository for Koji task RPMs' - baseurl: "file://{{ koji_repo_directory }}" - file: "koji_forklift_task_repo" - priority: 1 - enabled: yes - gpgcheck: no diff --git a/roles/koji/tasks/main.yml b/roles/koji/tasks/main.yml deleted file mode 100644 index 2200992f2..000000000 --- a/roles/koji/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include_tasks: download.yml - when: koji_task_ids != [] or koji_build_ids != []