--- - name: configure debian repositories tags: packages notify: update apt cache copy: dest: /etc/apt/sources.list content: "{{ versions[packages__version] }}" vars: versions: stretch: | deb http://ftp.no.debian.org/debian/ stretch main contrib non-free deb-src http://ftp.no.debian.org/debian/ stretch main contrib non-free deb http://security.debian.org/debian-security stretch/updates main contrib non-free deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free deb http://ftp.no.debian.org/debian/ stretch-updates main contrib non-free deb-src http://ftp.no.debian.org/debian/ stretch-updates main contrib non-free {{ '' if packages__enable_backports else '#' }}deb http://ftp.no.debian.org/debian/ stretch-backports main contrib non-free {{ '' if packages__enable_backports else '#' }}deb-src http://ftp.no.debian.org/debian/ stretch-backports main contrib non-free jessie: | deb http://ftp.no.debian.org/debian/ jessie main contrib non-free deb-src http://ftp.no.debian.org/debian/ jessie main contrib non-free deb http://security.debian.org/debian-security jessie/updates main contrib non-free deb-src http://security.debian.org/debian-security jessie/updates main contrib non-free deb http://ftp.no.debian.org/debian/ jessie-updates main contrib non-free deb-src http://ftp.no.debian.org/debian/ jessie-updates main contrib non-free {{ '' if packages__enable_backports else '#' }}deb http://ftp.no.debian.org/debian/ jessie-backports main contrib non-free {{ '' if packages__enable_backports else '#' }}deb-src http://ftp.no.debian.org/debian/ jessie-backports main contrib non-free unstable: | deb http://ftp.no.debian.org/debian/ unstable main contrib non-free deb-src http://ftp.no.debian.org/debian/ unstable main contrib non-free sid: | deb http://ftp.no.debian.org/debian/ sid main contrib non-free deb-src http://ftp.no.debian.org/debian/ sid main contrib non-free - name: Enable backports repository by default when: packages__enable_backports copy: dest: /etc/apt/preferences.d/bitraf-packages content: | Package: * Pin: release a=stretch-backports Pin-Priority: 500 - meta: flush_handlers - debug: var=packages_packages - name: install debian packages apt: name: "{{ packages_packages }}" install_recommends: no