Skip to content

Commit

Permalink
Fixed apt cache update
Browse files Browse the repository at this point in the history
Apt cache update was triggered by a notify. A notify handler is running at the end of the Ansible block. As this role is used as dependency for other roles (like opencast_opensearch), the trigger will run to late.
  • Loading branch information
wsmirnow committed Dec 19, 2024
1 parent e8749c1 commit 53f6d45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 0 additions & 4 deletions handlers/main.yml

This file was deleted.

14 changes: 11 additions & 3 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
state: present

- name: Remove orphan opencast package repository definition
notify: Update apt cache
register: rm_orphan_repo
ansible.builtin.apt_repository:
repo: >-
deb https://pkg.opencast.org/debian
Expand All @@ -22,7 +22,7 @@
state: absent

- name: Install the opencast package repository
notify: Update apt cache
register: add_oc_repo
ansible.builtin.apt_repository:
repo: >-
deb https://pkg.opencast.org/debian
Expand All @@ -33,7 +33,7 @@
state: "{{ 'present' if opencast_repository_enabled_release | bool else 'absent' }}"

- name: Install the opencast testing package repository
notify: Update apt cache
register: add_oc_testing_repo
ansible.builtin.apt_repository:
repo: >-
deb https://pkg.opencast.org/debian
Expand All @@ -42,3 +42,11 @@
filename: opencast
# yamllint disable-line rule:line-length
state: "{{ 'present' if opencast_repository_enabled_testing | bool else 'absent' }}"

- name: Update apt cache
ansible.builtin.apt:
update_cache: true
when: >
rm_orphan_repo is changed or
add_oc_repo is changed or
add_oc_testing_repo is changed

0 comments on commit 53f6d45

Please sign in to comment.