This commit is contained in:
Chris Hammer 2025-03-25 21:32:27 -04:00
parent 1570008cfc
commit 46da84ca99
2 changed files with 0 additions and 151 deletions

View File

@ -1,93 +0,0 @@
---
- name: Version Lock
hosts: temp
become: false
gather_facts: false
vars:
leapp_role_dependencies:
- httpd-2.4.6-17.el7
- httpd-tools-2.4.6-17.el7
- leapp-0.17.0-2.el7_9
- leapp-upgrade-el7toel8-0.20.0-13.el7_9
- leapp-upgrade-el7toel8-deps-0.20.0-13.el7_9
- leapp-deps-0.17.0-2.el7_9
- python2-leapp-0.17.0-2.el7_9
# - broken-pkg-foo-1.2.3.el7
leapp_all_packages:
- httpd-*
- leapp-*
- python2-leapp
tasks:
- name: Remove Leapp if requested or if required files are not present
block:
- name: Trigger re-install if requested
ansible.builtin.fail:
when: perform_leapp_reinstall | default(false) | bool
# - name: Check /etc/leapp/files
# ansible.builtin.find:
# paths: /etc/leapp/files
# register: etc_leapp
# - name: List out files
# ansible.builtin.set_fact:
# etc_leapp_files: >-
# {{ etc_leapp['files'] | map(attribute='path') | map('basename') }}
# - name: Fail if neither version of the device driver json exists
# ansible.builtin.fail:
# when:
# - "'device_driver_data.json' not in etc_leapp_files"
# - "'device_driver_deprecation_data.json' not in etc_leapp_files"
# - name: Fail if pes or repomap jsons do not exist
# ansible.builtin.assert:
# that:
# - "'pes-events.json' in etc_leapp_files"
# - "'repomap.json' in etc_leapp_files"
rescue:
# - name: Ensure dependencies and verionlocks are removed for fresh install
# block:
# - name: Ensure leapp dependencies are removed for fresh install
# ansible.builtin.yum:
# name: "{{ leapp_all_packages }}"
# state: absent
# autoremove: true
# - name: Ensure versionlocks are removed # noqa: command-instead-of-module
# ansible.builtin.command: "yum versionlock delete {{ leapp_all_packages | join(' ') }}"
# failed_when: r_versionlock_remove['rc'] not in [0, 1]
# changed_when: r_versionlock_remove['rc'] == 0
# ignore_errors: true
# register: r_versionlock_remove
- name: Ensure versionlocks are removed # noqa: command-instead-of-module
ansible.builtin.command: "yum versionlock delete '{{ item }}'"
failed_when: r_versionlock_remove['rc'] not in [0, 1]
changed_when: r_versionlock_remove['rc'] == 0
ignore_errors: true
register: r_versionlock_remove
loop: "{{ leapp_all_packages }}"
- name: End host
ansible.builtin.meta: end_host
- name: Ensure yum-plugin-versionlock is present
ansible.builtin.yum:
name: yum-plugin-versionlock
state: present
- name: Check provided list of packages and versionlock as needed
ansible.builtin.include_tasks: tasks/lock_pkg.yml
loop: "{{ leapp_role_dependencies }}"
- name: Ensure dependencies are installed
ansible.builtin.yum:
name: "{{ leapp_role_dependencies }}"
state: present
allow_downgrade: true

View File

@ -1,58 +0,0 @@
---
- name: Version Lock
hosts: temp
become: false
gather_facts: false
vars:
lock_pkgs:
- httpd-2.4.6-17.el7
- httpd-tools-2.4.6-17.el7
- leapp-0.17.0-2.el7_9
- leapp-upgrade-el7toel8-0.20.0-13.el7_9
- leapp-upgrade-el7toel8-deps-0.20.0-13.el7_9
- leapp-deps-0.17.0-2.el7_9
- python2-leapp-0.17.0-2.el7_9
# - broken-pkg-foo-1.2.3.el7
all_pkgs:
- httpd-*
- leapp-*
- python2-leapp
tasks:
- name: Ensure dependencies and verionlocks are removed for fresh install
when:
- remove_deps | default(false) | bool
block:
- name: Ensure dependencies are removed for fresh install
ansible.builtin.yum:
name: "{{ all_pkgs }}"
state: absent
autoremove: true
- name: Ensure versionlocks are removed # noqa: command-instead-of-module
ansible.builtin.command: "yum versionlock delete '{{ item }}'"
failed_when: r_versionlock_delete['rc'] not in [0, 1]
changed_when: r_versionlock_delete['rc'] == 0
ignore_errors: true
register: r_versionlock_delete
loop: "{{ all_pkgs }}"
- name: End host
ansible.builtin.meta: end_host
- name: Ensure yum-plugin-versionlock is present
ansible.builtin.yum:
name: yum-plugin-versionlock
state: present
- name: Check provided list of packages and versionlock as needed
ansible.builtin.include_tasks: tasks/lock_pkg.yml
loop: "{{ lock_pkgs }}"
- name: Ensure dependencies are installed
ansible.builtin.yum:
name: "{{ lock_pkgs }}"
state: present
allow_downgrade: true