run task only if file exists

This commit is contained in:
Alexander Grothe 2017-11-22 11:37:20 +01:00
parent 748df6954e
commit 19a1f98d74
2 changed files with 13 additions and 0 deletions

View File

@ -482,6 +482,10 @@ yavdr-common executes the following tasks:
#+END_SRC #+END_SRC
***** Disable release-upgrade notifications ***** 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 #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes
- name: disable release-upgrade notifications - name: disable release-upgrade notifications
lineinfile: lineinfile:
@ -491,6 +495,11 @@ yavdr-common executes the following tasks:
regexp: '^(Prompt=).*$' regexp: '^(Prompt=).*$'
line: '\1never' line: '\1never'
ignore_errors: yes ignore_errors: yes
with_first_found:
- files:
- /etc/update-manager/release-upgrades
skip: true
#+END_SRC #+END_SRC
***** Install essential packages ***** Install essential packages
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes

View File

@ -25,6 +25,10 @@
regexp: '^(Prompt=).*$' regexp: '^(Prompt=).*$'
line: '\1never' line: '\1never'
ignore_errors: yes ignore_errors: yes
with_first_found:
- files:
- /etc/update-manager/release-upgrades
skip: true
- name: apt | install basic packages - name: apt | install basic packages
apt: apt:
name: '{{ item }}' name: '{{ item }}'