Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.80 KB | None | 0 0
  1. ---
  2. - name: Test any errors fatal
  3.   hosts: all
  4.   any_errors_fatal: True
  5.   tasks:
  6.      - include: roles/test/tasks/main.yaml
  7. ---
  8. - set_fact:
  9.     test: "test value"
  10.   when: "inventory_hostname == groups.all.0"
  11. - shell: "echo {{ test }}"
  12. - debug:
  13.     msg: "This should never be reached"
  14.  
  15.  
  16. === DEMO ===
  17.  
  18. PLAY [Test any errors fatal] ******************************************************************************************************
  19.  
  20. TASK [Gathering Facts] ************************************************************************************************************
  21. ok: [192.168.2.247]
  22. ok: [192.168.2.248]
  23. ok: [192.168.2.249]
  24. ok: [192.168.2.245]
  25. ok: [192.168.2.246]
  26.  
  27. TASK [set_fact] *******************************************************************************************************************
  28. ok: [192.168.2.248]
  29.  
  30. TASK [command] ********************************************************************************************************************
  31. fatal: [192.168.2.249]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'test' is undefined\n\nThe error appears to have been in '/jirotech/ansible-postgresql/test_include.yaml': line 5, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  when: \"inventory_hostname == groups.all.0\"\n- shell: \"echo {{ test }}\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
  32. fatal: [192.168.2.246]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'test' is undefined\n\nThe error appears to have been in '/jirotech/ansible-postgresql/test_include.yaml': line 5, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  when: \"inventory_hostname == groups.all.0\"\n- shell: \"echo {{ test }}\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
  33. fatal: [192.168.2.245]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'test' is undefined\n\nThe error appears to have been in '/jirotech/ansible-postgresql/test_include.yaml': line 5, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  when: \"inventory_hostname == groups.all.0\"\n- shell: \"echo {{ test }}\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
  34. fatal: [192.168.2.247]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'test' is undefined\n\nThe error appears to have been in '/jirotech/ansible-postgresql/test_include.yaml': line 5, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  when: \"inventory_hostname == groups.all.0\"\n- shell: \"echo {{ test }}\"\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}
  35. changed: [192.168.2.248]
  36.  
  37. TASK [debug] **********************************************************************************************************************
  38. ok: [192.168.2.248] => {
  39.     "changed": false,
  40.     "msg": "This should never be reached"
  41. }
  42.         to retry, use: --limit @/root/.ansible-retry/test.retry
  43.  
  44. PLAY RECAP ************************************************************************************************************************
  45. 192.168.2.245              : ok=1    changed=0    unreachable=0    failed=1
  46. 192.168.2.246              : ok=1    changed=0    unreachable=0    failed=1
  47. 192.168.2.247              : ok=1    changed=0    unreachable=0    failed=1
  48. 192.168.2.248              : ok=4    changed=1    unreachable=0    failed=0
  49. 192.168.2.249              : ok=1    changed=0    unreachable=0    failed=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement