From d553e46176982e183b7ff32bfab65dbf5d1c251d Mon Sep 17 00:00:00 2001 From: John Kristensen Date: Mon, 4 Jan 2021 14:42:36 +1100 Subject: [PATCH] fix(apt_conf): pass context variables to the template as JSON object Previously when passing the apt_conf context variable to the template the variables would not necessarily retain their correct type. An example of this would be when using a pillar value of `null` it would be passed to the template as the string `"None"` instead of type `None`. If we pass the apt_conf context variables to the template using a json object the variables retain their correct types. --- apt/apt_conf.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt/apt_conf.sls b/apt/apt_conf.sls index 8a07461..5aa3ef1 100644 --- a/apt/apt_conf.sls +++ b/apt/apt_conf.sls @@ -32,7 +32,7 @@ - group: root - mode: 644 - context: - data: {{ contents }} + data: {{ contents|json }} - require_in: - file: {{ confd_dir }} {% endfor %}