--- # A hung apt-daily.service (a stuck mirror, a dpkg lock that never frees) blocks the next apt run on the host for as long as systemd lets # it start. A drop-in bounds the start. Only apt-daily.service: apt-daily-upgrade.service is left to its own timeout. - name: Ensure the apt-daily drop-in directory exists become: true ansible.builtin.file: path: /etc/systemd/system/apt-daily.service.d state: directory owner: root group: root mode: "0755" - name: Bound the start of apt-daily.service become: true ansible.builtin.copy: dest: /etc/systemd/system/apt-daily.service.d/10-timeout.conf content: | # Managed by Ansible (role system_baseline). [Service] TimeoutStartSec={{ system_baseline_apt_daily_timeout }} owner: root group: root mode: "0644" notify: Reload systemd for apt-daily timeout