Impossible to synchronize with normal user

hello ,
i’ve this inventory.ini :

[servers]
ubuntu ansible_host=xx.xx.xx.xx ansible_user=alexandre ansible_become_method=su ansible_become_user=root
[all:vars]
ansible_python_interpreter=/usr/bin/python3

i 've this playbook :

---
- hosts: servers
  vars_files:
    - ./ansible/group_vars/all/vault.yml
  vars:
    symfony_root: /var/www/monSiteWeb
    local_project_root: "/home/alexandre/Documents/monSiteWeb"
    nvm_dir: "/usr/local/nvm"
    nvm_version: "v0.40.3"
    node_version: "24.7.0"
    composer_path: "/usr/local/bin/composer"  # Chemin fixe car vous l'avez confirmé

  tasks:
    - debug:
        msg: "Ansible version: {{ ansible_version.full }}"

    # === 1. Vérification de Composer (déjà installé selon vous) ===
    - name: Vérifier que Composer est accessible
      command: "{{ composer_path }} --version --no-interaction"
      register: composer_check
      ignore_errors: yes
      changed_when: false
      environment:
        COMPOSER_ALLOW_SUPERUSER: "1"  # Autorise l'exécution en root
        COMPOSER_NO_INTERACTION: "1"   # Désactive les prompts

    - name: Échouer si Composer n'est pas disponible
      fail:
        msg: "Composer n'est pas installé dans {{ composer_path }}. Veuillez l'installer manuellement."
      when: composer_check.rc != 0

    # === 2. Installation de NVM et Node.js ===
    - name: Créer un répertoire global pour NVM
      file:
        path: "{{ nvm_dir }}"
        state: directory
        owner: root
        group: root
        mode: '0755'

    - name: Télécharger et installer nvm globalement
      shell: |
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/{{ nvm_version }}/install.sh | bash
      args:
        creates: "{{ nvm_dir }}/nvm.sh"
      environment:
        NVM_DIR: "{{ nvm_dir }}"
        PROFILE: "/dev/null"

    - name: Installer Node.js avec NVM
      shell: |
        export NVM_DIR="{{ nvm_dir }}"
        [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
        nvm install {{ node_version }}
        nvm use {{ node_version }}
      environment:
        NVM_DIR: "{{ nvm_dir }}"
        PATH: "{{ nvm_dir }}/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"

    # === 3. Préparation du projet ===
    - name: Créer le répertoire du projet avec les bonnes permissions
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: www-data
        group: www-data
        mode: '0755'

    - name: Créer les répertoires nécessaires pour Symfony
      block:
        - name: Créer var/log
          file:
            path: "{{ symfony_root }}/var/log"
            state: directory
            owner: www-data
            group: www-data
            mode: '0775'

        - name: Créer var/cache
          file:
            path: "{{ symfony_root }}/var/cache"
            state: directory
            owner: www-data
            group: www-data
            mode: '0775'

        - name: Créer .npm pour www-data
          file:
            path: "/home/www-data/.npm"
            state: directory
            owner: www-data
            group: www-data
            mode: '0755'

    - name: Synchroniser les fichiers du projet
      synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        delete: yes
        mode: push
        compress: true
        rsync_opts:
          - "--iconv=utf-8,utf-8"
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=/ansible"
          - "--exclude=/node_modules"
          - "--exclude=var/cache/*"
          - "--exclude=var/log/*"
          - "--exclude=.env.local"
          - "--exclude=package-lock.json"
      delegate_to: localhost
      become: yes
      

    # === 5. Gestion des permissions ===
    - name: Corriger les permissions du projet
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: www-data
        group: www-data
        recurse: yes

    # === 6. Gestion de node_modules ===
    - name: Supprimer package-lock.json s'il existe
      file:
        path: "{{ symfony_root }}/package-lock.json"
        state: absent

    - name: Créer un nouveau package-lock.json
      command: npm install --package-lock-only
      args:
        chdir: "{{ symfony_root }}"
      become: yes
      become_user: www-data
      environment:
        NVM_DIR: "{{ nvm_dir }}"
        PATH: "{{ nvm_dir }}/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"
        HOME: "/home/www-data"
        npm_config_cache: "/home/www-data/.npm"

    - name: Mettre à jour les paquets npm si node_modules existe
      command: npm update
      args:
        chdir: "{{ symfony_root }}"
      become: yes
      become_user: www-data
      environment:
        NVM_DIR: "{{ nvm_dir }}"
        PATH: "{{ nvm_dir }}/versions/node/v{{ node_version }}/bin:{{ ansible_env.PATH }}"
        HOME: "/home/www-data"
        npm_config_cache: "/home/www-data/.npm"
      when: lookup('fileglob', symfony_root + '/node_modules/*', wantlist=True) | length > 0

     
    - name: Corriger les versions Symfony dans composer.json
      ansible.builtin.replace:
        path: /var/www/monSiteWeb/composer.json
        regexp: '"symfony/([^"]+)": "[^"]+"'
        replace: '"symfony/\1": "7.0.*"'
        backup: yes



    - name: Supprimer composer.lock pour permettre la mise à jour
      file:
        path: "{{ symfony_root }}/composer.lock"
        state: absent
      become: yes
      become_user: www-data


    # === 7. Gestion de Symfony (avec gestion d'erreurs) ===
    - name: Gérer les dépendances Symfony
      block:
        - name: Vérifier si symfony/runtime est installé
          command: "{{ composer_path }} show symfony/runtime"
          args:
            chdir: "{{ symfony_root }}"
          register: runtime_check
          ignore_errors: yes
          changed_when: false
          become: yes
          become_user: www-data
          environment:
            COMPOSER_HOME: "/home/www-data/.composer"
            PATH: "/usr/local/bin:{{ ansible_env.PATH }}"

        # - name: Installer symfony/runtime si nécessaire
        #   command: "{{ composer_path }} require symfony/runtime --no-interaction --optimize-autoloader"
        #   args:
        #     chdir: "{{ symfony_root }}"
        #   become: yes
        #   become_user: www-data
        #   when: runtime_check.rc is defined and runtime_check.rc != 0
        #   environment:
        #     COMPOSER_HOME: "/home/www-data/.composer"
        #     COMPOSER_NO_INTERACTION: "1"
        #     PATH: "/usr/local/bin:{{ ansible_env.PATH }}"

       

        - name: Forcer Symfony 7 dans composer.json
          ansible.builtin.replace:
            path: "{{ symfony_root }}/composer.json"
            regexp: '"symfony/([^"]+)": "[^"]+"'
            replace: '"symfony/\1": "7.0.*"'
            backup: yes

        - name: Corriger les bundles incompatibles avec Symfony 7
          ansible.builtin.replace:
            path: "{{ symfony_root }}/composer.json"
            regexp: '"(symfony/(monolog-bundle|maker-bundle|webpack-encore-bundle))": "[^"]+"'
            replace: '"\1": "^2.0"'  # Pour monolog-bundle et webpack-encore-bundle
            backup: yes

        - name: Forcer maker-bundle pour Symfony 7
          ansible.builtin.replace:
            path: "{{ symfony_root }}/composer.json"
            regexp: '"symfony/maker-bundle": "[^"]+"'
            replace: '"symfony/maker-bundle": "^1.50"'  # Version compatible Symfony 7
            backup: yes


        - name: Nettoyer le cache Symfony
          command: "php bin/console cache:clear --env=dev"
          args:
            chdir: "{{ symfony_root }}"
          become: yes
          become_user: www-data
          environment:
            APP_ENV: dev
            PATH: "/usr/local/bin:{{ ansible_env.PATH }}"


      rescue:
        - name: Afficher l'erreur détaillée
          debug:
            var: ansible_failed_result

        - name: Créer le fichier de log si absent
          file:
            path: "{{ symfony_root }}/var/log/prod.log"
            state: touch
            owner: www-data
            group: www-data
            mode: '0664'

        - name: Vérifier les logs Symfony (si le fichier existe)
          command: "tail -n 20 {{ symfony_root }}/var/log/prod.log"
          register: symfony_logs
          ignore_errors: yes
          become: yes
          become_user: www-data

        - name: Afficher les logs
          debug:
            var: symfony_logs.stdout_lines
          when: symfony_logs.stdout is defined and symfony_logs.stdout | length > 0

        - name: Redémarrer PHP-FPM
          service:
            name: "php8.3-fpm"
            state: restarted
          when: ansible_os_family == 'Debian'
          become: yes

and, i’ve these problems :

alexandre@alexandre-Matebook:~/Documents/monSiteWeb$ ansible-playbook -i ./ansible/inventory.ini ./ansible/playbookQuatre.yml 

PLAY [servers] *****************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************
ok: [ubuntu]

TASK [debug] *******************************************************************************************************************************************************************
ok: [ubuntu] => {
    "msg": "Ansible version: 2.21.1"
}

TASK [Vérifier que Composer est accessible] ************************************************************************************************************************************
ok: [ubuntu]

TASK [Échouer si Composer n'est pas disponible] ********************************************************************************************************************************
skipping: [ubuntu]

TASK [Créer un répertoire global pour NVM] *************************************************************************************************************************************
ok: [ubuntu]

TASK [Télécharger et installer nvm globalement] ********************************************************************************************************************************
ok: [ubuntu]

TASK [Installer Node.js avec NVM] **********************************************************************************************************************************************
changed: [ubuntu]

TASK [Créer le répertoire du projet avec les bonnes permissions] ***************************************************************************************************************
ok: [ubuntu]

TASK [Créer var/log] ***********************************************************************************************************************************************************
ok: [ubuntu]

TASK [Créer var/cache] *********************************************************************************************************************************************************
ok: [ubuntu]

TASK [Créer .npm pour www-data] ************************************************************************************************************************************************
ok: [ubuntu]

TASK [Synchroniser les fichiers du projet] *************************************************************************************************************************************
[ERROR]: Task failed: Duplicate become password prompt encountered waiting for become success.
>>> Standard Error
[sudo via ansible, key=lqcrgkzlmhihryqhjaaoxqqrzynktqzp] password:
Désolé, essayez de nouveau.
[sudo via ansible, key=lqcrgkzlmhihryqhjaaoxqqrzynktqzp] password:
Origin: /home/alexandre/Documents/monSiteWeb/ansible/playbookQuatre.yml:95:7

93             mode: '0755'
94
95     - name: Synchroniser les fichiers du projet
         ^ column 7

fatal: [ubuntu -> localhost]: FAILED! => {"changed": false, "msg": "Task failed: Duplicate become password prompt encountered waiting for become success.\n>>> Standard Error\n[sudo via ansible, key=lqcrgkzlmhihryqhjaaoxqqrzynktqzp] password:\nDésolé, essayez de nouveau.\n[sudo via ansible, key=lqcrgkzlmhihryqhjaaoxqqrzynktqzp] password:"}

PLAY RECAP *********************************************************************************************************************************************************************
ubuntu                     : ok=10   changed=1    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0   

alexandre@alexandre-Matebook:~/Documents/monSiteWeb$ date
jeu. 25 juin 2026 17:43:11 CEST

i typed an put this :

alexandre@srv1155463:~$ sudo usermod -aG www-data alexandre
alexandre@srv1155463:~$ date
Thu Jun 25 17:45:54 CEST 2026

,and this configuraton:

alexandre@alexandre-Matebook:~/Documents/AnalyticaTechCode$ ls -la ~/.ssh/
total 24
drwx------  2 alexandre alexandre 4096 juin  11 12:38 .
drwxrwxrwx 61 alexandre alexandre 4096 juin  20 13:27 ..
-rw-------  1 alexandre alexandre 3454 mai   28  2025 id_rsa
-rw-r--r--  1 alexandre alexandre  754 mai   28  2025 id_rsa.pub
-rw-------  1 alexandre alexandre  978 juin  11 12:38 known_hosts
-rw-r--r--  1 alexandre alexandre  142 juin  11 12:37 known_hosts.old
lexandre@alexandre-Matebook:~/Documents/AnalyticaTechCode$ date
jeu. 25 juin 2026 17:54:01 CEST

on my virtual private server.

Could you help me ?
Regards
Alexandre

You don’t have to use the “delegate_to” option. This is set automatically
("For the ansible.posix.synchronize module, the “local host” is the host the synchronize task originates on, and the “destination host” is the host synchronize is connecting to) → ansible.posix.synchronize module – A wrapper around rsync to make common tasks in your playbooks quick and easy — Ansible Community Documentation

I would try following these steps:

  1. Delete “delegate_to” from the task.

  2. If you’re using Ansible, try entering the Ansible become password while running the playbook. Use the command “ansible-playbook -K”.

  3. Try deleting the “become” keyword.

Which method are you using to connect — an SSH key or a password?

yes password, but ssh private key is resgistered by finger print

As far as I know, it has nothing to do with host keys. As mentioned, if you want to connect with a password, you have to enter it interactively. SSHPASS must also be installed on the remote host otherwise the module will fail.

Try using an SSH key if you can.

Ssh-pass is aldready install, because i need keychain !

I will try tommorow, thanks !:wink:

no ! it doesn’t work !

alexandre@alexandre-Matebook:~/Documents/XXXXXX$ ansible-playbook -i ./ansible/inventory.ini ./ansible/playbookCinq.yml -K
BECOME password: 

PLAY [servers] *****************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************
ok: [ubuntu]

TASK [debug] *******************************************************************************************************************************************************************
ok: [ubuntu] => {
    "msg": "Ansible version: 2.21.1"
}

TASK [Installer Bash] **********************************************************************************************************************************************************
ok: [ubuntu]

TASK [Vérifier si Bash est déjà le shell par défaut] ***************************************************************************************************************************
ok: [ubuntu]

TASK [Changer le shell par défaut de l'utilisateur en Bash] ********************************************************************************************************************
skipping: [ubuntu]

TASK [Installer NVM] ***********************************************************************************************************************************************************
ok: [ubuntu]

TASK [Installer Node.js avec NVM] **********************************************************************************************************************************************
ok: [ubuntu]

TASK [Symlinker Node/npm/npx vers /usr/local/bin] ******************************************************************************************************************************
ok: [ubuntu] => (item=node)
ok: [ubuntu] => (item=npm)
ok: [ubuntu] => (item=npx)

TASK [Ajouter NVM au .bashrc de root] ******************************************************************************************************************************************
changed: [ubuntu]

TASK [Créer le .bashrc de l'utilisateur si absent] *****************************************************************************************************************************
changed: [ubuntu]

TASK [Ajouter NVM au .bashrc de l'utilisateur] *********************************************************************************************************************************
ok: [ubuntu]

TASK [Synchroniser les fichiers du projet Symfony] *****************************************************************************************************************************
[ERROR]: Task failed: Duplicate become password prompt encountered waiting for become success.
>>> Standard Error

my play book contains this :

---
- hosts: servers
  become: yes
  gather_facts: yes

  vars:
    nvm_dir: /usr/local/nvm
    node_version: 24.7.0
    symfony_root: /var/www/XXXXXX
    composer_path: /usr/local/bin/composer
    inventory_dir: "{{ playbook_dir }}/../ansible"
    user_home: /home/alexandre  # Chemin du home de l'utilisateur

  tasks:
    - name: debug
      debug:
        msg: "Ansible version: {{ ansible_version.full }}"

    # === 1. Installer Bash (si absent) ===
    - name: Installer Bash
      apt:
        name: bash
        state: present
      when: ansible_os_family == 'Debian'

    # === 2. Configurer Bash comme shell par défaut pour l'utilisateur ===
    - name: Vérifier si Bash est déjà le shell par défaut
      command: grep -q "/bin/bash" /etc/passwd
      register: bash_check
      ignore_errors: yes
      changed_when: false

    - name: Changer le shell par défaut de l'utilisateur en Bash
      user:
        name: alexandre
        shell: /bin/bash
      when: bash_check.rc != 0

    # === 3. Installation NVM (inchangé) ===
    - name: Installer NVM
      shell: |
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
      args:
        creates: "{{ nvm_dir }}/nvm.sh"

    - name: Installer Node.js avec NVM
      shell: |
        export NVM_DIR="{{ nvm_dir }}"
        [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
        nvm install {{ node_version }}
        nvm alias default {{ node_version }}
        nvm use {{ node_version }}
      args:
        creates: "{{ nvm_dir }}/versions/node/v{{ node_version }}"

    # === 4. Symlinks Node/npm/npx (inchangé) ===
    - name: Symlinker Node/npm/npx vers /usr/local/bin
      file:
        src: "{{ nvm_dir }}/versions/node/v{{ node_version }}/bin/{{ item }}"
        dest: "/usr/local/bin/{{ item }}"
        state: link
        owner: root
        group: root
        mode: '0755'
      loop:
        - node
        - npm
        - npx
      notify: restart php-fpm

    # === 5. Configurer .bashrc pour root (inchangé) ===
    - name: Ajouter NVM au .bashrc de root
      lineinfile:
        path: /root/.bashrc
        regexp: '^export NVM_DIR={{ nvm_dir }}'
        line: |
          export NVM_DIR={{ nvm_dir }}
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          nvm use {{ node_version }}
        insertafter: EOF

    # === 6. Configurer .bashrc pour l'utilisateur alexandre ===
    - name: Créer le .bashrc de l'utilisateur si absent
      file:
        path: "{{ user_home }}/.bashrc"
        state: touch
        owner: alexandre
        group: alexandre
        mode: '0644'

    - name: Ajouter NVM au .bashrc de l'utilisateur
      blockinfile:
        path: "{{ user_home }}/.bashrc"
        block: |
          export NVM_DIR={{ nvm_dir }}
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          nvm use {{ node_version }}
        marker: "# {mark} ANSIBLE MANAGED BLOCK - NVM"
        insertafter: EOF
        owner: alexandre
        group: alexandre

    # === 7. Le reste du playbook (inchangé) ===
    - name: Synchroniser les fichiers du projet Symfony
      synchronize:
        src: "{{ playbook_dir }}/../"
        dest: "{{ symfony_root }}"
        delete: yes
        rsync_opts:
          - "--iconv=utf-8,utf-8"
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=/ansible"
          - "--exclude=/node_modules"
          - "--exclude=var/cache/*"
          - "--exclude=var/log/*"
          - "--exclude=.env.local"
          - "--exclude=package-lock.json"
      delegate_to: localhost
      # become: yes
      # become_user: root

    # ... (le reste du playbook reste identique)

  handlers:
    - name: restart php-fpm
      service:
        name: php8.3-fpm
        state: restarted
      listen: restart php-fpm

    - name: reload bashrc
      shell: . {{ user_home }}/.bashrc  # Utilise "." au lieu de "source" (compatible sh)
      listen: reload bashrc

ok i found the solution !!

my playbook contains this :

---
- hosts: servers
  become: yes
  gather_facts: yes

  vars:
    nvm_dir: /usr/local/nvm
    node_version: 24.7.0
    symfony_root: /var/www/XXXXXX
    composer_path: /usr/local/bin/composer
    inventory_dir: "{{ playbook_dir }}/../ansible"
    user_home: /home/alexandre  # Chemin du home de l'utilisateur
    local_project_root: "/home/alexandre/Documents/XXXXXX"

  tasks:
    - name: debug
      debug:
        msg: "Ansible version: {{ ansible_version.full }}"

    # === 1. Installer Bash (si absent) ===
    - name: Installer Bash
      apt:
        name: bash
        state: present
      when: ansible_os_family == 'Debian'

    # === 2. Configurer Bash comme shell par défaut pour l'utilisateur ===
    - name: Vérifier si Bash est déjà le shell par défaut
      command: grep -q "/bin/bash" /etc/passwd
      register: bash_check
      ignore_errors: yes
      changed_when: false

    - name: Changer le shell par défaut de l'utilisateur en Bash
      user:
        name: alexandre
        shell: /bin/bash
      when: bash_check.rc != 0

    # === 3. Installation NVM (inchangé) ===
    - name: Installer NVM
      shell: |
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
      args:
        creates: "{{ nvm_dir }}/nvm.sh"

    - name: Installer Node.js avec NVM
      shell: |
        export NVM_DIR="{{ nvm_dir }}"
        [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
        nvm install {{ node_version }}
        nvm alias default {{ node_version }}
        nvm use {{ node_version }}
      args:
        creates: "{{ nvm_dir }}/versions/node/v{{ node_version }}"

    # === 4. Symlinks Node/npm/npx (inchangé) ===
    - name: Symlinker Node/npm/npx vers /usr/local/bin
      file:
        src: "{{ nvm_dir }}/versions/node/v{{ node_version }}/bin/{{ item }}"
        dest: "/usr/local/bin/{{ item }}"
        state: link
        owner: root
        group: root
        mode: '0755'
      loop:
        - node
        - npm
        - npx
      notify: restart php-fpm

    # === 5. Configurer .bashrc pour root (inchangé) ===
    - name: Ajouter NVM au .bashrc de root
      lineinfile:
        path: /root/.bashrc
        regexp: '^export NVM_DIR={{ nvm_dir }}'
        line: |
          export NVM_DIR={{ nvm_dir }}
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          nvm use {{ node_version }}
        insertafter: EOF

    # === 6. Configurer .bashrc pour l'utilisateur alexandre ===
    - name: Créer le .bashrc de l'utilisateur si absent
      file:
        path: "{{ user_home }}/.bashrc"
        state: touch
        owner: alexandre
        group: alexandre
        mode: '0644'

    - name: Ajouter NVM au .bashrc de l'utilisateur
      blockinfile:
        path: "{{ user_home }}/.bashrc"
        block: |
          export NVM_DIR={{ nvm_dir }}
          [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
          nvm use {{ node_version }}
        marker: "# {mark} ANSIBLE MANAGED BLOCK - NVM"
        insertafter: EOF
        owner: alexandre
        group: alexandre

    # - name: Allow Ansible tmp under /var/www
    #   become: yes
    #   file:
    #     path: /var/www/.ansible/tmp
    #     state: directory
    #     owner: www-data
    #     group: www-data
    #     mode: '0755'

    # === 7. Le reste du playbook (inchangé) ===
    - name: Synchronize project files
      ansible.posix.synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        delete: yes
        mode: push
        compress: true
        rsync_opts:
          - "--iconv=utf-8,utf-8"
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=/ansible"
          - "--exclude=var/cache/*"
          - "--exclude=var/log/*"
          - "--exclude=.env.local"
          - "-v"
      become: no
      delegate_to: localhost

    # ... (le reste du playbook reste identique)

  handlers:
    - name: restart php-fpm
      service:
        name: php8.3-fpm
        state: restarted
      listen: restart php-fpm

    - name: reload bashrc
      shell: . {{ user_home }}/.bashrc  # Utilise "." au lieu de "source" (compatible sh)
      listen: reload bashrc

and my inventory.ini contains this :

\[servers\]

ubuntu ansible_host=xxxx ansible_user=alexandre ansible_become_method=su ansible_become_user=root

\[all:vars\]

ansible_python_interpreter=/usr/bin/python3

i’ve written this : ansible.posix.synchronize: ,texte en gras, instead this : “synchronize” .
that’s the only cause after reflexion.

my rsync version is :

alexandre@alexandre-Matebook:~/Documents/XXXXX$ rsync -v
rsync  version 3.2.7  protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
...
alexandre@alexandre-Matebook:~/Documents/AnalyticaTechCode$ date
ven. 03 juil. 2026 17:18:43 CEST

I’m happy to hear that it’s working for you!

So, you just used the FQCN, and it worked? To be honest, it makes no sense to me at all. I don’t understand why it works now. AFAIK, using the FQCN would be helpful if Ansible cannot use the module because it can’t find it.

You didn’t change anything else, right?