title: Ansible delegate_to "Incorrect sudo password"
body: <p>With ansible i want to configure rsyslog service for a group of hosts than add the name those hosts to a central host (different from the group of hosts) so my playbook: </p>
  
  <pre><code>- hosts: gourp_of_hosts       
    tasks:
  
      - name: set rsyslog configuration
        lineinfile:
          path: /etc/rsyslog.conf
          line: '{{item}}'
        with_items:
          - some items....
        become: yes
  
      - name: add host to rsyslog central
        blockinfile:
          path: /etc/rsyslog.conf
          block: |
            {{ansible_hostname}}....
        delegate_to: x.x.x.x (my central host)
        become: yes
  </code></pre>
  
  <p>My inventory file contains both the group of hosts and my central host:</p>
  
  <pre><code>[gourp_of_hosts]
  host1 ansible_user=.... ansible_user_pass=.. ansible_sudo_pass=..
  host2 ansible_user=.... ansible_user_pass=.. ansible_sudo_pass=..
  [central]
  x.x.x.x ansible_user=... ansible_user_pass=.. ansible_sudo_pass=..
  </code></pre>
  
  <p>Now i'm facing the following error:</p>
  
  <blockquote>
    <p>fatal: [host1]: FAILED! => {"msg": "Incorrect sudo password"}</p>
  </blockquote>
  
  <p>I tried removing central host from my inventory file and used <code>ssh-copy-id user@x.x.x.x</code> in result i'm having the following error: </p>
  
  <blockquote>
    <p>fatal: [host]: UNREACHABLE! => {"changed": false, "msg": "Failed
    to connect to the host via ssh: Permission denied
    (publickey,gssapi-with-mic,password).\r\n", "unreachable": true}</p>
  </blockquote>