Skip to content

Instantly share code, notes, and snippets.

@BBB
Created January 28, 2014 15:40
Show Gist options
  • Save BBB/8669932 to your computer and use it in GitHub Desktop.
Save BBB/8669932 to your computer and use it in GitHub Desktop.
Ansible Jinja Error
- name: Push the conf
template: src=./templates/conf.json.j2 dest=~/conf.json.j2 owner=$ansible_ssh_user mode=0600
#jinja2:variable_start_string:'[%' , variable_end_string:'%]'
{
"key": [
{
"path": "[% hostname %]/{{ timestamp }}-{{ filename }}"
}
]
}
fatal: [<IP>] => Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 394, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 485, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/__init__.py", line 685, in _executor_internal_inner
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
File "/usr/local/lib/python2.7/site-packages/ansible/runner/action_plugins/template.py", line 91, in run
local_md5 = utils.md5s(resultant)
File "/usr/local/lib/python2.7/site-packages/ansible/utils/__init__.py", line 523, in md5s
digest.update(data)
TypeError: must be string or buffer, not dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment