Foreman bare metal provisioning with ansible Callback during provisioning end

Hi everyone,

Recently i´ve startet to work with foreman 1.16.1 and ansible 2.5.0 for provisioning and configuration management for bare metal and virtual machines.
Ansible Roles have been added to the foreman “host-groups” for provisioning but at the end of the provisioning, some ansible callback seems to run while the provisioned system is beeing rebooted.
Of course the outcome from ansible is:

2018-05-04 20:39:04,781 p=38405 u=foreman-proxy |  PLAY [all] *********************************************************************
2018-05-04 20:39:04,804 p=38405 u=foreman-proxy |  TASK [Gathering Facts] *********************************************************
2018-05-04 20:39:05,525 p=38405 u=foreman-proxy |  fatal: [myhost.example.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host myhost.example.com port 22: Connection refused\r\n", "unreachable": true}
2018-05-04 20:39:05,529 p=38405 u=foreman-proxy |  	to retry, use: --limit @/tmp/foreman-playbook-0912c304-8a5b-4f57-bc6b-a2ffcf0bed89.retry

2018-05-04 20:39:05,529 p=38405 u=foreman-proxy |  PLAY RECAP *********************************************************************
2018-05-04 20:39:05,529 p=38405 u=foreman-proxy |  myhost.example.com : ok=0    changed=0    unreachable=1    failed=0   

How can i get around this issue?
Struggling since days but no outcome.

Any help would be kindly appreciated.

best regards,

Make sure your host gets sshd installed and firewall is configured to allow the access. This looks like the sshd is not running on the host. It could also be caused by the fact, the it hasn’t started on time. There’s a timeout setting under Setting -> Ansible, try setting the higher value, if the host boots for a longer time.