Ansible call back error when using with foreman

I have installed foreman and ansible on same host and enable call backs i
can see some options to use ansible on foreman.
but when i execute a playbook i get this error

ERROR:-

[WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin
(</usr/share/ansible/plugins/callback/foreman_callback.CallbackModule
object at 0x3047ed0>): [Errno 13] Permission denied

ANSIBLE:-

ansible 2.3.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

FOREMAN_CALLBACK.PY:-

FOREMAN_URL = os.getenv('FOREMAN_URL', "https://10.97.13.216")

Substitute by a real SSL certificate and key if your Foreman uses HTTPS

FOREMAN_SSL_CERT = (os.getenv('FOREMAN_SSL_CERT',
"/var/lib/puppet/ssl/certs/ip-10-97-13-216.ec2.internal.pem"),
os.getenv('FOREMAN_SSL_KEY',
"/var/lib/puppet/ssl/private_keys/ip-10-97-13-216.ec2.internal.pem"))
FOREMAN_SSL_VERIFY = os.getenv('FOREMAN_SSL_VERIFY', "0")

the url is the url where i access foreman

The playbook is trying to conect to local host and execute

··· --- - hosts: 10.97.13.216 gather_facts: true tasks: - name: testing playbook yum: name=ntp state=latest

> I have installed foreman and ansible on same host and enable call backs i
> can see some options to use ansible on foreman.
> but when i execute a playbook i get this error

Pemrmission denied sounds like the user running your ansible process
cannot read the certificate files:

/var/lib/puppet/ssl/certs/ip-10-97-13-216.ec2.internal.pem
/var/lib/puppet/ssl/private_keys/ip-10-97-13-216.ec2.internal.pem

Ensure the user running ansible can read those files, check SELinux
permissions if applicable too

Hope that works :slight_smile:

··· On 01/12, challa.tek@gmail.com wrote:

ERROR:-

[WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin
(</usr/share/ansible/plugins/callback/foreman_callback.CallbackModule
object at 0x3047ed0>): [Errno 13] Permission denied

ANSIBLE:-

ansible 2.3.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides

FOREMAN_CALLBACK.PY:-

FOREMAN_URL = os.getenv(‘FOREMAN_URL’, “https://10.97.13.216”)

Substitute by a real SSL certificate and key if your Foreman uses HTTPS

FOREMAN_SSL_CERT = (os.getenv(‘FOREMAN_SSL_CERT’,
“/var/lib/puppet/ssl/certs/ip-10-97-13-216.ec2.internal.pem”),
os.getenv(‘FOREMAN_SSL_KEY’,
“/var/lib/puppet/ssl/private_keys/ip-10-97-13-216.ec2.internal.pem”))
FOREMAN_SSL_VERIFY = os.getenv(‘FOREMAN_SSL_VERIFY’, “0”)

the url is the url where i access foreman

The playbook is trying to conect to local host and execute


  • hosts: 10.97.13.216
    gather_facts: true
    tasks:
    • name: testing playbook
      yum: name=ntp state=latest


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Daniel Lobato Garcia

@dLobatog

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: elobato (Daniel Lobato Garcia) | Keybase

1 Like

I had this problem as well and Daniel's right. I fixed it back then by
changing the the access rights of the certs.

··· On Monday, January 16, 2017 at 10:55:00 AM UTC+1, chall...@gmail.com wrote: > > I have installed foreman and ansible on same host and enable call backs i > can see some options to use ansible on foreman. > but when i execute a playbook i get this error > > *ERROR:-* > > [WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin > ( object at 0x3047ed0>): [Errno 13] Permission denied > > *ANSIBLE*:- > > ansible 2.3.0 > config file = /etc/ansible/ansible.cfg > configured module search path = Default w/o overrides > > *FOREMAN_CALLBACK.PY:-* > > FOREMAN_URL = os.getenv('FOREMAN_URL', "https://10.97.13.216") > # Substitute by a real SSL certificate and key if your Foreman uses HTTPS > FOREMAN_SSL_CERT = (os.getenv('FOREMAN_SSL_CERT', > "/var/lib/puppet/ssl/certs/ip-10-97-13-216.ec2.internal.pem"), > os.getenv('FOREMAN_SSL_KEY', > "/var/lib/puppet/ssl/private_keys/ip-10-97-13-216.ec2.internal.pem")) > FOREMAN_SSL_VERIFY = os.getenv('FOREMAN_SSL_VERIFY', "0") > > the url is the url where i access foreman > > The playbook is trying to conect to local host and execute > > --- > - hosts: 10.97.13.216 > gather_facts: true > tasks: > - name: testing playbook > yum: name=ntp state=latest >