]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/init-system/tasks/apt.yml
Refactor(init-system): Install `dnsutils`
[ansible.git] / playbooks / debian / roles / init-system / tasks / apt.yml
index f08f58f369c7186bd0fff03336f54ffb38ecb1d1..0006996eeec3c1f26abee720fd01241c20ecc126 100644 (file)
@@ -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,6 +15,7 @@
     owner: root
     group: root
     mode: '0640'
+  when: apt_configured.stdout == "0"
 
 - name: Install minimal software packages
   become: true
     autoclean: yes
     autoremove: yes
     install_recommends: no
-    name: ['apt', 'aptitude', 'deborphan', 'dselect',
-           'bash', 'bash-completion',
-           'curl', 'mc', 'rsync', 'vim', 'wget',
-           'arj', 'bzip2', 'lzip', 'lzma', 'lzop', 'p7zip',
-           'unzip', 'zip', 'xz-utils',
-           'gnupg', 'gnupg2',
-           'adjtimex', 'logcheck',
-           'bsd-mailx', 'mutt', 'procmail',
-           'python', 'python2.7', 'python3',
+    name: ['adjtimex', 'apt', 'aptitude', 'arj',
+           'bash', 'bash-completion', 'bsd-mailx', 'bzip2',
+           'curl', 'deborphan', 'dnsutils', 'dselect', 'gnupg', 'gnupg2',
+           'logcheck', 'lzip', 'lzma', 'lzop', 'mc', 'mutt',
+           'p7zip', 'procmail', 'python', 'python2.7', 'python3',
+           'rsync', 'unzip', 'vim', 'wget', 'xz-utils', 'zip',
           ]
     purge: yes
     state: latest