From 9190d10b2a170d85e0686b71385f1c3fb2fcb4b0 Mon Sep 17 00:00:00 2001 From: Odilon Sousa Date: Fri, 15 Mar 2024 00:14:01 -0300 Subject: [PATCH] Update pulpcore pipelines to use puppet-pulpcore on nightly --- pipelines/pulpcore/01-boxes.yml | 3 +- pipelines/pulpcore/02-install.yml | 91 +++++++++++++++------------- pipelines/pulpcore/03-tests.yml | 38 +++++++++--- pipelines/vars/forklift_pulpcore.yml | 4 +- playbooks/setup_forklift.yml | 18 +++++- requirements-pulp.yml | 2 +- 6 files changed, 97 insertions(+), 59 deletions(-) diff --git a/pipelines/pulpcore/01-boxes.yml b/pipelines/pulpcore/01-boxes.yml index e9db3f783..de38b7b2d 100644 --- a/pipelines/pulpcore/01-boxes.yml +++ b/pipelines/pulpcore/01-boxes.yml @@ -3,7 +3,6 @@ hosts: localhost become: False vars_files: - - ../vars/install_base.yml - - ../vars/forklift_{{ pipeline_type }}.yml + - ../vars/forklift_pulpcore.yml roles: - forklift diff --git a/pipelines/pulpcore/02-install.yml b/pipelines/pulpcore/02-install.yml index 7d9acba60..2fd003733 100644 --- a/pipelines/pulpcore/02-install.yml +++ b/pipelines/pulpcore/02-install.yml @@ -6,47 +6,54 @@ vars_files: - ../vars/forklift_pulpcore.yml tasks: - - name: Install podman-docker - package: - name: podman-docker - state: installed + - name: Enable postgresql 12 module + ansible.builtin.dnf: + name: '@postgresql:12' + state: present + when: + - pipeline_version is defined + - pipeline_version != 'nightly' and pipeline_version is version('3.28', '>=') + - pipeline_os is defined + - pipeline_os is search("centos8-stream") - - name: Start podman - service: - name: podman - state: started - - - name: Install git - package: - name: git - state: installed - - - name: Enable ruby 2.7 module - command: dnf module enable -y ruby:2.7 - when: ansible_distribution_major_version == "8" - - - name: enable powertools - command: dnf config-manager --set-enabled powertools - when: ansible_distribution_major_version == "8" - - - name: Install Ruby - package: - name: - - ruby - - ruby-devel - - rubygem-bundler - - gcc-c++ - - make - - redhat-rpm-config - - libyaml-devel - state: installed - - - name: Clone puppet-pulpcore - ansible.builtin.git: - repo: https://github.com/theforeman/puppet-pulpcore.git - dest: /src/puppet-pulpcore +- name: install pulpcore + hosts: + - "{{ forklift_server_name }}" + become: True + vars_files: + - ../vars/install_base.yml + - ../vars/forklift_{{ pipeline_type }}.yml + environment: + DJANGO_SETTINGS_MODULE: pulpcore.app.settings + pre_tasks: + - when: pipeline_version != 'nightly' and pipeline_version is version('3.28', '<=' ) + set_fact: + pulp_pkg_repo: "http://koji.katello.org/releases/yum/pulpcore-{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/$basearch/" + - when: pipeline_version != 'nightly' and pipeline_version is version('3.39', '==') + set_fact: + pulp_pkg_repo: "https://stagingyum.theforeman.org/pulpcore/{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/$basearch/" + pulp_pkg_name_prefix: "python3.11-" + roles: + - role: epel_repositories + when: + - pipeline_version is defined + - pipeline_version != 'nightly' and pipeline_version is version('3.28', '<=' ) + - role: pulp.pulp_installer.pulp_all_services + when: + - pipeline_version is defined + - pipeline_version != 'nightly' or pipeline_version is version('3.39', '==') - - name: Bundle install - command: bundle install - args: - chdir: /src/puppet-pulpcore +- name: Setup git repo + become: True + hosts: + - "{{ forklift_name }}" + vars_files: + - ../vars/forklift_pulpcore.yml + vars: + beaker_puppet_module: "puppet-pulpcore" + roles: + - role: beaker + when: + - install_method is defined + - install_method == "puppet" + - pipeline_version == 'nightly' or pipeline_version is version('3.40, '>=' ) diff --git a/pipelines/pulpcore/03-tests.yml b/pipelines/pulpcore/03-tests.yml index e66b153f4..75ecffc99 100644 --- a/pipelines/pulpcore/03-tests.yml +++ b/pipelines/pulpcore/03-tests.yml @@ -1,5 +1,5 @@ --- -- name: run tests +- name: run tests beaker become: True hosts: - "{{ forklift_name }}" @@ -7,12 +7,30 @@ - ../vars/forklift_pulpcore.yml tasks: - name: Run acceptance tests - command: bundle exec rake beaker - args: - chdir: /src/puppet-pulpcore - environment: - BEAKER_HYPERVISOR: "docker" - BEAKER_provision: "yes" - BEAKER_setfile: "centos8-64{hostname=centos8-64.example.com}" - BEAKER_destroy: "no" - BEAKER_FACTER_PULPCORE_VERSION: "{{ pipeline_version }}" + ansible.builtin.include_role: + name: beaker + tasks_from: test + when: + - install_method is defined + - install_method == "puppet" + - pipeline_version == 'nightly' and pipeline_version is version('3.40, '>=' ) + vars: + beaker_puppet_module: "puppet-pulpcore" + beaker_os: "{{ pipeline_os.replace('-stream', '') }}" + beaker_environment: + BEAKER_FACTER_PULPCORE_BASEURL: "https://stagingyum.theforeman.org/pulpcore/{{ pipeline_version }}/el{{ ansible_distribution_major_version }}/x86_64" + +- name: run tests ansible + hosts: + - "{{ forklift_server_name }}" + become: True + hosts: + - "{{ forklift_name }}" + vars_files: + - ../vars/install_base.yml + - ../vars/forklift_{{ pipeline_type }}.yml + roles: + - role: pulp.pulp_installer.pulp_health_check + when: + - pipeline_version is defined + - pipeline_version != 'nightly' and pipeline_version is version('3.39', '<=' ) diff --git a/pipelines/vars/forklift_pulpcore.yml b/pipelines/vars/forklift_pulpcore.yml index 045f6a36e..96c2aa3fd 100644 --- a/pipelines/vars/forklift_pulpcore.yml +++ b/pipelines/vars/forklift_pulpcore.yml @@ -1,4 +1,4 @@ -forklift_name: "pipe-pulp-{{ pipeline_version }}-{{ pipeline_os }}" +forklift_name: "pipe-pulpcore-{{ pipeline_version }}-{{ pipeline_os }}" server_box: box: "{{ pipeline_os }}" @@ -25,4 +25,4 @@ 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 == 'nightly' or pipeline_version is version('3.15', '>=') else pulp_pkg_name_prefix_py36 }}" +pulp_pkg_name_prefix: "{{ pulp_pkg_name_prefix_py38 if pipeline_version == 'nightly' or pipeline_version is version('3.15', '>=') else pulp_pkg_name_prefix_py36 }}" \ No newline at end of file diff --git a/playbooks/setup_forklift.yml b/playbooks/setup_forklift.yml index 1977038bd..1e4c34ea1 100644 --- a/playbooks/setup_forklift.yml +++ b/playbooks/setup_forklift.yml @@ -94,12 +94,26 @@ - name: 'Install Forklift Pulp collection dependencies for >3.18' command: - cmd: ansible-galaxy collection install -r requirements-pulp-322.yml + cmd: ansible-galaxy collection install -r requirements-pulp.yml + chdir: "{{ forklift_dest }}" + when: + - forklift_install_pulp_from_galaxy + - pipeline_version is defined + - pipeline_version != 'nightly' + - pipeline_version is version('3.28', '>=') + - pipeline_version is version('3.39', '<') + retries: 3 + register: result + until: result is succeeded + + - name: 'Install Forklift Pulp collection dependencies for >3.39' + command: + cmd: ansible-galaxy collection install -r requirements-pulp-339.yml chdir: "{{ forklift_dest }}" when: - forklift_install_pulp_from_galaxy - pipeline_version is defined - - pipeline_version == 'nightly' or pipeline_version is version('3.18', '>=') + - pipeline_version == 'nightly' or pipeline_version is version('3.39', '>=') retries: 3 register: result until: result is succeeded diff --git a/requirements-pulp.yml b/requirements-pulp.yml index e096d9a2b..e4d49fa6d 100644 --- a/requirements-pulp.yml +++ b/requirements-pulp.yml @@ -1,3 +1,3 @@ collections: - name: pulp.pulp_installer - version: 3.15.9-4 + version: 3.22.0