From 7a1f6199d0ed32d6df6249ec9ec3710614642e62 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Mon, 20 Jul 2020 16:28:22 +0200 Subject: [PATCH] fix(jinja): encode context as json Or with python2 the template are generated with `u''`. --- openssh/config.sls | 4 ++-- openssh/known_hosts.sls | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openssh/config.sls b/openssh/config.sls index 3a5ca8e..b5e373e 100644 --- a/openssh/config.sls +++ b/openssh/config.sls @@ -17,7 +17,7 @@ sshd_config: ) }} - template: jinja - context: - sshd_config: {{ sshd_config }} + sshd_config: {{ sshd_config | json }} - user: {{ openssh.sshd_config_user }} - group: {{ openssh.sshd_config_group }} - mode: {{ openssh.sshd_config_mode }} @@ -40,7 +40,7 @@ ssh_config: ) }} - template: jinja - context: - ssh_config: {{ ssh_config }} + ssh_config: {{ ssh_config | json }} - user: {{ openssh.ssh_config_user }} - group: {{ openssh.ssh_config_group }} - mode: {{ openssh.ssh_config_mode }} diff --git a/openssh/known_hosts.sls b/openssh/known_hosts.sls index c8d49a9..db0e267 100644 --- a/openssh/known_hosts.sls +++ b/openssh/known_hosts.sls @@ -15,7 +15,7 @@ manage ssh_known_hosts file: ) }} - template: jinja - context: - known_hosts: {{ openssh | traverse("known_hosts", {}) }} + known_hosts: {{ openssh | traverse("known_hosts", {}) | json }} - user: root - group: {{ openssh.ssh_config_group }} - mode: 644