Top "Ansible-template" questions

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

ansible regex_search with variable

How to find a match using regex in ansible playbook where variable appears in the regex_search argument? The following …

regex ansible ansible-template
Ansible template adds 'u' to array in template

I have the following vars inside of my ansible playbook I got the following structure domains: - { main: 'local1.com', …

ansible jinja2 ansible-2.x ansible-template
'dict object' has no attribute 'stdout' in Ansible Playbook

My playbook: - name: JBoss KeyStore and Truststore passwords will be stored in the password vault #shell: less "{{ vault }}" shell: …

ansible ansible-2.x ansible-facts ansible-template
Can the templates module handle multiple templates / directories?

I believe the Ansible copy module can take a whole bunch of "files" and copy them in one hit. This …

ansible ansible-2.x ansible-template
Ansible with_dict template use

I have the following task: - name: copy server.xml template: src=server.xml dest=/var/containers/{{ item.key }}/conf …

ansible ansible-template
I want to include another Jinja2 template in an Ansible context in Jinja2

I have an Ansible playbook that sets a lot of variables. One the playbooks has this task: - name: create …

ansible jinja2 ansible-template
ansible conditional templates

I want to have a simple if else condition in ansibles jinja templates. For plain python cluster_name+'A' if …

python ansible jinja2 ansible-2.x ansible-template
How to remove or exclude an item in an Ansible template list?

I'm writing an Ansible template that needs to produce a list of ip's in a host group, excluding the current …

ansible jinja2 ansible-template
Printing a variable value indented in a YAML file using ansible

I'm generating a Behat config file using Ansible. This configuration file is a YAML file. I'm using a Jinja2 template …

yaml ansible ansible-template
Print string when "item exists in a list" in Jinja2 template

I'm trying to populate nsswitch.conf with values that are determined from a list. The list is of string: openldap_…

ansible jinja2 ansible-template