mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Added ansible play to configure package managers
This commit is contained in:
37
ansible/pkg_mgr.configure.yml
Normal file
37
ansible/pkg_mgr.configure.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
|
||||
- name: Configure the package manager
|
||||
tags:
|
||||
- config
|
||||
- configuration
|
||||
- configure
|
||||
- dnf
|
||||
- package_manager
|
||||
- package_managers
|
||||
- package-manager
|
||||
- package-managers
|
||||
- pkg_mgr
|
||||
hosts: all
|
||||
vars:
|
||||
dnf_config: "{{ yum_config }}"
|
||||
yum_config:
|
||||
max_parallel_downloads: 10
|
||||
deltarpm: true
|
||||
fastestmirror: true
|
||||
skip_if_unavailable: true
|
||||
best: false
|
||||
clean_requirements_on_remove: true
|
||||
installonly_limit: 2
|
||||
gpgcheck: 1
|
||||
tasks:
|
||||
- name: "Configure {{ ansible_pkg_mgr|upper }}"
|
||||
when: ansible_pkg_mgr in ['dnf', 'yum']
|
||||
become: true
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/{{ ansible_pkg_mgr }}/{{ ansible_pkg_mgr }}.conf"
|
||||
line: "{{ item.key }}={{ item.value|string }}"
|
||||
regexp: '^.*{{ item.key }}\s*=\s*.*$'
|
||||
insertafter: '^[main]$'
|
||||
mode: '0644'
|
||||
backup: true
|
||||
loop: "{{ lookup('vars', [ansible_pkg_mgr, 'config']|join('_') ) | dict2items }}"
|
||||
Reference in New Issue
Block a user