PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://github.com/ajanthanm/ansible
YAML | 42 lines | 13 code | 10 blank | 19 comment | 0 complexity | 83a48dacf3559b406dd4326431d58a14 MD5 | raw file
 1# test code for the pip module
 2# (c) 2014, Michael DeHaan <michael.dehaan@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: create a file that we can use to fetch
20  copy: content="test" dest={{ output_dir }}/orig
21
22- name: fetch the motd
23  fetch: src={{ output_dir }}/orig dest={{ output_dir }}/fetched
24  register: fetched
25
26- debug: var=fetched
27
28# TODO: check the sudo and non-sudo forms of fetch because in one form we'll do
29# the get method of the connection plugin and in the sudo case we'll use the
30# fetch module.
31
32- name: diff what we fetched with the original file
33  shell: diff {{ output_dir }}/orig {{ output_dir }}/fetched/127.0.0.1{{ output_dir | expanduser }}/orig
34  register: diff
35
36- name: check the diff to make sure they are the same
37  assert:
38    that:
39      'diff.stdout == ""'
40
41 
42