From 1eaac08d45f54fe537f50924215b8b440659e309 Mon Sep 17 00:00:00 2001 From: "Oleg \"Zmey!\" Vasiliev" Date: Thu, 5 Oct 2023 14:17:00 +0300 Subject: [PATCH] Idempotence for stored config --- tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 428fa04..7ffcab2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,7 +8,9 @@ - name: Nginx Unit | Deploy config copy: dest: "{{ nginx_unit_config_path }}" - content: "{{ nginx_unit_config | to_nice_json }}" + # https://stackoverflow.com/questions/38392491/ansible-remove-whitespaces-in-json-file + # unit saves json minified, so to achieve idempotence we need to do it too + content: "{{ nginx_unit_config | to_json(separators=(',',':')) }}" mode: "600" owner: root group: root