PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

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

https://github.com/ajanthanm/ansible
YAML | 29 lines | 10 code | 3 blank | 16 comment | 0 complexity | a98d85cf04efcbd047e2bec1abc86395 MD5 | raw file
 1# test code for the always_run option
 2# (c) 2014, James Cammarata <jcammarata@ansible.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: run a command while in check mode
20  shell: echo "running"
21  always_run: yes
22  register: result
23
24- name: assert that the command was run
25  assert:
26    that:
27    - "result.changed == true"
28    - "result.stdout == 'running'"
29    - "result.rc == 0"