Ansible/roles/jnv.unattended-upgrades/tasks/unattended-upgrades.yml
James Tombleson 9eabb48d1c Update unattended-upgrades.yml
Added become lines given it needed permissions to run the operation but failed to do so.  I think the role is older and you use to be able to elevate permissions from playbook.
2019-05-02 07:42:47 -07:00

38 lines
991 B
YAML

---
- name: add distribution-specific variables
include_vars: "{{ ansible_distribution }}.yml"
- name: add Debian Wheezy workaround
include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
when: (ansible_distribution == "Debian") and (ansible_distribution_release == "wheezy")
- name: install unattended-upgrades
become: true
apt:
pkg: unattended-upgrades
state: present
cache_valid_time: "{{unattended_cache_valid_time}}"
update_cache: yes
- name: install reboot dependencies
include: reboot.yml
when: unattended_automatic_reboot
- name: create APT auto-upgrades configuration
become: true
template:
src: auto-upgrades.j2
dest: /etc/apt/apt.conf.d/20auto-upgrades
owner: root
group: root
mode: 0644
- name: create unattended-upgrades configuration
become: true
template:
src: unattended-upgrades.j2
dest: /etc/apt/apt.conf.d/50unattended-upgrades
owner: root
group: root
mode: 0644