@@ -162,8 +162,8 @@ services. You probably want the same settings across all services, so these
162
162
variables exist to make your life easier :
163
163
164
164
` ` ` yaml
165
- # Note the space here----▼
166
- kea_logging_pattern: "%D{ %Y-%m-%d %H:%M:%S.%q } %-5p [%c/%i.%t] %m\n "
165
+ # NOTE: !unsafe here----▼
166
+ kea_logging_pattern: !unsafe "%D{%Y-%m-%d %H:%M:%S.%q} %-5p [%c/%i.%t] %m\n "
167
167
kea_logging_severity: "INFO"
168
168
kea_logging_debuglevel: 0
169
169
kea_logging_maxsize: 10485760 # 10 MB
@@ -173,10 +173,10 @@ kea_logging_maxver: 3
173
173
Unless you change the `kea_logging_raw_*` variable this will set up logging at
174
174
the INFO level both to `stdout` and to a log file with automatic rotation when
175
175
it reaches 10MB in size and it will keep 2 files in history before they are
176
- deleted. The only thing to be wary of here is the space in the `{ %` pointed out
177
- above. This was necessary to do because `{%` is a special command in jinja which
178
- makes the templating fail. Just be careful with that in case you want to change
179
- the pattern.
176
+ deleted. The only thing to take note of here is the [`!unsafe`][9] keyword used
177
+ in the `kea_logging_pattern`. This is used to get around Ansible otherwise
178
+ trying to interpret `{%` as a special jinja2 templating command. Just be careful
179
+ to keep that in case you want to change the pattern.
180
180
181
181
However, like in the [subnet](#subnets) case discussed above we allow you to
182
182
pipe your own custom settings directly to the templating. Take a look in the
@@ -214,3 +214,4 @@ Only the sky and your sanity is the limit here, so go wild and use the
214
214
[6] : https://kea.readthedocs.io/en/latest/arm/logging.html
215
215
[7] : https://github.com/JonasAlfredsson/docker-kea#docker-network-mode
216
216
[8] : https://kea.readthedocs.io/en/latest/arm/intro.html
217
+ [9] : https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_advanced_syntax.html#unsafe-or-raw-strings
0 commit comments