Show_diff reports bouton disappeared

Problem:
When a agent synchronising with a new configuration, we can’t see the show-diff fonctions in reports host.
Expected outcome:
We need to be able to click on the show_diff menu in the reporting to compare the synchronizations
Foreman and Proxy versions:
2.3.5
Foreman and Proxy plugin versions:

Distribution and version:
Ubuntu 18.04
Other relevant data:

It can only show diffs if the agent sends then, i.e. if the agent has show_diff = true set in the local puppet.conf.

Hi @gvde ,

Thank you fore your answer.

Acutally I have a preprod and prod environment that are similar.

I never had to put the parameter show_diff=true in the agent configurations.

Currently the preproduction has no agents with a show_diff=true parameter and displays well the diff of configuration changes.

When the parameter is not set in the puppet.conf what is the default value of show_diff?

LAST UPDATE : I set the show_diff=false parameter in my puppet.conf and i always have the show_diff fonction in the report…

The purpose is to test the show_diff=false parameters. Disable show_diff in the agent doesn’t works for me

Well, this is a puppet problem. It’s difficult to tell without knowing how you run the agent exactly. You also don’t mention which puppet version you are using. You have to check the puppet documentation for your puppet version to find the default value.

Hi,

To enable/disable show_diff fonction, the agent need to be restarted.

The documentation about show_diff fonction is really thin, by default the show_diff fonction is enabled because i never set the options, but on my production env, this fonction does not work anymore. There is no difference between prod and preprod

No. Not with puppet 6. The agent reads the current configuration for each run. You still don’t mention which puppet version you are actually using, so everything remains guess work. I don’t think puppet 5 should be different.

No. According to the puppet docs (and my experience) show_diff is false by default. If it delivers diffs, there must be something setting it.

But again, it kind of depends on how the agent is called exactly. If you running the agent as standard daemon service without overriding settings on the command line you should be able to check the settings with puppet config:

$ sudo /opt/puppetlabs/bin/puppet config print show_diff
true

or wherever the puppet executable which you are using is installed in your case.

Thank you very much for this information.

It’s very strange, on the preproduction environment where the show_diff is functional, the following command on my agent returns:

sudo /opt/puppetlabs/bin/puppet config print show_diff
false

However I can see the configuration diff in the reporting, while the agent returns false

I would suggest you double check how the agent is run on your system, i.e. which daemon is actually running and what command line options is uses. Depending on your init or systemd service file there are several files available to add options for the daemon which overwrite the settings in the configuration files.

/opt/puppetlabs/bin/puppet is the puppetlab version, but there is also a puppet version available from ubuntu. Maybe you mix them? They probably use different paths at different locations for configuration files…

And I can only repeat again: everything is kind of guesswork unless you reveal which version you have installed…

  • I’m using the default Foreman installation for Ubuntu 18.04 with the Foreman official repository

  • I have to invoque the puppet agent with the command : /opt/puppetlabs/puppet/bin/puppet agent --test

  • The agent are in daemon mode with systemd

  • Puppetserver and agent version : 6.26.0

So you are manually enabling show_diff. If you use --test you’ll see diffs regardless of your settings in configuration files because command line settings take precedence.

So check the service and the settings. Use systemctl status puppet to see the service is really used and running and in which files the service unit (and possible additions) are. The puppet.service I have reads serveral environment files allowing to set additional options on command line to the agent service…

1 Like

So if i understand correctly this command executed manually enable show_diff, and i have to enable show_diff in all agent configurations

The status command returns :

 puppet.service - Puppet agent
     Loaded: loaded (/lib/systemd/system/puppet.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-04-12 18:12:52 CEST; 25min ago
   Main PID: 26578 (puppet)
      Tasks: 2 (limit: 4544)
     Memory: 61.6M
     CGroup: /system.slice/puppet.service
             └─26578 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize


Just look into the docs or manual page:

--test: Enable the most common options used for testing. These  are
           ´onetime´,   ´verbose´,   ´no-daemonize´,   ´no-usecacheonfailure´,
           ´detailed-exitcodes´, ´no-splay´, and ´show_diff´.

That looks suspect: the service is disabled. Why is it running? It won’t run after a reboot if it’s disabled.

Look into /lib/systemd/system/puppet.service to see which environment files are loaded and check if anything is in there…

You also don’t tell the path of your puppet.conf file you are using…

Thank you

To me it seemed logical that the command with the --test option was equivalent to the service managed by systemd.

Indeed the service is marked disabled, I made a test, usually it is always enabled

The path of the puppet agent is the default one: /etc/puppetlabs/puppet/puppet.conf

I understand better now the behavior of the agent depending on the options :slight_smile:

Thank you very much @gvde for your help and informations :smiley: