When I create a new host and register it, the corresponding Node YAML file in “/opt/puppetlabs/server/data/puppetserver/yaml/foreman/” is not created. The YAML file for the puppet server was created there at the time of installation.
Puppet throws an error that the node could not be found
However, I can see the node definition YAML at the following link:
I manually created the “mynode.example.com.yaml” file at that location and changed the owner/group to “puppet:puppet”. I copied the yaml I got from the URL above. After that the puppet error went away.
However, after adding classes to the corresponding host, the Node YAML file does not update. If I navigate to the URL “https://foreman.example.com/node/mynode.example.com?format=yml” I can see the correct YAML. However the file “/opt/puppetlabs/server/data/puppetserver/yaml/foreman/mynode.example.com.yaml” is not changed. Running “/etc/puppetlabs/puppet/node.rb mynode.example.com” still shows the old definition. So it is likely reading this from the YAML file above.
I verified “vardir” in “/etc/puppetlabs/puppet/puppet.conf” and “puppetdir” in “/etc/puppetlabs/puppet/foreman.yaml”. Both variables have the same value: “/opt/puppetlabs/server/data/puppetserver”
I verifed that the user “puppet” has read/write permissions on the YAML file.
Foreman automatically creates and updates node.yaml files in “/opt/puppetlabs/server/data/puppetserver/yaml/foreman”
Foreman and Proxy versions:
Foreman Proxy 3.2.1
Foreman and Proxy plugin versions:
Distribution and version:
Other relevant data: