diff options
Diffstat (limited to 'ansible/roles/packages')
-rw-r--r-- | ansible/roles/packages/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/packages/handlers/main.yml | 5 | ||||
-rw-r--r-- | ansible/roles/packages/tasks/main.yml | 37 |
3 files changed, 44 insertions, 0 deletions
diff --git a/ansible/roles/packages/defaults/main.yml b/ansible/roles/packages/defaults/main.yml new file mode 100644 index 0000000..82869b4 --- /dev/null +++ b/ansible/roles/packages/defaults/main.yml @@ -0,0 +1,2 @@ +packages__enable_backports: no +packages_packages: diff --git a/ansible/roles/packages/handlers/main.yml b/ansible/roles/packages/handlers/main.yml new file mode 100644 index 0000000..0298ff9 --- /dev/null +++ b/ansible/roles/packages/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: update apt cache + become: yes + apt: + update_cache: yes diff --git a/ansible/roles/packages/tasks/main.yml b/ansible/roles/packages/tasks/main.yml new file mode 100644 index 0000000..45f64c3 --- /dev/null +++ b/ansible/roles/packages/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- name: configure debian repositories + tags: packages + notify: update apt cache + become: yes + copy: + dest: /etc/apt/sources.list + content: | + 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 + +- 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 + +- name: install debian packages + tags: packages + become: yes + apt: + name: "{{ packages_packages }}" + install_recommends: no |