mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-03-13 21:52:21 +01:00
klal
This commit is contained in:
33
roles/mirror_repo/tasks/main.yml
Normal file
33
roles/mirror_repo/tasks/main.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
- name: Update Rocky 9 repos to local mirror
|
||||
hosts: rocky
|
||||
become: yes
|
||||
|
||||
vars:
|
||||
mirror_url: "http://192.168.77.101:8383/rocky/{{ ansible_distribution_major_version }}"
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Disable mirrorlist
|
||||
replace:
|
||||
path: /etc/yum.repos.d/rocky.repo
|
||||
regexp: '^mirrorlist='
|
||||
replace: '#mirrorlist='
|
||||
|
||||
- name: Set BaseOS baseurl
|
||||
replace:
|
||||
path: /etc/yum.repos.d/rocky.repo
|
||||
regexp: '^#?baseurl=.*BaseOS.*'
|
||||
replace: "baseurl={{ mirror_url }}/baseos/"
|
||||
|
||||
- name: Set AppStream baseurl
|
||||
replace:
|
||||
path: /etc/yum.repos.d/rocky.repo
|
||||
regexp: '^#?baseurl=.*AppStream.*'
|
||||
replace: "baseurl={{ mirror_url }}/appstream/"
|
||||
|
||||
- name: Clean DNF cache
|
||||
command: dnf clean all
|
||||
|
||||
- name: Rebuild cache
|
||||
command: dnf makecache
|
||||
Reference in New Issue
Block a user