Impossible to transfer data with synchronize/rsync (code 12) io.c(232)

ok I have reindented the lines of the yaml file correctly, and I have modified the permissions of mopn folder and files inside, this gives it several command , especially for the permissions on the remote server, we have:

ssh alexandre@xx.xx.xx.xx
ls -l /var/www
sudo chown alexandre:www-data /var/www/AnalyticaTechCode
sudo chmod 775 /var/www/AnalyticaTechCode

et my yaml contains that :

- hosts: servers
  become: yes
  vars:
    symfony_root: /var/www/AnalyticaTechCode
    local_project_root: "/home/alexandre/Documents/AnalyticaTechCode"

  tasks:
    - name: Ensure directory exists
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: alexandre
        group: www-data
        mode: '0755'

    - name: Ensure correct permissions on symfony_root
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: alexandre
        group: www-data
        mode: '0775'
        recurse: yes

    - name: Synchronize project files
      ansible.posix.synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        rsync_opts:
          - "--exclude=.git"
        owner: no
        group: no
      delegate_to: localhost
      become: no

and I have no more problem .

1 Like