Skip to content

Commit

Permalink
preflight: old repos disablement refactor
Browse files Browse the repository at this point in the history
This refacts the task that disables old repositories.
The speeds up this task which seems to be currently very time consuming.

```
TASK [disable older rhceph repositories if any] ****************************
changed: [localhost] => (item=rhceph-4-tools-for-rhel-8-x86_64-rpms)
changed: [localhost] => (item=rhceph-4-mon-for-rhel-8-x86_64-rpms)
changed: [localhost] => (item=rhceph-4-osd-for-rhel-8-x86_64-rpms)
changed: [localhost] => (item=rhceph-5-tools-for-rhel-8-x86_64-rpms)

PLAY RECAP *****************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

real	3m18.439s
```

```
TASK [disable older rhceph repositories if any] ***********
changed: [localhost]

PLAY RECAP ***********************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

real	0m47.198s
```

Also, this makes sure all previous repositories are disabled for both
el8 and el9.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2181243

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
  • Loading branch information
guits authored and asm0deuz committed Jul 27, 2023
1 parent 119a3a8 commit 2718dfd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cephadm-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
become: true
gather_facts: true
vars:
repos_to_disable:
- rhceph-4-tools-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
- rhceph-4-mon-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
- rhceph-4-osd-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
- rhceph-5-tools-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ ansible_facts['architecture'] }}-rpms
packages_to_uninstall:
- ceph-mds
- ceph-mgr
Expand All @@ -49,13 +54,8 @@

- name: disable older rhceph repositories if any
rhsm_repository:
name: "{{ item }}"
name: "{{ repos_to_disable }}"
state: absent
loop:
- rhceph-4-tools-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms
- rhceph-4-mon-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms
- rhceph-4-osd-for-rhel-8-{{ ansible_facts['architecture'] }}-rpms
when: ansible_facts['distribution_major_version'] | int == 8

- name: enable ceph package repositories
when: ceph_origin in ['community', 'ibm']
Expand Down

0 comments on commit 2718dfd

Please sign in to comment.