Advertisement
jgilfoil

Conditional Variable check failure ansible

Jul 27th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.52 KB | None | 0 0
  1.  - name: register git hash
  2.     local_action: git
  3.     args:
  4.       repo: /etc/ansible
  5.       dest: /etc/ansible
  6.       update: no
  7.     register: git_commit_result
  8.  
  9.   - name: create deployment_version_history.log
  10.     file:
  11.       path: /app/psoft/install_logs/deployment_version_history.log
  12.       state: touch
  13.  
  14.   - name: get last log entry
  15.     shell : tail -1 /app/psoft/install_logs/deployment_version_history.log
  16.     register: version_log_result
  17.     changed_when: false
  18.  
  19.   - name: write commit to history
  20.     shell: echo "{{ git_commit_result.after }} peoplesoft.yml" >> /app/psoft/install_logs/deployment_version_history.log
  21.     when: '{{ version_log_result.stdout }} != {{ git_commit_result.after + " peoplesoft.yml" }}'
  22.  
  23.  
  24. output:
  25. TASK [write commit to history] *************************************************
  26. task path: /etc/ansible/peoplesoft.yml:117
  27. fatal: [net12204]: FAILED! => {"failed": true, "msg": "The conditional check '{{ version_log_result.stdout }} != {{ git_commit_result.after + \" peoplesoft.yml\" }}' failed. The error was: template error while templating string: unexpected char u'a' at 8. String: {% if 62ab24b0f5cafa8bf46b20a9ca031e896e994424 peoplesoft.yml != 62ab24b0f5cafa8bf46b20a9ca031e896e994424 peoplesoft.yml %} True {% else %} False {% endif %}\n\nThe error appears to have been in '/etc/ansible/peoplesoft.yml': line 117, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: write commit to history\n    ^ here\n"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement