]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/init-system/tasks/apt.yml
83879f4ab68a4c07699df939a226fa301a5b4fa8
[ansible.git] / playbooks / debian / roles / init-system / tasks / apt.yml
1 - name: Check backports
2   shell: "grep -Fc backports /etc/apt/sources.list || :"
3   register: apt_configured
4   changed_when: apt_configured.stdout == "0"
5
6 - debug:
7     msg: "apt has already been configured"
8   when: apt_configured.stdout != "0"
9
10 - name: Configure apt
11   become: true
12   template:
13     src: sources.list
14     dest: /etc/apt/sources.list
15     owner: root
16     group: root
17     mode: '0640'
18   when: apt_configured.stdout == "0"
19
20 - name: Install minimal software packages
21   become: true
22   apt:
23     autoclean: yes
24     autoremove: yes
25     install_recommends: no
26     name: ['adjtimex', 'apt', 'aptitude', 'arj',
27            'bash', 'bash-completion', 'bsd-mailx', 'bzip2',
28            'curl', 'deborphan', 'dnsutils', 'dselect', 'elinks',
29            'fetchmail', 'gnupg', 'gnupg2', 'links2',
30            'logcheck', 'lzip', 'lzma', 'lzop', 'mc', 'mutt',
31            'p7zip', 'procmail',
32            'python', 'python2.7', 'python3', 'python-pip', 'python3-pip',
33            'rsync', 'unzip', 'vim', 'wget', 'xz-utils', 'zip',
34           ]
35     purge: yes
36     state: latest
37     update_cache: yes
38
39 - name: Purge uninteresting packages
40   become: true
41   apt:
42     autoclean: yes
43     autoremove: yes
44     install_recommends: no
45     name: ['avahi-autoip', 'bluetooth', 'bluez',
46            'debian-faq', 'doc-debian',
47            'emacsen-comm', 'vim-tiny',
48           ]
49     purge: yes
50     state: absent
51     update_cache: no
52
53 - name: Configure apt key for deb-multimedia
54   become: true
55   apt_key:
56     keyserver: keyserver.ubuntu.com
57     id: 5C808C2B65558117
58   when: "inventory_hostname in ('localhost', 'iskra-aviel.phdru.name')"