From 3c35a04fc7c4c6a6828d77aa6438edeac97131b3 Mon Sep 17 00:00:00 2001 From: cmcconomy Date: Thu, 10 Nov 2016 22:51:11 -0500 Subject: [PATCH] Separate out apt cache updating This makes the 'changed=1' return flag clearer when re-running this role on a server. --- tasks/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c518122..7eb8054 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -31,10 +31,14 @@ template: src: etc/apt/preferences.d/deb_nodesource_com_node.pref.2 dest: /etc/apt/preferences.d/deb_nodesource_com_node.pref - + +- name: Update apt cache (if the last one is more than 3600 seconds ago) + apt: + update_cache: yes + cache_valid_time: 3600 + - name: Install Node.js apt: pkg: - nodejs state: installed - update_cache: yes