]> git.phdru.name Git - ansible.git/blobdiff - playbooks/debian/roles/init-system/tasks/apt.yml
Feat(apt): Remove option `purge`
[ansible.git] / playbooks / debian / roles / init-system / tasks / apt.yml
index bc6c8ed36a2abc0c023eb9e8fff1e4db1a08fe01..21732299efd3094fa2811374d620d24a12930c47 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: ['apt', 'apt-transport-https', 'aptitude',
+           'bash', 'bash-completion', 'bzip2',
+           'curl', 'deborphan', 'dnsutils', 'dselect',
+           'gnupg', 'gnupg2', 'logcheck', 'mc', 'mutt',
+           'procmail', 'rsync', 'unzip', 'vim', 'wget', 'zip',
           ]
-    purge: yes
     state: latest
     update_cache: yes
 
@@ -41,7 +46,6 @@
     state: absent
     update_cache: no
 
-
 - name: Configure apt key for deb-multimedia
   become: true
   apt_key: