well,
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s

This commit is contained in:
hogweed1
2026-11-06 16:57:59 +10:00
parent 4516196eed
commit 33a7b1db9c
2 changed files with 1 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
---
- name: Manage APT Repositories
hosts: all
# - harbor.guaranteedstruggle.host
# - ansible-slut.guaranteedstruggle.host
become: true # Required for managing system-level configurations
vars:
nexus_url: "https://nexus.guaranteedstruggle.host"
tasks:
- name: Очистить старый классический sources.list
ansible.builtin.copy:
content: "# Управляется Ansible: репозитории перенесены в sources.list.d/debian.sources\n"
dest: /etc/apt/sources.list
owner: root
group: root
mode: '0644'
# Шаг 2: Удаляем старый debian.sources если он создавался дефолтным шаблоном LXC с неполными компонентами
- name: Удалить дефолтный debian.sources для перезаписи
ansible.builtin.file:
path: /etc/apt/sources.list.d/debian.sources
state: absent
# Шаг 3: Накатываем наш единый и правильный DEB822 шаблон
- name: Создать унифицированный debian.sources с проксированием через Nexus
ansible.builtin.template:
src: "../templates/apt-repos/debian.sources.j2"
dest: /etc/apt/sources.list.d/debian.sources
owner: root
group: root
mode: '0644'
- name: Ensure apt cache is updated after changes
ansible.builtin.apt:
update_cache: yes
- name: Унификация репозиториев Proxmox под DEB822 и Nexus
hosts: proxmoxes
become: true
vars:
nexus_url: "https://nexus.guaranteedstruggle.host"
tasks:
# Шаг 1: Вычищаем старые файлы .list, чтобы APT не ругался на дублирование пакетов
- name: Удалить старые файлы конфигурации репозиториев Proxmox
ansible.builtin.file:
path: "/etc/apt/sources.list.d/{{ item }}"
state: absent
loop:
- ceph.list
- pve-enterprise.list
- pve-install-repo.list
- pvetest-for-beta.list
# Шаг 2: Накатываем один красивый и современный файл в формате DEB822
- name: Создать унифицированный proxmox.sources с проксированием через Nexus
ansible.builtin.template:
src: "../templates/apt-repos/proxmox.sources.j2"
dest: /etc/apt/sources.list.d/proxmox.sources
owner: root
group: root
mode: '0644'
# Шаг 3: Обновляем кэш apt для проверки связки с Нексусом
- name: Обновить apt кэш
ansible.builtin.apt:
update_cache: yes