Fix literal block multiline parsing

Fixes #8394
This commit is contained in:
James Cammarata
2014-08-04 09:31:30 -05:00
parent 07bb7e5a3b
commit af0d8cda7b
4 changed files with 102 additions and 46 deletions

View File

@@ -168,3 +168,23 @@
assert:
that:
- "shell_result4.changed == False"
- name: execute a shell command using a literal multiline block
shell: |
echo this is a
"multiline echo"
"with a new line
in quotes"
| md5sum
| tr -s ' '
| cut -f1 -d ' '
register: shell_result5
- debug: var=shell_result5
- name: assert the multiline shell command ran as expected
assert:
that:
- "shell_result5.changed"
- "shell_result5.stdout == '32f3cc201b69ed8afa3902b80f554ca8'"

View File

@@ -158,4 +158,25 @@
- name: assert that the directory was not changed
assert:
that:
- "not copy_result5|changed"
- "not copy_result5|changed"
# issue 8394
- name: create a file with content and a literal multiline block
copy: |
content='this is the first line
this is the second line
this line is after an empty line
this line is the last line
'
dest={{output_dir}}/multiline.txt
register: copy_result6
- debug: var=copy_result6
- name: assert the multiline file was created correctly
assert:
that:
- "copy_result6.changed"
- "copy_result6.dest == '{{output_dir|expanduser}}/multiline.txt'"
- "copy_result6.md5sum == '1627d51e7e607c92cf1a502bf0c6cce3'"