Skip to content

Puppet 8 changes #1285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 6.0.0
Choose a base branch
from
Open

Conversation

pearsondavid
Copy link

drop deprecated function validate_legacy

use variables for cert content

general format tidying

fix indexer_cluster_cn

re-opening, this was closed when master branch was re-named to main.

Any feedback would be welcome, rather than being ignored.

drop deprecated function validate_legacy

use variables for cert content

general format tidying

fix indexer_cluster_cn
@vcerenu
Copy link
Member

vcerenu commented Apr 29, 2025

Hello @pearsondavid

Thanks for your contribution!

I see that the changes to the use of Puppet facts are good; we still need to test them, but the work done is greatly appreciated.

Regarding some changes, I have some questions and corrections:

  • Regarding the use of variables for the certificate names in the function that handles the certificates created in Puppet Server, it's fine and offers more customization possibilities, but the name should contain the variable $indexer_node_name, which allows us to send the correct certificates to each of the Wazuh indexer nodes we want to install in one run (I'll leave a comment about each of the variables that need to be corrected).
  • I see that the wazuh::manager class has been removed. Can you verify if this is correct and where the code for this class would be?

Also, please sign the commits you make.

I'll be reviewing the code as I test it. These changes will be included in the 5.0.0 release we're working on. As soon as we have the release branches ready, I'll ask you to commit these changes to that branch.

Thank you very much in advance, and I appreciate the work you've done again.

@jandrunas-vast
Copy link

not sure where you are seeing wazuh::manager being removed, it has many changes but mostly due to pdk validate it appears. I was able to personally run pdk convert and then pdk validate -a to make most of these changes automatically. The fact that Puppet 8 doesn't currently work without hacks is less than ideal, and I don't see why this can't be fixed with this PR or just by doing the pdk commands by a wazuh contributor.

@@ -331,7 +325,7 @@
},
'cve-debian-8-oval.xml' => {
'type' => 'oval',
}
},
}
}
/^(wheezy|stretch|buster|bullseye|bookworm|sid|precise|trusty|vivid|wily|xenial|bionic|focal|groovy|jammy)$/: {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add noble here?

@dforste
Copy link

dforste commented Jul 28, 2025

Can we get a merge on this? puppet 7 is EOL.

@lbdemv
Copy link

lbdemv commented Jul 30, 2025

I see that the wazuh::manager class has been removed. Can you verify if this is correct and where the code for this class would be?

The class is not removed but heavily reformated. The diff is simply to large for the Github UI to render it per default.

Can we get a merge on this? puppet 7 is EOL.

Same problem here, we moved to puppet 8 prior to rolling out wazuh and are now stuck in the deployment process because of the lacking puppet 8 support. Any time estimate on the merging process would be much appreciated.

Comment on lines -245 to -253
# validate_bool(
# $ossec_active_response, $ossec_rootcheck,
# $selinux,
# )
# This allows arrays of integers, sadly
# (commented due to stdlib version requirement)
validate_legacy(String, 'validate_string', $agent_package_name)
validate_legacy(String, 'validate_string', $agent_service_name)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: are the package/service names now validated at all?

it seems like a drop of the deprecated function with no current replacement?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR to set types on the variables. This should will move the validation to the module definition.
String $agent_package_name = $wazuh::params_agent::agent_package_name,

Comment on lines -667 to +631
'ESTABLISHED'],
'ESTABLISHED'],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: this removal of the indentation seems wrong, IMHO it was correct before

@@ -4,7 +4,6 @@
class wazuh::agent (

# Versioning and package names

$agent_package_version = $wazuh::params_agent::agent_package_version,
$agent_package_revision = $wazuh::params_agent::agent_package_revision,
$agent_package_name = $wazuh::params_agent::agent_package_name,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$agent_package_name = $wazuh::params_agent::agent_package_name,
String $agent_package_name = $wazuh::params_agent::agent_package_name,

Comment on lines +67 to +75
file { "${dashboard_path_certs}/dashboard.pem":
ensure => file,
owner => $dashboard_fileuser,
group => $dashboard_filegroup,
mode => '0400',
source => $dashboard_cert_content,
require => Package['wazuh-dashboard'],
notify => Service['wazuh-dashboard'],
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the parameter name content in the variable name that is passed to the source parameter is confusing, keywords for use in a given resource should either align or be avoided - e.g. swap to $dashboard_cert_source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.0/devops-overhaul level/task Task issue type/enhancement Enhacement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants