Skip to content
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

Duplication of a class name #261

Closed
wikitops opened this issue Jun 2, 2020 · 2 comments
Closed

Duplication of a class name #261

wikitops opened this issue Jun 2, 2020 · 2 comments
Assignees

Comments

@wikitops
Copy link

wikitops commented Jun 2, 2020

In some cases, depending on the way someone manage the deployment of the agents and the managers, a definition can be duplicated because it has the same name.

In the file agent.pp and manager.pp, this code has the same name :

  # Extract from agent.conf line 320
  concat { 'ossec.conf':
    path    => $wazuh::params_agent::config_file,
    owner   => $wazuh::params_agent::config_owner,
    group   => $wazuh::params_agent::config_group,
    mode    => $wazuh::params_agent::config_mode,
    before  => Service[$agent_service_name],
    require => Package[$agent_package_name],
    notify  => Service[$agent_service_name],
  }

  # Extract from manager.conf line 380
  concat { 'ossec.conf':
    path    => $wazuh::params_manager::config_file,
    owner   => $wazuh::params_manager::config_owner,
    group   => $wazuh::params_manager::config_group,
    mode    => $wazuh::params_manager::config_mode,
    require => Package[$wazuh::params_manager::server_package],
    notify  => Service[$wazuh::params_manager::server_service],
  }

This can result in an error during the execution of Puppet.

In both definition, the name is not really important because all the options are set in the class concat so I suggest to update the name of each class to make it unique and avoid any duplication error ... again in some cases.

@jm404
Copy link
Contributor

jm404 commented Jun 5, 2020

Hi @wikitops,

I share your point of view, the concat blocks should have a better naming convention like manager_ossec.conf and agent_ossec.conf for example.

We will address it and let you know the updates.

Thanks for sharing! It's really appreciated

Best regards,

Jose

@manuasir manuasir added this to the Sprint - 116 - DevOps milestone Aug 10, 2020
@Zenidd Zenidd self-assigned this Sep 2, 2020
@Zenidd
Copy link
Contributor

Zenidd commented Sep 2, 2020

Hello again @wikitops,

We just merged a fix changing the naming convention for the manager and agent concat resources. There should be no collisions at all now.

Thanks for your contribution and let us know anything we should improve.

Greetings,

JP

@Zenidd Zenidd closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants