Questions tagged [ansible-template]

Use this tag for questions regarding writing and processing Ansible templates, Jinja2 syntax within Ansible, custom filters.

Ansible templates are processed by the Jinja2 templating language. Beside the default Jinja2 filters Ansible extends functionality with a lot of custom filters.

Templates are rendered from Ansible tasks through the template module or through the template lookup plugin.

638 questions
-2
votes
1 answer

syntax error after upgrading ansible and python version

Syntax Error while loading YAML. found unknown escape character The error appears to be in line 111, column 25, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: set_fact: rollback: " {{…
-2
votes
2 answers

How to encrypt roles in Ansible using ansible vault

How to encrypt roles in Ansible using ansible vault, I have multiple roles inside one project and from source code protection perspective we want to encrypt whole roles not particular playbooks.
-2
votes
1 answer

ansible.utils.unsafe_proxy.AnsibleUnsafeT ext object' has no attribute

I am trying to modify and use this httpd ansible role https://github.com/CentOS/ansible-role-httpd I'm facing an issue with pki-tls.yml This piece of code will reproduce the issue I am facing. --- - name: Copy certificates hosts:…
gnuforever
  • 11
  • 2
-2
votes
1 answer

How to remove outdated containers using ansible?

I'm using with_sequence to iteratively create copies of a container on a single node using ansible. The number of containers is determined by a variable set at the time of deploy. This works well for increasing the number of containers to scale up,…
James Bilous
  • 167
  • 9
-3
votes
2 answers

Ansible: How to copy file from `files` directory to `templates` directory in a role directory?

I want to write an Ansible task to copy file from files directory to templates directory. For example, I have an Ansible role named data and inside this role's directory ~/data$ tree . ├── defaults ├── tasks ├── templates └── files    └──…
zizou
  • 1
  • 2
-3
votes
1 answer

Need ansible playbook to compare files from one server to other server on linux

I have folder which is having lot of files and i need to compare it from one server to another server. If the file is not on the destination server then need to copy the same. Can you please help in writing ansible playbook to do the same thing.…
-4
votes
1 answer

1password ansible script for login and edit the password

My aim to auto login and edit the password. Tried this script --- - name: Get device information hosts: localhost connection: local vars: one_pass_signinaddress: "https://xxxxx.1password.com" one_pass_emailaddress: "xxxx@xxxxx.com" …
-6
votes
1 answer

ansible, jinja template with loops, losing newlines

Trying to build a JSON file from a template. It works ok as such, but for some reason newlines within loop constructs go missing, which I find rather irksome; the file "works" (is machine readable just fine), but for human consumption it's pretty…
tink
  • 14,342
  • 4
  • 46
  • 50
1 2 3
42
43