|
|
@ -100,10 +100,6 @@
|
|
|
|
shell: which bash
|
|
|
|
shell: which bash
|
|
|
|
register: bash
|
|
|
|
register: bash
|
|
|
|
|
|
|
|
|
|
|
|
- name: locate sha1sum/shasum
|
|
|
|
|
|
|
|
shell: which sha1sum || which shasum
|
|
|
|
|
|
|
|
register: sha1sum
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## command
|
|
|
|
## command
|
|
|
|
##
|
|
|
|
##
|
|
|
@ -196,7 +192,7 @@
|
|
|
|
- "command_result5.stdout == 'foobar'"
|
|
|
|
- "command_result5.stdout == 'foobar'"
|
|
|
|
|
|
|
|
|
|
|
|
- name: send to stdin literal multiline block
|
|
|
|
- name: send to stdin literal multiline block
|
|
|
|
command: "{{ sha1sum.stdout }}"
|
|
|
|
command: "{{ ansible_python_interpreter }} -c 'import hashlib, sys; print(hashlib.sha1((sys.stdin.buffer if hasattr(sys.stdin, \"buffer\") else sys.stdin).read()).hexdigest())'"
|
|
|
|
args:
|
|
|
|
args:
|
|
|
|
stdin: |-
|
|
|
|
stdin: |-
|
|
|
|
this is the first line
|
|
|
|
this is the first line
|
|
|
@ -209,7 +205,7 @@
|
|
|
|
- name: assert the multiline input was passed correctly
|
|
|
|
- name: assert the multiline input was passed correctly
|
|
|
|
assert:
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- "command_result6.stdout == '9cd0697c6a9ff6689f0afb9136fa62e0b3fee903 -'"
|
|
|
|
- "command_result6.stdout == '9cd0697c6a9ff6689f0afb9136fa62e0b3fee903'"
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
##
|
|
|
|
## shell
|
|
|
|
## shell
|
|
|
@ -278,9 +274,7 @@
|
|
|
|
"multiline echo" \
|
|
|
|
"multiline echo" \
|
|
|
|
"with a new line
|
|
|
|
"with a new line
|
|
|
|
in quotes" \
|
|
|
|
in quotes" \
|
|
|
|
| {{ sha1sum.stdout }} \
|
|
|
|
| {{ ansible_python_interpreter }} -c 'import hashlib, sys; print(hashlib.sha1((sys.stdin.buffer if hasattr(sys.stdin, "buffer") else sys.stdin).read()).hexdigest())'
|
|
|
|
| tr -s ' ' \
|
|
|
|
|
|
|
|
| cut -f1 -d ' '
|
|
|
|
|
|
|
|
echo "this is a second line"
|
|
|
|
echo "this is a second line"
|
|
|
|
register: shell_result5
|
|
|
|
register: shell_result5
|
|
|
|
|
|
|
|
|
|
|
|