--- - hosts: "{{ server }}" tasks: - name: create versioned directory file: path={{ deploy_folder }} state=directory - name: sync files to folder synchronize: src: "{{ project_folder}}/" dest: "{{ deploy_folder }}/" archive: yes delete: yes rsync_opts: - "--exclude=.git" - "--exclude=node_modules"