Puppet Server Error: Failed to find HOSTNAME via exec: Execution of '/etc/puppetlabs/puppet/node.rb HOSTNAME' returned 1
Environment
- Red Hat Enterprise Linux
- Red Hat Satellite 6
Issue
- "puppet agent -t" command failed with the following error
Puppet Server Error: Failed to find <HOSTNAME> via exec: Execution of '/etc/puppetlabs/puppet/node.rb <HOSTNAME>' returned 1
Resolution
- Follow the Diagnostic Steps first.
- Ssh to the Capsule or Satellite server which the configuration (foreman.yaml) is wrong.
- Edit the following answer file:
# For Capsule server
/etc/foreman-installer/scenarios.d/capsule-answers.yaml
# For Satellite server
/etc/foreman-installer/scenarios.d/satellite-answers.yaml
- Under the "puppet" section, set "server_foreman_url" to your Satellite url.
puppet:
...
server_foreman_url: https://my_satellite.example.com
...
- Run the satellite installer command.
# For Capsule server
satellite-installer --scenario capsule
# For Satellite server
satellite-installer --scenario satellite
- If the installer command is finished successfully, then try to run "puppet agent -t" from the host to verify.
For more KB articles/solutions related to Red Hat Satellite 6.x Puppet Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Puppet Issues
Root Cause
- The puppet configuration for foreman is not pointed to the correct url.
Diagnostic Steps
- Make sure the host is registered to the Satellite server by making sure the content host is listed on the Content Hosts page.
- If the host is registered to the Satellite server through the Capsule server, then check the following configuration file from the Capsule server. Otherwise, check it from the Satellite server.
# For Puppet 3, check this file
/etc/puppet/foreman.yaml
# For Puppet 4, check this file
/etc/puppetlabs/puppet/foreman.yaml
- The value of the "url" field must be pointed to the Satellite server. Otherwise, please follow the Resolution steps to fix this.
:url: "https://my_satellite.example.com"
SBR
Product(s)
Components
Category
Tags
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.