I download the foreman.py and added the lines below to the ansible.cfg file. https://ansible01.localhost.local = <%= @foreman_url %>
/etc/puppetlabs/puppet/ssl/certs/ansible01.localhost.local.pem = <%= @foreman_ssl_cert %>
/etc/puppetlabs/puppet/ssl/private_keys/ansible01.localhost.local.pem = <%= @foreman_ssl_key %>
/etc/puppetlabs/puppet/ssl/certs/ca.pem = <%= @foreman_ssl_ca %>
and getting this error running a playbook from command line:
ERROR! Unexpected Exception, this is probably a bug: ‘instancemethod’ object has no attribute ‘getitem’
the full traceback was:
Traceback (most recent call last):
File “/usr/bin/ansible-playbook”, line 118, in
exit_code = cli.run()
File “/usr/lib/python2.7/site-packages/ansible/cli/playbook.py”, line 122, in run
results = pbex.run()
File “/usr/lib/python2.7/site-packages/ansible/executor/playbook_executor.py”, line 89, in run
self._tqm.load_callbacks()
File “/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py”, line 210, in load_callbacks
callback_obj.set_options()
File “/usr/lib/python2.7/site-packages/ansible/plugins/callback/foreman.py”, line 98, in set_options
self.FOREMAN_SSL_CERT = (self.get_option[‘ssl_cert’], self.get_option[‘ssl_key’])
TypeError: ‘instancemethod’ object has no attribute ‘getitem’
my bad… I changed the ansible.cfg file to the below settings and that fixed the SSL issue. I’m still getting the failed to connect to host via ssh error though. I thought fixing the ssl_verify would fix both.
What error do you see? Does the user have permissions to read those files? Note that using ansible with -v or even -vvvv can show a lot more about what’s going on.
It’s working now. I had to re-enter the user account under Administrator/Settings/Ansible/User. For some reason it did not take correctly the first time.