Top "Ansible-template" questions

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

ansible template add value to list -

based on the following ansible playbook values .. target: "actual.domain.com" aliases: - "alias1.domain.com" - "alias2.domain.com" …

ansible jinja2 ansible-template
Rendering Ansible template into the fact variable

Is there a way to render Ansible template into the fact? I tried to find a solution but it looks …

ansible jinja2 ansible-template
Extra spaces appearing in Ansible templates

I am generating config files and I want them to be indented just so. I started with a Jinja2 template …

ansible jinja2 ansible-template
Ansible w/ Docker - Show current Container state

Im working on a little Ansible project in which I'm using Docker Containers. I'll keep my question short: I want …

docker ansible docker-compose ansible-template
Restart service when service file changes when using Ansible

I am creating a systemd service using template module --- - name: Systemd service template: src: sonar.unit.j2 dest: /…

ansible ansible-template
ansible output printing unwanted things. how to format and display only specific data's

I am using ansible 2.4 in centos, trying to run the below script in remote servers and getting the output. Here …

ansible ansible-2.x ansible-inventory ansible-facts ansible-template
Splitting variable not working in Ansible

I am trying to split the variable based on delimiter. How can I achieve it? some_module: {{item}}.split('@…

ansible jinja2 ansible-template
Ansible loop - how to match up template values with with_items?

I'm trying to create files that have values that match their with_items values. I have a var list like …

ansible jinja2 ansible-template
Ansible register variable in task and use it in template

In the Ansible task, how to register a variable so I can use it as check statement in Template. The …

ansible jinja2 ansible-2.x ansible-template
How to fix 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'value' error

I have defined the nginx_upstreams variable in a different role that in turn uses the geerlingguy.nginx role and …

ansible ansible-2.x ansible-inventory ansible-template