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

Add missing ordering relationships #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

theosotr
Copy link

@theosotr theosotr commented Feb 1, 2019

This pull request adds missing ordering relationships between Package['syslog-ng'] and its associated files.

Without those missing ordering relationships, the code is unstable because configuration should always be applied after installation of the package.

@faxm0dem
Copy link
Member

faxm0dem commented Feb 6, 2019

thanks for this patch, but I want to minimize package handling anyway : there is the syslog_ng module for that. I will probably require that module at some point. Your patch fails when disabling package management also.

@@ -20,6 +21,7 @@
default: { fail("unsupported osfamily: ${::osfamily}") }
}
}
$require_package = Package[$real_package_name]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Puppet variables are immutable. $require_package was already set on line 13, and catalog compilation will fail if $manage_package is evaluated to true.

You can change the code to something like this to avoid this issue:

if $manage_package {
  # ...
  $require_package = Package[$real_package_name]
} else {
  $require_package = undef
}

But maybe selectors can help you write more concise and less complex code, something like this (all files managed by the module are managed after all packages managed by the module):

Package <| tags == 'patterndb' |> -> File <| tags == 'patterndb' |>

This commit addresses the comments of @smortex.
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

Successfully merging this pull request may close these issues.

3 participants