aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/apt/tasks/main.yml
blob: e24430ff1c9bfb4d90ddc3787d1f44448bcc52f8 (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
- name: Upgrade packages
  become: true
  ansible.builtin.apt:
    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

- name: Install packages
  become: true
  ansible.builtin.package:
    name: '{{ apt_packages }}'
    state: present
  when: apt_packages | length > 0

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