mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-03-13 05:42:46 +01:00
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
---
|
|
- name: Update Rocky 9 repos to local mirror
|
|
become: true
|
|
|
|
vars:
|
|
mirror_url: "http://192.168.77.101:8383/rocky/{{ ansible_distribution_major_version }}"
|
|
|
|
block:
|
|
- name: Facts
|
|
ansible.builtin.setup:
|
|
when: ansible_facts.architecture is not defined
|
|
|
|
|
|
- name: Disable mirrorlist in baseos
|
|
ansible.builtin.ini_file:
|
|
path: /etc/yum.repos.d/rocky.repo
|
|
section: baseos
|
|
option: mirrorlist
|
|
state: absent
|
|
|
|
- name: Set BaseOS baseurl
|
|
ansible.builtin.ini_file:
|
|
path: /etc/yum.repos.d/rocky.repo
|
|
section: baseos
|
|
option: baseurl
|
|
value: "{{ mirror_url }}/baseos/"
|
|
|
|
- name: Disable mirrorlist in appstream
|
|
ansible.builtin.ini_file:
|
|
path: /etc/yum.repos.d/rocky.repo
|
|
section: appstream
|
|
option: mirrorlist
|
|
state: absent
|
|
|
|
- name: Set AppStream baseurl
|
|
ansible.builtin.ini_file:
|
|
path: /etc/yum.repos.d/rocky.repo
|
|
section: appstream
|
|
option: baseurl
|
|
value: "{{ mirror_url }}/appstream/"
|
|
|
|
- name: Clean DNF cache
|
|
command: dnf clean all
|
|
|
|
- name: Rebuild cache
|
|
command: dnf makecache |