kayobe/ansible/roles/apt/tasks/repos.yml
Michal Nasiadka ebf8cfca62 Add support for Ubuntu Jammy Jellyfish (22.04) LTS
Co-Authored-By: Bartosz Bezak <bartosz@stackhpc.com>

Change-Id: I06a3e9922cf95979f3bca120cd82633046270fa3
2022-07-29 11:26:58 +02:00

33 lines
812 B
YAML

---
- name: Ensure the Apt sources.list.d directory exists
file:
path: "/etc/apt/sources.list.d"
state: directory
owner: root
group: root
mode: 0755
become: true
# NOTE(mgoddard): Use the modern deb822 repository format rather than the old
# format used by the apt_repository module.
- name: Configure apt repositories
template:
src: "kayobe.sources.j2"
dest: "/etc/apt/sources.list.d/kayobe.sources"
owner: root
group: root
mode: 0644
become: true
notify:
- Update apt cache
- name: Disable repositories in /etc/apt/sources.list
replace:
# Make a backup, in case we end up with a broken configuration.
backup: true
path: /etc/apt/sources.list
regexp: '^(deb.*)'
replace: '# \1'
when: apt_disable_sources_list | bool
become: true