On Mon, 1 Aug 2022 at 12:23, Ashok Reddy <[email protected]> wrote:

> ---
>
> - hosts: all
>
>   become: true
>
>   become_method: sudo
>
>   gather_facts: true
>
>   tasks:
>
>     - name: block
>
>       block:
>
>         - name: rsync
>
>           command: "cat /proc/meminfo"
>
>       rescue:
>
>         - debug:
>
>             msg: proceed to install
>
>         - name: install rsync
>
>           dnf:
>
>             name: rsync
>
>             state: present
>
>           delegate_to: localhost
>
>     - name: sync
>
>       ansible.posix.synchronize:
>
>         src: /root
>
>         dest: /root
>
>       delegate_to: inventory hostname
>
>
> Error:
>
>
>  FAILED! => {"changed": false, "msg": "Could not determine controller
> hostname for rsync to send to"}
>


The listeral string "inventory hostname" is not a valid hostname. Fix that.
Also, "become_method: sudo" and "gather_facts: true" are both the same as
the defaults, so you can leave that out.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLa4-JSaG5%2BB2yQ0%2BRm_S-t4JgayH6TJKfxS97%2Bz0Kwinw%40mail.gmail.com.

Reply via email to