xoxys.packages/tasks/redhat.yml

36 lines
1.1 KiB
YAML
Raw Normal View History

---
- name: Adjust dnf config file
ansible.builtin.template:
src: etc/dnf/dnf.conf.j2
dest: /etc/dnf/dnf.conf
owner: root
group: root
mode: "0644"
- name: Remove repository files
ansible.builtin.file:
name: "/etc/yum.repos.d/{{ item }}"
state: absent
loop: "{{ packages_repofiles_remove }}"
loop_control:
label: "/etc/yum.repos.d/{{ item }}"
notify: __packages_clean_metadata
- name: Add repositories
ansible.builtin.yum_repository:
name: "{{ item.name }}"
file: "{{ item.filename | default(omit) }}"
description: "{{ item.desc | default(omit) }}"
baseurl: "{{ item.baseurl | default(omit) }}"
gpgkey: "{{ item.gpgkey | default(omit) }}"
gpgcheck: "{{ item.gpgcheck | default('yes') }}"
sslverify: "{{ item.sslverify | default('yes') }}"
enabled: "{{ item.enabled | default('yes') }}"
state: "{{ item.state | default('present') }}"
loop: "{{ packages_yum_repositories + packages_yum_repositories_extra }}"
loop_control:
label: "{{ item.name }}"
notify:
- __packages_upgrade
- __packages_clean_metadata