PageRenderTime 14ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/test/integration/roles/test_failed_when/tasks/main.yml

https://github.com/ajanthanm/ansible
YAML | 28 lines | 9 code | 3 blank | 16 comment | 0 complexity | 7184caeda0547592836872baf8f8300a MD5 | raw file
 1# Test code for failed_when.
 2# (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.com>
 3
 4# This file is part of Ansible
 5#
 6# Ansible is free software: you can redistribute it and/or modify
 7# it under the terms of the GNU General Public License as published by
 8# the Free Software Foundation, either version 3 of the License, or
 9# (at your option) any later version.
10#
11# Ansible is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Ansible.  If not, see <http://www.gnu.org/licenses/>.
18
19- name: Test failed_when behavior but catch it.
20  command: /bin/true
21  failed_when: 2 != 3
22  register: failed
23  ignore_errors: True
24
25- name: Assert that failed_when is true.
26  assert:
27    that:
28      - "failed.failed_when_result == True"