Description of your problem
I am trying to create a puppet module that uses the sensu:sensu puppet module to connect to our sensu service. This will be used on a brand new puppet server. We currently have a production puppet server using older modules, the plan is to migrate our servers to the the new puppet server when I get it working.
I have copied the code from the old server, but it is not working on the new server and I think this is because I am using a newer sensu module and the code has changed.
Currently my code adds centos 7 servers to puppet but I get errors and I have read the documentation and searched forums for an answer but cannot resolve.
I am getting this error in the journal of the sensu-agent service :
{"component":"agent","error":"Error reading CA file: open /etc/sensu/ssl/ca.crt: permission denied","level":"error","msg":"reconnection attempt failed","time":"2023-04-14T13:28:40+12:00"}
I get this when I run puppet (message repeats several times - our internal domain is redacted)
Notice: Unable to connect to sensu_api server (https://******.******.com:8080): Failed to open TCP connection to *******.******.com:8080 (Connection refused - connect(2) for "******.******.com" port 8080)
Description of steps youâve taken to attempt to solve the issue
I have change the mode on /etc/sensu/ssl/ca.crt on the agent server to 777 - this didnt make a difference.
I have read the readme for sensu puppet module, and tried various changes - Nothing has worked
Environmental information
Operating system information
Centos agent
Ubuntu Puppet server
Package versions
Sensu version 6.9.2
Sensu Puppet Plugin v5.11.1
My code:
` class { âsensuâ:
api_host => â..comâ,
user => â****â,
password => â***********â,
}
$my_config = {
âbackendsâ => [â..com:8081â],
ânameâ => upcase(â${::hostname}â),
âsubscriptionsâ => $sensu_subscriptions,
âusernameâ => â',
âpasswordâ => '***â,
âagent-managed-entityâ => true,
âlabelsâ => {âregionâ => âsome-regionâ , âvm-hostâ => âsome-hostâ, âenvironmentâ => âbobs-your-uncleâ},
}
class { âsensu::agentâ:
config_hash => $my_config,
}`