23 lines
875 B
YAML
23 lines
875 B
YAML
- 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 временно недоступен |