A very simple setup but i can't find what is wrong

I enabled DEBUG logging:

D, [2016-08-31T20:45:30.656249 #1955] DEBUG -- : about to execute: 
["/usr/bin/ssh", "-l", "root", "-i", "/etc/foreman-proxy/id_rsa", 
"<HOSTNAME>", "/usr/bin/puppet agent --onetime --no-daemonize"]
W, [2016-08-31T20:45:30.664957 #1955]  WARN -- : Non-null exit code when 
executing '["/usr/bin/ssh", "-l", "root", "-i", 
"/etc/foreman-proxy/id_rsa", "<HOSTNAME>", "/usr/bin/puppet agent --onetime 
--no-daemonize"]'

I know the return code is 255 (It doesn't even reach the server, it returns 
an error which i can't find),I tried to capture the output but managed only 
to capture the exitstatus so far.

I can run the command when switching to the foreman-proxy user on the 
puppet master (where foreman-proxy for this puppet masters run also)

[root@<puppetmaster>:~]$ su - foreman-proxy -s /bin/bash
-bash-4.2$ /usr/bin/ssh -l root -i /etc/foreman-proxy/id_rsa <HOSTNAME> 
/usr/bin/puppet agent --onetime --no-daemonize
-bash-4.2$ echo $?
0

I wouldn't be posting here if this simple test didn't work, but it works as 
expected.


/etc/foreman-proxy/settings.d/puppet.yml
:puppet_provider: puppetssh
:puppetssh_command: /usr/bin/puppet agent --onetime --no-daemonize
:puppetssh_wait: 30
:puppetssh_user: root
:puppetssh_keyfile: /etc/foreman-proxy/id_rsa

$ cat /usr/share/foreman-proxy/.ssh/config
Host *
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to