Fixing exec usage, handling and optimise code #516
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request (PR) description
That is why this PR fixes the issues with unnecessary exec and missing exec conditions. It also fixes some other issues with the code see the following list of changes:
refresh_only
,created
,onlyif
orunless
replace => false
file_line
resource.exec { 'Waiting for Wazuh indexer...': }
inwazuh::dashboard
since there is no use case for it anymoreindexer_service
anddashboard_service
are class parameter but has been never used.wazuh::indexer
,wazuh::dashboard
andwazuh::filebeat_oss
/etc/security/limits.conf
configurationwazuh-indexer
user and which also already owns the directories for this.$::osfamily
instead of$facts['os']['family']
wazuh::indexer
,wazuh::dashboard
andwazuh::filebeat_oss
find_file()
inwazuh::certificates
find_file()
looks only for a file in modules not on the puppet-agent as wanted here. https://puppet.com/docs/puppet/7/function.html#find-fileserver.host
andserver.port
for wazuh-dashboard in/etc/wazuh-dashboard/opensearch_dashboards.yml
443
instead of5601
as put down inwazuh::dashboard
.Note:
wazuh::certificates
will run everytime when/tmp
has been cleaned like by a reboot of the system. But because of the new file resource handling (replace => false
) the certs will not be replaced forwazuh::indexer
andwazuh::dashboard
but created when they do not exist.This Pull Request (PR) fixes the following issues
Closes #512
Closes #489