From 9932bc76bb05a6c0dae2e9ce5bc2af440eaa3bb3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Jan 2018 03:31:51 +0100 Subject: use specific version of kubernetes and docker-ce --- roles/upgrade/tasks/main.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'roles/upgrade/tasks/main.yaml') diff --git a/roles/upgrade/tasks/main.yaml b/roles/upgrade/tasks/main.yaml index 60a921b7..df7360de 100644 --- a/roles/upgrade/tasks/main.yaml +++ b/roles/upgrade/tasks/main.yaml @@ -4,7 +4,8 @@ update_cache: yes - name: List packages to upgrade (1/2) - command: aptitude -q -F%p --disable-columns search "~U" + command: aptitude -q -F%p --disable-columns search '~U !~ahold' + check_mode: no register: updates changed_when: False failed_when: updates.rc != 0 and updates.rc != 1 @@ -16,10 +17,11 @@ - name: Upgrade packages apt: - upgrade: safe + upgrade: safe - name: List services to restart (1/2) shell: checkrestart | grep ^service | awk '{print $2}' + check_mode: no register: services changed_when: False @@ -28,11 +30,7 @@ msg: "{{ services.stdout_lines | count }} services to restart ({{ services.stdout_lines | join (', ') }})" when: services.stdout_lines -- name: clean apt-cache - command: apt-get clean - args: - warn: False - -- name: remove stale packages +- name: clean apt-cache and remove stale packages apt: + autoclean: yes autoremove: yes -- cgit v1.2.3