blob: ff9a960243ac84686224c6e61bdeae4bb1d42992 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
---
- name: Don't install recommended packages
copy:
dest: '/etc/apt/apt.conf.d/06norecommends'
src: 06norecommends
owner: root
group: root
mode: 0644
- name: Don't start services by default
copy:
dest: '/usr/sbin/policy-rc.d'
content: "exit 101\n"
owner: root
group: root
mode: 0755
- name: Remove packages
apt:
name: '{{ item }}'
state: absent
autoremove: yes
purge: yes
with_items: "{{ apt_packages|dictsort(true)|selectattr(1,'equalto','absent')|map(attribute=0)|list }}"
tags:
- packages
- name: Configure /etc/apt/sources.list
template:
dest: '/etc/apt/sources.list'
src: sources.list.j2
owner: root
group: root
mode: 0644
when: apt_sources is defined
- name: Download repository keys
apt_key:
url: "{{ apt_repos[item.key]['key_url'] }}"
id: "{{ apt_repos[item.key]['key_id'] }}"
state: present
with_dict: '{{ apt_sources }}'
when: apt_sources is defined and 'key_url' in apt_repos[item.key]
- name: Update apt cache
apt:
update_cache: yes
tags:
- update
- packages
- name: Upgrade all packages
apt:
name: '*'
state: latest
tags:
- upgrade
- packages
- name: Install packages
apt:
name: '{{ item }}'
state: present
with_items: "{{ apt_packages|dictsort(true)|selectattr(1,'equalto','present')|map(attribute=0)|list }}"
tags:
- packages
# vim: set ts=2 sw=2 et:
|