Skip to content

Instantly share code, notes, and snippets.

@pichuang
Last active February 25, 2021 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pichuang/b4625fd95d9dc63e417f8c411ab9e33a to your computer and use it in GitHub Desktop.
Save pichuang/b4625fd95d9dc63e417f8c411ab9e33a to your computer and use it in GitHub Desktop.
PLAY [localhost] ***************************************************************
TASK [Test Case 1] *************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? smallplane"
}
TASK [Test Case 2] *************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? smallplane"
}
TASK [Test Case 3] *************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? 'smallplane'"
}
TASK [Test Case 4] *************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? \"smallplane\""
}
TASK [Test Case 5 - Failed case] ***********************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? smallplane"
}
TASK [Test Case 6 - Failed case] ***********************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? smallplane"
}
TASK [Test Case 7] *************************************************************
changed: [localhost]
TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "who is handsome man? smallplane"
}
PLAY RECAP *********************************************************************
localhost : ok=14 changed=7 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
---
- hosts: localhost
gather_facts: no
vars:
string_testing: "smallplane"
tasks:
- name: Test Case 1
command:
cmd: echo "who is handsome man? {{ string_testing }}"
register: case1_result
- debug:
msg: "{{ case1_result.stdout }}"
- name: Test Case 2
command:
cmd: "echo 'who is handsome man? {{ string_testing }}'"
register: case2_result
- debug:
msg: "{{ case2_result.stdout }}"
- name: Test Case 3
command:
cmd: echo "who is handsome man? '{{ string_testing }}'"
register: case3_result
- debug:
msg: "{{ case3_result.stdout }}"
- name: Test Case 4
command:
cmd: echo 'who is handsome man? "{{ string_testing }}"'
register: case4_result
- debug:
msg: "{{ case4_result.stdout }}"
- name: Test Case 5 - Failed case
command:
cmd: echo 'who is handsome man? '{{ string_testing }}''
register: case5_result
- debug:
msg: "{{ case5_result.stdout }}"
- name: Test Case 6 - Failed case
command:
cmd: echo "who is handsome man? "{{ string_testing }}""
register: case6_result
- debug:
msg: "{{ case6_result.stdout }}"
- name: Test Case 7
command:
cmd: 'echo "who is handsome man? {{ string_testing }}"'
register: case7_result
- debug:
msg: "{{ case7_result.stdout }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment