From e36ed01727a9f6f4debbe00a97c2dcac0122c7da Mon Sep 17 00:00:00 2001 From: Lilian Roller Date: Mon, 29 Jul 2019 08:57:58 +0200 Subject: [PATCH] Add option: contrib pkgs --- defaults/main.yml | 3 +++ tasks/sources.yml | 28 ++++++++++++++++++++++++++++ vars/main.yml | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index ae33ddd..b6b322e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,5 +19,8 @@ print_os_vars: false # do we want non-free firmware from eth zuerich? base_pkg_non_free_firmware: false +# do we want contrib from eth zuerich? +base_pkg_contrib: false + # version management submodules_versioncheck: true diff --git a/tasks/sources.yml b/tasks/sources.yml index 3f6b4fa..e80d049 100644 --- a/tasks/sources.yml +++ b/tasks/sources.yml @@ -20,6 +20,7 @@ state: present when: - not base_pkg_non_free_firmware | bool + - not base_pkg_contrib | bool - add_ethz | bool - ansible_distribution == 'Debian' - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' @@ -31,6 +32,7 @@ state: absent when: - not base_pkg_non_free_firmware | bool + - not base_pkg_contrib | bool - not add_ethz | bool - ansible_distribution == 'Debian' - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' @@ -42,6 +44,7 @@ state: present when: - base_pkg_non_free_firmware | bool + - not base_pkg_contrib | bool - add_ethz | bool - ansible_distribution == 'Debian' - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' @@ -53,6 +56,31 @@ state: absent when: - base_pkg_non_free_firmware | bool + - not base_pkg_contrib | bool + - not add_ethz | bool + - ansible_distribution == 'Debian' + - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' + +- name: add eth zurich apt + contrib + non-free + become: true + apt_repository: + repo: deb-src https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main contrib non-free + state: present + when: + - base_pkg_non_free_firmware | bool + - base_pkg_contrib | bool + - add_ethz | bool + - ansible_distribution == 'Debian' + - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' + +- name: remove eth zurich apt + contrib + non-free + become: true + apt_repository: + repo: deb-src https://debian.ethz.ch/debian/ {{ ansible_distribution_release }} main contrib non-free + state: absent + when: + - base_pkg_non_free_firmware | bool + - base_pkg_contrib | bool - not add_ethz | bool - ansible_distribution == 'Debian' - ansible_machine != 'armv6l' and ansible_distribution_release != 'wheezy' diff --git a/vars/main.yml b/vars/main.yml index 5a15a42..f902eed 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -50,5 +50,5 @@ fedora_packages: - python3-pip - python3 -playbook_version_number: 8970 # should be over ninethousand +playbook_version_number: 8971 # should be over ninethousand playbook_version_path: '/etc/ansible-version/base-packages_ffbsee_or_chaos-bodensee_github.version'