--- - hosts: localhost tasks: - name: Add hugin to /etc/hosts ansible.builtin.lineinfile: line: '195.169.22.139 hugin' path: /etc/hosts state: present delegate_to: 127.0.0.1