Sensitive property in execute resource gives error

When I used sensitive property as true in execute resource and ran it on 7.4 rhel to generate ssl certificates then it did not gave any issue but now when executing the same code block on rhel 7.5 it is giving the errors.

Error executing action run on resource 'execute[create system_key]'

Command execution failed. STDOUT/STDERR suppressed for sensitive resource

Resource Declaration:
suppressed sensitive resource output

Compiled Resource:
suppressed sensitive resource output

What should be the reason for this,, How to handle this

The command you have for the "create system_key" execute resource is failing. Because you have marked this resource as sensitive, the error output is suppressed. So this is not a problem with the sensitive property on RHEL 7.4 vs 7.5; it is a problem with the key generation command on 7.4 vs 7.5.

I see a couple options for you to troubleshoot:

  • set the sensitive property to false and rerun chef-client to see the output which should then show the error output from the command (this is a good use case for testing cookbooks with Test Kitchen)
  • log into a RHEL 7.5 host and run the command yourself manually and see the error output