wazuh-puppet icon indicating copy to clipboard operation
wazuh-puppet copied to clipboard

Wazuh agent service tries to start service

Open akshatgit opened this issue 5 years ago • 3 comments

On every puppet run, wazuh::agent tries to start the service, even if it is already running.

Notice: /Stage[main]/Wazuh::Agent/Service[wazuh-agent]/ensure: ensure changed 'stopped' to 'running'
Info: /Stage[main]/Wazuh::Agent/Service[wazuh-agent]: Unscheduling refresh on Service[wazuh-agent]

It would be better if we do this only if there is a change in the config file.

akshatgit avatar Sep 02 '20 13:09 akshatgit

Hey @akshatgit,

In this case, as in the Kibana plugin one, we should include a conditional statement to ensure idempotence. We are in the process of improving the puppet module and we will take into account your suggestions.

As soon as our workflow allows us we will address it. Thanks for your contribution!

Greetings,

JP

Zenidd avatar Sep 03 '20 15:09 Zenidd

Thanks, @Zenidd. If helpful, please assign appropriate labels.

akshatgit avatar Sep 03 '20 16:09 akshatgit

Just noticed one more issue. I had updated the config to include who-data, but the agent is not restarted to pick up the configs.

Timestamp of config:

~$ sudo ls -lth  /var/ossec/etc/ossec.conf
-rw-r----- 1 root ossec 5.8K Sep  2 08:56 /var/ossec/etc/ossec.conf

Service status:

~$ sudo service wazuh-agent status
● wazuh-agent.service - Wazuh agent
   Loaded: loaded (/etc/systemd/system/wazuh-agent.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-08-15 10:15:38 UTC; 2 weeks 5 days ago

I had to restart the agent manually to reflect the configs. Just an FYI.

akshatgit avatar Sep 04 '20 10:09 akshatgit