]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/init-system/tasks/apt.yml
Feat(init-system): Install `apt-transport-https` for Debian 9
[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', 'apt-transport-https', '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            'rsync', 'unzip', 'vim', 'wget', 'xz-utils', 'zip',
33           ]
34     purge: yes
35     state: latest
36     update_cache: yes
37
38 - name: Purge uninteresting packages
39   become: true
40   apt:
41     autoclean: yes
42     autoremove: yes
43     install_recommends: no
44     name: ['avahi-autoip', 'bluetooth', 'bluez',
45            'debian-faq', 'doc-debian',
46            'emacsen-comm', 'vim-tiny',
47           ]
48     purge: yes
49     state: absent
50     update_cache: no
51
52 - name: Configure apt key for deb-multimedia
53   become: true
54   apt_key:
55     keyserver: keyserver.ubuntu.com
56     id: 5C808C2B65558117
57   when: "inventory_hostname in ('localhost', 'iskra-aviel.phdru.name')"