1

Seeing this consistently with the playbook below.

- hosts: all
  gather_facts: no
  become: yes
  tasks:
  - name: restart winbind
    service:
      name: winbind
      state: restarted

  - name: reset ssh connection since winbind is dumb and fails the job even though it succeeds
    meta: reset_connection

My ansible user logs in, restarts the service and then gets disconnected by winbind causing ansible to think the task failed.

Feb 13 17:04:57 server1 sshd[30156]: pam_namespace(sshd:session): user unknown 'ansible-user'
Feb 13 17:04:57 server1 sshd[30156]: pam_unix(sshd:session): session closed for user ansible-user
Feb 13 17:04:57 server1 sshd[30156]: fatal: login_init_entry: Cannot find user "ansible-user"
Feb 13 17:04:57 server1 sshd[30163]: fatal: mm_request_send: write: Broken pipe
Feb 13 17:04:57 server1 sshd[30163]: fatal: mm_request_send: write: Broken pipe

Things I've tried:

  1. adding a wait to the restart winbind task. Didn't help, it just disconnected after the set wait time.
  2. adding the meta: reset_connection but it disconnects before that's run.

Also, I'm staying logged into the server while this is happening with my normal id so it's just the ansible-user getting disconnected. My id and the ansible-user id are both AD accounts.

I have another playbook for sssd and I'm not seeing this behavior with it. It restarts the service, stays connected and shows the change in the run output.

Thanks!

1 Answer 1

0

Found a workaround for this by ignoring the fatal unreachable error and pausing the playbook run. Not sure this would scale very well so if someone has a better way to do this I'm all ears. Luckily winbind is on it's way out.

- hosts: all
  gather_facts: no
  ignore_unreachable: yes
  become: yes
  tasks:
  - name: restart winbind
    service:
      name: winbind
      state: restarted

  - name: pause the playbook run to allow winbind to reconnect to AD
    pause:
      seconds: 8

  - name: confirm winbind is running
    service:
      name: winbind
      state: started

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .