From 19a1f98d74f0b715341733699d422c43e9e0811b Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Wed, 22 Nov 2017 11:37:20 +0100 Subject: [PATCH] run task only if file exists --- Manual.org | 9 +++++++++ roles/yavdr-common/tasks/configure_system.yml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/Manual.org b/Manual.org index a4086b5..876e26c 100644 --- a/Manual.org +++ b/Manual.org @@ -482,6 +482,10 @@ yavdr-common executes the following tasks: #+END_SRC ***** Disable release-upgrade notifications +****** SOMEDAY move from lineinfile to template +:LOGBOOK: +- State "SOMEDAY" from "TODO" [2017-11-22 Mi 10:59] +:END: #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes - name: disable release-upgrade notifications lineinfile: @@ -491,6 +495,11 @@ yavdr-common executes the following tasks: regexp: '^(Prompt=).*$' line: '\1never' ignore_errors: yes + with_first_found: + - files: + - /etc/update-manager/release-upgrades + skip: true + #+END_SRC ***** Install essential packages #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes diff --git a/roles/yavdr-common/tasks/configure_system.yml b/roles/yavdr-common/tasks/configure_system.yml index 9e013e4..caf37f6 100644 --- a/roles/yavdr-common/tasks/configure_system.yml +++ b/roles/yavdr-common/tasks/configure_system.yml @@ -25,6 +25,10 @@ regexp: '^(Prompt=).*$' line: '\1never' ignore_errors: yes + with_first_found: + - files: + - /etc/update-manager/release-upgrades + skip: true - name: apt | install basic packages apt: name: '{{ item }}'