From aafd08bab7921528b32c38fdc9a542f8b1bfbd6e Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 20 Feb 2014 13:45:15 -0500 Subject: [PATCH] Add a test for the ignore_errors keyword. --- tests_new/integration/non_destructive.yml | 1 + .../roles/test_ignore_errors/tasks/main.yml | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests_new/integration/roles/test_ignore_errors/tasks/main.yml diff --git a/tests_new/integration/non_destructive.yml b/tests_new/integration/non_destructive.yml index b6ec905ce0..3efa5173bb 100644 --- a/tests_new/integration/non_destructive.yml +++ b/tests_new/integration/non_destructive.yml @@ -22,4 +22,5 @@ - { role: test_changed_when, tags: test_changed_when } - { role: test_var_blending, parameterized_beats_default: 1234, tags: test_var_blending } - { role: test_lineinfile, tags: test_lineinfile } + - { role: test_ignore_errors, tags: test_ignore_errors } diff --git a/tests_new/integration/roles/test_ignore_errors/tasks/main.yml b/tests_new/integration/roles/test_ignore_errors/tasks/main.yml new file mode 100644 index 0000000000..e0d6ae2f16 --- /dev/null +++ b/tests_new/integration/roles/test_ignore_errors/tasks/main.yml @@ -0,0 +1,23 @@ +# test code +# (c) 2014, Michael DeHaan + +# This file is part of Ansible +# +# Ansible is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Ansible is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Ansible. If not, see . + +- name: this will not stop the playbook + shell: /bin/false + register: failed + ignore_errors: True +