ansible/roles/common/tasks/updates.yaml

30 lines
704 B
YAML

---
- name: update Package lists
cron:
name: update Package lists
hour: "{{ 3|random(seed=inventory_hostname+'updates') }}"
minute: "{{ 59|random(seed=inventory_hostname+'updates') }}"
job: /usr/bin/apt-get update > /dev/null
- name: generate configs for unattended Upgrades
template:
src: "{{ item }}"
dest: "/etc/apt/apt.conf.d/{{ item }}"
mode: 0644
with_items:
- 20auto-upgrades
notify: Record changes in etckeeper
- name: configs unattended upgrades
template:
src: "{{ item }}"
dest: "/etc/apt/apt.conf.d/{{ item }}"
mode: 0644
with_items:
- 50unattended-upgrades
notify: Record changes in etckeeper
when: Unattended_Upgrade == 1