aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/apt/tasks/main.yml
blob: be4ab8ecaa683d72568c400346707a3dc134d37c (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
- name: Upgrade packages
  become: true
  ansible.builtin.apt:
    install_recommends: false
    update_cache: true
    upgrade: dist
  notify: apt_reboot

- name: Reboot if necessary
  ansible.builtin.meta: flush_handlers

- name: Clean up dependencies
  become: true
  ansible.builtin.apt:
    autoremove: true
    purge: true
  notify: apt_reboot

- name: Reboot if necessary
  ansible.builtin.meta: flush_handlers

- name: Install extra packages
  become: true
  ansible.builtin.apt:
    install_recommends: false
    name: '{{ apt_extra_packages }}'
    state: present

- name: Configure unattended-upgrades
  ansible.builtin.include_tasks: unattended_upgrades.yml
  when: apt_unattended