From: Oleg Broytman Date: Sun, 28 Jul 2019 17:17:54 +0000 (+0300) Subject: Fix(init-system): Overwrite `sources.list` only if it's brand-new X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=34ee94071359b7e0e18c1365730fda2aff634fd5;p=ansible.git Fix(init-system): Overwrite `sources.list` only if it's brand-new --- diff --git a/playbooks/debian/roles/init-system/tasks/apt.yml b/playbooks/debian/roles/init-system/tasks/apt.yml index 3ea63a8..a24e44a 100644 --- a/playbooks/debian/roles/init-system/tasks/apt.yml +++ b/playbooks/debian/roles/init-system/tasks/apt.yml @@ -1,3 +1,12 @@ +- name: Check backports + shell: "grep -Fc backports /etc/apt/sources.list || :" + register: apt_configured + changed_when: apt_configured.stdout == "0" + +- debug: + msg: "apt has already been configured" + when: apt_configured.stdout != "0" + - name: Configure apt become: true template: @@ -6,7 +15,7 @@ owner: root group: root mode: '0640' - force: no + when: apt_configured.stdout == "0" - name: Install minimal software packages become: true