diff --git a/roles/no-snap/files/etc/apt/preferences.d/no-snap b/roles/no-snap/files/etc/apt/preferences.d/no-snap new file mode 100644 index 0000000..08b8715 --- /dev/null +++ b/roles/no-snap/files/etc/apt/preferences.d/no-snap @@ -0,0 +1,6 @@ +# To prevent repository packages from triggering the installation of snap, +# this file forbids snapd from being installed by APT. + +Package: snapd +Pin: release a=* +Pin-Priority: -10 diff --git a/roles/no-snap/tasks/main.yml b/roles/no-snap/tasks/main.yml new file mode 100644 index 0000000..ef7cf0e --- /dev/null +++ b/roles/no-snap/tasks/main.yml @@ -0,0 +1,14 @@ +- name: remove snap + become: yes + apt: + state: absent + purge: yes + pkg: + - snapd + +- name: Forbid apt to install snap + become: yes + copy: + src: etc/apt/preferences.d/no-snap + dest: /etc/apt/preferences.d/no-snap + mode: '0644'