i want to generate a config for syslogd from template. as there are some 
"special" chars in the config, the '*' char in this case, ansible has some 
problems to run the template.
how to i tell ansible/jinja2 to treat the star as an literal?

error:

AnsibleError: template error while templating string: expected token 'end 
of statement block', got '*'. String: # {{ ansible_managed }}

template:

# {{ ansible_managed }}

auth.info       /var/log/syslog/auth    rotate compress size 10m files 10
*.info  /var/log/syslog/messages        rotate compress size 10m files 10
local2.*  /var/log/syslog/sudo          rotate compress size 10m files 10
{% if ( (inventory_lparname not in groups['HA_HOST'] | default([])) and
        (inventory_lparname not in groups['DMZ_HOST'] | default([])) ):
*.info  @1.2.3.4
{% endif %}
{% if inventory_lparname in groups['HA_HOST'] | default([]) %}
# HACMP Config
*.info  @1.2.3.4
# PowerHA SystemMirror Critical Messages
local0.crit /dev/console
# PowerHA SystemMirror Informational Messages
local0.info /var/hacmp/adm/cluster.log rotate size 1m files 8
# PowerHA SystemMirror Messages from Cluster Scripts
user.notice /var/hacmp/adm/cluster.log rotate size 1m files 8
# PowerHA SystemMirror Messages from Cluster Daemons
daemon.notice /var/hacmp/adm/cluster.log rotate size 1m files 8

caa.info /var/adm/ras/syslog.caa rotate size 1m files 10
{% endif %}
{% if (inventory_lparname in groups['DMZ_HOST'] | default([]))
*.info  @1.2.3.4
{% endif %}
{% if ( ('some_host' in ansible_hostname) or
        ('some_host' in ansible_hostname) or
        ('some_host' in ansible_hostname) or
        ('some_host' in ansible_hostname) or
        ('some_host' in ansible_hostname) or
        ('some_host' in ansible_hostname) ):
# Trusted Logging
*.info /dev/vlog0
{% endif %}
# ASO log configuration
aso.notice /var/log/aso/aso.log rotate size 128k time 7d
aso.info /var/log/aso/aso_process.log rotate size 1024k
aso.debug /var/log/aso/aso_debug.log rotate size 8m compress

mail.debug  /var/log/syslog/mail rotate time 7d files 4 compress



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5cea8d6e-79b9-4045-a630-066771668194%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to