diff --git a/roles/configure-mirrors/templates/apt/etc/apt/sources.list.j2 b/roles/configure-mirrors/templates/apt/etc/apt/sources.list.j2 index 2d6444aaa..de4073d58 100644 --- a/roles/configure-mirrors/templates/apt/etc/apt/sources.list.j2 +++ b/roles/configure-mirrors/templates/apt/etc/apt/sources.list.j2 @@ -1,3 +1,4 @@ +#jinja2: trim_blocks:False # {{ ansible_managed }} deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }} main universe deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }}-updates main universe diff --git a/test-playbooks/base-roles/configure-mirrors.yaml b/test-playbooks/base-roles/configure-mirrors.yaml index 114ad5a2d..cd26a9562 100644 --- a/test-playbooks/base-roles/configure-mirrors.yaml +++ b/test-playbooks/base-roles/configure-mirrors.yaml @@ -37,3 +37,19 @@ name: "{{ emacs_package | default('emacs') }}" state: "present" become: yes + +- name: Ensure no apt warnings + hosts: all + tasks: + - name: Check apt output + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' + block: + - name: Run apt-get update + command: 'apt-get update' + register: _apt_get_output + become: yes + + - name: Check for warnings in output + fail: + msg: 'Warnings found in apt output' + when: _apt_get_output is regex('^W:.*$')