Broken puppet run via puppet_proxy_customrun

Problem:
setting :use_provider: to puppet_proxy_customrun causes puppet run trigger to throw erro:

failed to execute puppetrun: ERF12-4252 [ProxyAPI::ProxyException]: Unable to execute Puppet run ([RestClient::NotFound]: 404 Not Found) for proxy http://foreman.local:8000/puppet

Expected outcome:
foreman-proxy should run script defined in :command: section of puppet_proxy_puppetrun.yml

Foreman and Proxy versions:
foreman 1.22.0-1
foreman-proxy 1.22.0-1

Foreman and Proxy plugin versions:

Other relevant data:
This is log from proxy.log:

2019-10-04T16:21:19 d5875e5b [I] Started POST /puppet/run
2019-10-04T16:21:19 d5875e5b [I] Finished POST /puppet/run with 404 (13.33 ms)

puppet.yml:

:enabled: true
:puppet_version: 4.10.12
:puppet_conf: /etc/puppetlabs/puppet/puppet.conf
:use_provider: puppet_proxy_customrun

settings.yml:

:settings_directory: /etc/foreman-proxy/settings.d
:ssl_certificate: /etc/puppetlabs/puppet/ssl/certs/cert.pem
:ssl_ca_file: /etc/puppetlabs/puppet/ssl/certs/ca.pem
:ssl_private_key: /etc/puppetlabs/puppet/ssl/private_keys/key.pem
:trusted_hosts:
:foreman_url: http://127.0.0.1:3000
:daemon: true
:bind_host: [‘0.0.0.0’]
:http_port: 8000
:https_port: 8443
:log_file: /var/log/foreman-proxy/proxy.log
:log_level: DEBUG

Thanks

What is the content of puppet_proxy_customrun.yml? I’m also interested what http://foreman.local:8000/features shows.

Hi, here they are:

http://foreman.local:8000/features returns:

[~]> curl http://foreman.local:8000/features
[]

puppet_proxy_customrun.yml:

---
# Set :command to the full path of the script you want to run, instead of /bin/false
:command: /tmp/run_puppet.sh
#
# Set :command_arguments to any args you want to pass to your custom script. The hostname of the
# system to run against will be appended after the custom commands.
#:command_arguments: 

where run_puppet.sh is a curl towards ansible awx’s REST API

Thanks.

I’ve modified your post’s formatting for readability. That features is empty means there’s an issue with that means the puppet module isn’t loaded. I’d have a look at the proxy’s log.

Thanks for the edit.
Ok, here is the error, you were right:

2019-10-04T17:47:50 [E] Disabling all modules in the group [‘puppet_proxy_customrun’, ‘puppet_proxy_puppet_api’, ‘puppet’] due to a failure in one of them: Parameter ‘command_arguments’ is expected to have a non-empty value

But i do not want any argument for my script, just the hostname as the first argument as told in the comment section.
Should i implement a random argument in the script?

Thanks!

Ok, i got it working :grin:

Now i have:
2019-10-04T18:01:06 d5875e5b [W] Non-null exit code when executing ‘["/tmp/run_puppet.sh", “-n”, “mynode.local”]’
2019-10-04T18:01:06 d5875e5b [E] Failed puppet run: Check Log files
2019-10-04T18:01:06 d5875e5b [I] Finished POST /run with 500 (127298.85 ms)

where mynode.local is the hostname of the puppet node where ansible tower will run the playbook for.
if i’m not mistaken, the hostname is argument #2 since foreman-proxy will run:

/tmp/puppet_run.sh -n mynode.local

right?

Ok, got it working all together.
I works like a charm. Thanks for support