I tried following the instructions, but something isn’t right.
Installed Foreman version 1.16, full-auto using foreman-installer.
Than the foreman-ansible-plugin.
Ansible version is 2.5.3
Ansible has the required [callback_foreman] fields configured.
But when I try to ansible -m setup localhost i get an error at the end:
HTTPSConnectionPool(host='foreman.local', port=443): Max retries exceeded with url: /api/v2/hosts/facts (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
HTTPSConnectionPool(host='foreman.local', port=443): Max retries exceeded with url: /api/v2/reports (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),))
based on the error, I assume the hostname foreman.local does not match the CN in x509 certificate that is installed on Foreman server. See the certificate and use the same hostname in callback configuration instead of foreman.local.
When verify_certs is set to 1, Ansible will use the local CA bundle (usually /etc/pki/tls/certs/ca-bundle.crt). It’s quite likely that the Foreman CA is not included in the local CA bundle.
You may use the path to the Foreman CA bundle directly, like this: verify_certs=/etc/foreman-proxy/ssl_ca.pem
Could you try that? If that doesn’t work, could you try setting verify to False to make sure the SSL cert/key are correct? From the error I think it’s just the CA verification but let’s make sure.