Добавить FixRepositories24.10.yml

This commit is contained in:
2026-05-04 08:24:29 +00:00
parent 724e05f3e9
commit 22acb378af

23
FixRepositories24.10.yml Normal file
View File

@@ -0,0 +1,23 @@
- name: Fix EOL repositories for Ubuntu Oracular (24.10)
hosts: wg
become: true
tasks:
- name: Replace archive.ubuntu.com with old-releases.ubuntu.com
ansible.builtin.replace:
path: /etc/apt/sources.list
regexp: 'http://(?:archive|security).ubuntu.com/ubuntu'
replace: 'http://old-releases.ubuntu.com/ubuntu'
notify: Update apt cache
- name: Fix sources.list.d entries if present
ansible.builtin.shell: |
find /etc/apt/sources.list.d -name '*.list' -exec sed -i \
's|http://\(archive\|security\).ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' {} \;
changed_when: true
handlers:
- name: Update apt cache
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 3600
ignore_errors: true # Если old-releases временно недоступен