Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #17 from Yannik/patch-1
Browse files Browse the repository at this point in the history
Ensure `unattended` tag is set on all tasks (fixes #16)
  • Loading branch information
jnv committed Feb 17, 2016
2 parents 83be977 + 8d73b7b commit 9009e00
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
26 changes: 2 additions & 24 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,2 @@
---
- name: add distribution-specific variables
include_vars: "{{ ansible_distribution }}.yml"

- name: install unattended-upgrades
apt: pkg=unattended-upgrades state=present
tags: unattended

- name: install reboot dependencies
include: reboot.yml
when: unattended_automatic_reboot
tags: unattended

- name: create APT auto-upgrades configuration
copy: >
src=auto-upgrades dest=/etc/apt/apt.conf.d/20auto-upgrades
owner=root group=root mode=0644
tags: unattended

- name: create unattended-upgrades configuration
template: >
src=unattended-upgrades.j2 dest=/etc/apt/apt.conf.d/50unattended-upgrades
owner=root group=root mode=0644
tags: unattended
- include: unattended-upgrades.yml
tags: unattended
2 changes: 0 additions & 2 deletions tasks/reboot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
apt: pkg=update-notifier-common state=present
register: install_reboot_dependency
ignore_errors: true
tags: unattended

- name: abort if automatic reboot is unavailable
fail: msg="The unattended_automatic_reboot option was selected but the system has no means to reboot automatically"
when: install_reboot_dependency | failed
tags: unattended

20 changes: 20 additions & 0 deletions tasks/unattended-upgrades.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: add distribution-specific variables
include_vars: "{{ ansible_distribution }}.yml"

- name: install unattended-upgrades
apt: pkg=unattended-upgrades state=present

- name: install reboot dependencies
include: reboot.yml
when: unattended_automatic_reboot

- name: create APT auto-upgrades configuration
copy: >
src=auto-upgrades dest=/etc/apt/apt.conf.d/20auto-upgrades
owner=root group=root mode=0644
- name: create unattended-upgrades configuration
template: >
src=unattended-upgrades.j2 dest=/etc/apt/apt.conf.d/50unattended-upgrades
owner=root group=root mode=0644

0 comments on commit 9009e00

Please sign in to comment.