xoxys.packages/tasks/main.yml

55 lines
1.6 KiB
YAML
Raw Normal View History

2022-02-12 13:36:51 +00:00
---
2024-02-18 19:30:22 +00:00
- name: Uninstall prerequisite packages
ansible.builtin.package:
name: "{{ item }}"
state: absent
loop: "{{ packages_uninstall_pre + packages_uninstall_pre_extra }}"
2024-02-18 19:30:22 +00:00
- 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"
2024-02-18 19:30:22 +00:00
- 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
2024-02-18 19:30:22 +00:00
- name: Add common 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
2024-02-18 19:30:22 +00:00
- name: Uninstall packages
ansible.builtin.package:
name: "{{ item }}"
state: absent
loop: "{{ packages_uninstall + packages_uninstall_extra }}"
2024-02-18 19:30:22 +00:00
- name: Install common packages
ansible.builtin.package:
name: "{{ item }}"
enablerepo: "{{ packages_enablerepo }}"
state: present
loop: "{{ packages_install + packages_install_extra }}"