kayobe/ansible/roles/dnf-automatic/tasks/main.yml
Mark Goddard dc32b52f08 CentOS 8: Support DNF
Adds support for configuration of DNF repo mirrors for CentOS and EPEL
repositories, as well as custom repositories.

Adds support for DNF automatic, which is a replacement for yum-cron.

Configuration is backwards compatible, falling back to the equivalent
yum variables when DNF variables have not been overridden.

Change-Id: I8bef5e9c8e1c77c25d6077ff690da8f2cde6a643
Story: 2006574
Task: 38922
2020-03-19 11:23:39 +00:00

28 lines
734 B
YAML

---
- block:
- name: Install dnf-automatic
dnf:
name: dnf-automatic
state: present
- name: Apply configuration for DNF automatic
ini_file:
path: /etc/dnf/automatic.conf
section: commands
option: "{{ item.option }}"
value: "{{ item.value }}"
loop:
- option: apply_updates
value: yes
- option: upgrade_type
value: "{{ dnf_automatic_upgrade_type }}"
- name: Enable dnf-automatic.timer
service:
name: dnf-automatic.timer
state: "{{ 'started' if dnf_automatic_enabled | bool else 'stopped' }}"
enabled: "{{ dnf_automatic_enabled | bool }}"
when: dnf_automatic_enabled | bool
become: true