Brian, thanks for cooperation. I already tried without the from_json filter, but no success:
`
- hosts: tag_v3_elasticsearch_prod_True
vars:
- ansible_ssh_private_key_file: “{{ ec2_tag_ssh.ssh_key }}”
- ansible_ssh_port: “{{ ec2_tag_ssh.ssh_port }}”
- ansible_ssh_user: “{{ ec2_tag_ssh.ssh_user }}”
tasks:
- debug: var=ansible_ssh_private_key_file
- debug: var=ansible_ssh_port
- debug: var=ansible_ssh_user
`
`
PLAY [tag_v3_elasticsearch_prod_True] *****************************************
GATHERING FACTS ***************************************************************
fatal: [x.x.x.xxx
] => Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 582, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File “/usr/local/lib/python2.7/dist-packages/ansible/runner/init.py”, line 785, 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/dist-packages/ansible/runner/init.py”, line 885, in _executor_internal_inner
actual_private_key_file = template.template(self.basedir, actual_private_key_file, inject, fail_on_undefined=True)
File “/usr/local/lib/python2.7/dist-packages/ansible/utils/template.py”, line 122, in template
varname = template_from_string(basedir, varname, templatevars, fail_on_undefined)
File “/usr/local/lib/python2.7/dist-packages/ansible/utils/template.py”, line 371, in template_from_string
res = jinja2.utils.concat(rf)
File “”, line 8, in root
File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.7.3-py2.7.egg/jinja2/runtime.py”, line 485, in _fail_with_undefined_error
raise self._undefined_exception(hint)
UndefinedError: ‘unicode object’ has no attribute ‘ssh_key’
TASK: [debug var=ansible_ssh_private_key_file] ********************************
FATAL: no hosts matched or all hosts have already failed – aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/galindro/play.retry
x.x.x.xxx : ok=0 changed=0 unreachable=1 failed=0
`