I need to repair some templated files from a previous playbook execution
##### this is a test #########################################
- name: my template TEST - template postgres.conf
vars:
- pg_service_name: "{{ item }}"
ansible.builtin.template:
src: 00-ina-default.conf.j2 # 10-pg-service.conf
dest: "/home/postgres/{{ pg_service_name }}/00-ina-default.conf"
owner: postgres
group: postgres
force: true
backup: true
mode: 0600
become: true
loop:
- somedir
##### this was a test ########################################
this works whether dest does not exist. I want to overwrite an existing file though. This file possibly is or is not identical.
Can it be the force only works when the new and the old file differ?