Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ansible Templating issue
test:
multiline: |
f4x6aaBtLPQk898Ymfkn
TQsi69wDY40aluFbdp99
jqdGOkx9CN2xgWOM8JeI
M4lXnXyctLTDejDb2eZu
XBPmvqXJStQFZIQwHzLF
by0cxOYjrY3On6hj3oqk
Xu0Ze6Sz8EbC7udHsyxE
jNv0M7lWNJCfegOlDCJH
UK56XrCbPj6HD4HfwT57
dtwpXGkWMjhpe3UcMJJ8
[all]
localhost
- hosts: all
tasks:
- name: test templating
delegate_to: localhost
template:
src: template.yaml.j2
dest: "{{ playbook_dir }}/template.yaml"
multiline: 'f4x6aaBtLPQk898Ymfkn
TQsi69wDY40aluFbdp99
jqdGOkx9CN2xgWOM8JeI
M4lXnXyctLTDejDb2eZu
XBPmvqXJStQFZIQwHzLF
by0cxOYjrY3On6hj3oqk
Xu0Ze6Sz8EbC7udHsyxE
jNv0M7lWNJCfegOlDCJH
UK56XrCbPj6HD4HfwT57
dtwpXGkWMjhpe3UcMJJ8
'
{multiline: 'f4x6aaBtLPQk898Ymfkn
TQsi69wDY40aluFbdp99
jqdGOkx9CN2xgWOM8JeI
M4lXnXyctLTDejDb2eZu
XBPmvqXJStQFZIQwHzLF
by0cxOYjrY3On6hj3oqk
Xu0Ze6Sz8EbC7udHsyxE
jNv0M7lWNJCfegOlDCJH
UK56XrCbPj6HD4HfwT57
dtwpXGkWMjhpe3UcMJJ8
'}
f4x6aaBtLPQk898Ymfkn
TQsi69wDY40aluFbdp99
jqdGOkx9CN2xgWOM8JeI
M4lXnXyctLTDejDb2eZu
XBPmvqXJStQFZIQwHzLF
by0cxOYjrY3On6hj3oqk
Xu0Ze6Sz8EbC7udHsyxE
jNv0M7lWNJCfegOlDCJH
UK56XrCbPj6HD4HfwT57
dtwpXGkWMjhpe3UcMJJ8
{{ test | to_nice_yaml }}
{{ test | to_yaml }}
{{ test.multiline }}
$ ansible --version
ansible 2.8.0
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/j/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.