Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $ cat main.yml
  2. ---
  3. - name: playbook1
  4. hosts: localhost
  5. vars:
  6. test_var:
  7. foo: 1
  8. bar: 2
  9. baz: "ligne quoted and with \r\n"
  10. tasks:
  11. - template:
  12. src: test.yml.j2
  13. dest: "{{ playbook_dir }}/test_1.yml"
  14. ...
  15.  
  16. $ cat templates/test.yml.j2
  17. ---
  18. {% for k in test_var.keys() %}
  19. {{ k }}: {{ test_var[k] }}
  20. {% endfor %}
  21. ...
  22.  
  23. $ cat test_1.yml
  24. ---
  25. bar: 2
  26. foo: 1
  27. baz: ligne quoted and with
  28.  
  29. ...
  30.  
  31. Expected:
  32. $ cat test_1.yml
  33. ---
  34. bar: 2
  35. foo: 1
  36. baz: "ligne quoted and with \r\n"
  37. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement