feat(os_deb): create role for setting apt repos

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2024-12-26 15:42:04 +01:00
parent 2d008e1eca
commit 7e1d9a7fc3
Signed by: mfocko
SSH key fingerprint: SHA256:icm0fIOSJUpy5+1x23sfr+hLtF9UhY8VpMC7H4WFJP8
3 changed files with 26 additions and 0 deletions

View file

@ -12,6 +12,10 @@
become: true
when: ansible_distribution in [ "AlmaLinux", "CentOS", "Rocky" ]
- role: os_deb
become: true
when: ansible_distribution in [ "Debian", "Ubuntu" ]
# Upgrade all packages and install the basic-bitch ones
- role: base_system
become: true

View file

@ -0,0 +1,4 @@
---
- name: Enable all Debian repos
ansible.builtin.include_tasks: repositories.yml
when: ansible_facts.distribution == "Debian"

View file

@ -0,0 +1,18 @@
---
- name: Disable installation DVD as a source
ansible.builtin.lineinfile:
path: /etc/apt/sources.list
regexp: "^deb cdrom:"
state: absent
- name: Enable additional repository
ansible.builtin.apt_repository:
repo: "{{ item }}"
state: present
loop:
- deb http://ftp.sk.debian.org/debian/ {{ ansible_facts.distribution_release }} contrib non-free
- deb-src http://ftp.sk.debian.org/debian/ {{ ansible_facts.distribution_release }} contrib non-free
- deb http://security.debian.org/debian-security {{ ansible_facts.distribution_release }}-security contrib non-free
- deb-src http://security.debian.org/debian-security {{ ansible_facts.distribution_release }}-security contrib non-free
- deb http://ftp.sk.debian.org/debian/ {{ ansible_facts.distribution_release }}-updates contrib non-free
- deb-src http://ftp.sk.debian.org/debian/ {{ ansible_facts.distribution_release }}-updates contrib non-free