SSH Host disconnects during hostname module

I am trying to do simple host renames against Ubuntu 20.04 endpoints and always get ssh disconnect whenever trying to run the module. Connecting with sshagent loaded key.
Below is the basic playbook

---
  - hosts: azagents
    tasks:
      - name: set hostname
        ansible.builtin.hostname:
          name: "{{ inventory_hostname }}"

Inventory.yaml file

azagents:
  hosts:
    test1:
      ansible_host: x.x.x.x (Masked out for post)

Error output even with -vv.

TASK [set hostname] **********************************************************************************************************************
task path: /etc/ansible/playbooks/agents.yml:4
fatal: [test1]: FAILED! => {"changed": false, "msg": "Command failed rc=1, out=, err=\u001b[0;1;31mCould not set property: Connection timed out\u001b[0m\n"}

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

setting become: true resolved the issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.