Idempotence for stored config
This commit is contained in:
		@@ -8,7 +8,9 @@
 | 
				
			|||||||
- name: Nginx Unit | Deploy config
 | 
					- name: Nginx Unit | Deploy config
 | 
				
			||||||
  copy:
 | 
					  copy:
 | 
				
			||||||
    dest: "{{ nginx_unit_config_path }}"
 | 
					    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"
 | 
					    mode: "600"
 | 
				
			||||||
    owner: root
 | 
					    owner: root
 | 
				
			||||||
    group: root
 | 
					    group: root
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user