diff --git a/infrastructure/ansible/deploy_logic_push.yml b/infrastructure/ansible/deploy_logic_push.yml index 9774f44..9aa4846 100644 --- a/infrastructure/ansible/deploy_logic_push.yml +++ b/infrastructure/ansible/deploy_logic_push.yml @@ -85,13 +85,18 @@ mode: '0600' when: env_dict | length > 0 -# 6. Sync Dateien (mit Change-Detection für Config-Apps) -- name: "Synchronisiere App-Dateien (Push)" - copy: +# 6. Sync Dateien (mit Change-Detection für Config-Apps und Löschen von entfernten Dateien) +- name: "Synchronisiere App-Dateien (Push mit Delete-Support)" + synchronize: src: "{{ source_dir }}/" dest: "{{ target_dir }}/" - mode: '0644' - directory_mode: '0755' + delete: yes # WICHTIG: Löscht Dateien die im Source nicht mehr existieren + recursive: yes + archive: yes # Behält Permissions & Timestamps + compress: yes + rsync_opts: + - "--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r" # directory_mode='0755', mode='0644' + delegate_to: localhost # rsync läuft von localhost (Source) zu remote (Destination) register: file_sync_result # 7. Docker Compose Deployment