aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/apt
diff options
context:
space:
mode:
Diffstat (limited to 'roles/apt')
-rw-r--r--roles/apt/meta/main.yml2
-rw-r--r--roles/apt/tasks/main.yml37
2 files changed, 16 insertions, 23 deletions
diff --git a/roles/apt/meta/main.yml b/roles/apt/meta/main.yml
index 3d3d0a1..4516fa1 100644
--- a/roles/apt/meta/main.yml
+++ b/roles/apt/meta/main.yml
@@ -1,3 +1,3 @@
dependencies:
- role: common
- - role: etckeeper
+ - {role: etckeeper, when: etc_versioned}
diff --git a/roles/apt/tasks/main.yml b/roles/apt/tasks/main.yml
index f331995..d658651 100644
--- a/roles/apt/tasks/main.yml
+++ b/roles/apt/tasks/main.yml
@@ -1,26 +1,19 @@
-- name: Check if apt is installed
- command: apt-get --version
- register: apt_version
- changed_when: false
- failed_when: false
-
-- when: apt_version.rc == 0
+- name: Upgrade packages
become: true
- block:
- - name: Upgrade packages
- apt:
- update_cache: true
- upgrade: full
- notify: reboot
+ apt:
+ update_cache: true
+ upgrade: full
+ notify: reboot
- - name: Flush handlers
- meta: flush_handlers
+- name: Flush handlers
+ meta: flush_handlers
- - name: Clean up dependencies
- apt:
- autoremove: true
- purge: true
- notify: reboot
+- name: Clean up dependencies
+ become: true
+ apt:
+ autoremove: true
+ purge: true
+ notify: reboot
- - name: Flush handlers
- meta: flush_handlers
+- name: Flush handlers
+ meta: flush_handlers