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:
- adding a wait to the restart winbind task. Didn't help, it just disconnected after the set wait time.
- 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!