Have you run the playbook in verbose mode to get more detail?  Maybe
there's a mis-spelling in the inventory hostname you used or something in
the inventory.

The only other idea I have is to copy/paste the msg section that starts
with "Could" into your search engine of choice and see what comes up
there.

--John


On Mon, Aug 1, 2022, 7:07 AM Ashok Reddy <[email protected]> wrote:

> Hi Team,
>
> whatever i've mentioned the inventory hostname just ref i.e not the actual
> one.
>
> On Mon, Aug 1, 2022 at 4:18 PM Dick Visser <[email protected]> wrote:
>
>>
>>
>> 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
>> <https://groups.google.com/d/msgid/ansible-project/CAF8BbLa4-JSaG5%2BB2yQ0%2BRm_S-t4JgayH6TJKfxS97%2Bz0Kwinw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CAKRLcHg2Sbjz7Ysgkvb5NsFjn9xdm%3DwmVzn4ja4iSTz9BKUpTQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHg2Sbjz7Ysgkvb5NsFjn9xdm%3DwmVzn4ja4iSTz9BKUpTQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAPAjob8hCdxBzPhP2CwhbEg6bq%3D9m-Gic4Cor2X%2BL50dHXdfyw%40mail.gmail.com.

Reply via email to