Добавить FixRepositories24.10.yml
This commit is contained in:
23
FixRepositories24.10.yml
Normal file
23
FixRepositories24.10.yml
Normal 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 временно недоступен
|
||||
Reference in New Issue
Block a user