Templates and Filters
Templates
- name: Make sure sshd_config is customized
template:
src: sshd_config.j2
dest: /etc/ssh/sshd_config
owner: root
group: root
mode: "0600"
setype: etc_tJinja2 Templates and Facts
# displays all facts for the managed host, and then just the fact that has the list of IPv4 addresses for the managed host
- name: Display some facts
hosts: all
tasks:
- name: Display all facts
debug:
var: ansible_facts
- name: Display a list of all IPv4 addresses
debug:
var: ansible_facts['all_ipv4_addresses']Some other facts
Template Syntax
Comment
For loop
Conditionals
Filters
List intersect filter
Processing Variables with Jinja2 Filters
Multiple Filters
Other Filters
ipaddr Filter
list of filters
Templating External Data with Lookup Plugins
Lookup and Query
Resource
Last updated