feat(os_deb): create role for setting apt repos
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
2d008e1eca
commit
7e1d9a7fc3
3 changed files with 26 additions and 0 deletions
|
@ -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
|
||||
|
|
4
roles/os_deb/tasks/main.yml
Normal file
4
roles/os_deb/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
- name: Enable all Debian repos
|
||||
ansible.builtin.include_tasks: repositories.yml
|
||||
when: ansible_facts.distribution == "Debian"
|
18
roles/os_deb/tasks/repositories.yml
Normal file
18
roles/os_deb/tasks/repositories.yml
Normal 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
|
Loading…
Reference in a new issue