refactor: remove yum config and fix vars
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Robert Kaussow 2022-03-09 22:05:52 +01:00
parent 7ac21701b5
commit a9f5b73d5a
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
7 changed files with 33 additions and 61 deletions

View File

@ -1,7 +1,7 @@
---
packages_repositories: []
# @var packages_repositories:example: >
# packages_repositories:
packages_yum_repositories: []
# @var packages_yum_repositories:example: >
# packages_yum_repositories:
# - name: epel
# filename: Extra-EPEL
# desc: Extra Packages for Enterprise Linux (EPEL)
@ -9,7 +9,7 @@ packages_repositories: []
# gpgkey: "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever/"
# enabled: True
# @end
packages_repositories_extra: []
packages_yum_repositories_extra: []
packages_repofiles_remove: []
@ -26,7 +26,7 @@ packages_upgrade_enabled: False
packages_packages_enablerepo: []
packages_packages_install: []
packages_packages_install_extra: []
packages_install: []
packages_install_extra: []
packages_packages_uninstall: []
packages_uninstall: []

View File

@ -1,8 +1,8 @@
---
- name: Adjust packages config file
template:
src: etc/packages.conf.j2
dest: /etc/packages.conf
src: etc/dnf/dnf.conf.j2
dest: /etc/dnf/dnf.conf
owner: root
group: root
mode: 0644

View File

@ -1,4 +1,3 @@
---
- include_tasks: config.yml
- include_tasks: repository.yml
- include_tasks: packages.yml

View File

@ -1,17 +0,0 @@
---
- block:
- name: Remove common packages
package:
name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}"
state: absent
loop: "{{ packages_packages_uninstall }}"
- name: Install common packages
package:
name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}"
state: present
loop: "{{ packages_packages_install + packages_packages_install_extra }}"
become: True
become_user: root

View File

@ -1,7 +1,7 @@
---
- block:
- name: Add common package repositories
packages_repository:
yum_repository:
name: "{{ item.name }}"
file: "{{ item.filename }}"
description: "{{ item.desc | default(omit) }}"
@ -11,7 +11,7 @@
sslverify: "{{ item.sslverify | default('yes') }}"
enabled: "{{ item.enabled | default('yes') }}"
state: "{{ item.state | default('present') }}"
loop: "{{ packages_repositories + packages_repositories_extra }}"
loop: "{{ packages_yum_repositories + packages_yum_repositories_extra }}"
loop_control:
label: "{{ item.name }}"
notify: __packages_upgrade
@ -23,5 +23,19 @@
loop: "{{ packages_repofiles_remove }}"
loop_control:
label: "/etc/packages.repos.d/{{ item }}"
- name: Uninstall common packages
package:
name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}"
state: absent
loop: "{{ packages_uninstall }}"
- name: Install common packages
package:
name: "{{ item }}"
enablerepo: "{{ packages_packages_enablerepo }}"
state: present
loop: "{{ packages_install + packages_install_extra }}"
become: True
become_user: root

View File

@ -0,0 +1,8 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False

View File

@ -1,32 +0,0 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
{% if packages_deltarpm_value != 0 %}
deltarpm={{ packages_deltarpm_value }}
deltarpm_percentage={{ packages_deltarpm_percentage }}
{% endif %}
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d