diff --git a/tasks/pkg-redhat.yml b/tasks/pkg-redhat.yml index a6453733..ebd4de6b 100644 --- a/tasks/pkg-redhat.yml +++ b/tasks/pkg-redhat.yml @@ -146,6 +146,16 @@ warn: no when: repofile5.changed or repofile6.changed or repofile7.changed or repofilecustom.changed +# On certain version of dnf, gpg keys aren't imported into the local db with the package install task. +# This rule assures that they are correctly imported into the local db and users won't have to manually accept +# them if running dnf commands on the hosts. +- name: Refresh Datadog repository cache # noqa 503 + command: yum -y makecache --disablerepo="*" --enablerepo=datadog + failed_when: false + args: + warn: no + when: repofile5.changed or repofile6.changed or repofile7.changed or repofilecustom.changed + - name: Remove old yum repo files yum_repository: name: "ansible_datadog_{{ item }}"