-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Cyclic dependency error when using systemd::unit_file in multiple classes #178
Comments
Hi! You basically define the service twice, once in your profile and once via the defined resource. This works by accident because the defined resource references the service with class profile::monitoring {
systemd::unit_file { 'send_downtime.service':
content => file('profile/send_downtime.service'),
active => true,
enable => true,
}
}
class profile::base_os {
systemd::unit_file { 'remove_check_mk_cache.service':
content => file('profile/remove_checkmk_cache.service'),
active => true,
enable => true,
}
} While this is shorter, it indeed creates the dependency loop you mentioned. On a few of my profiles I workaround this by not ordering the profiles like you did in your role. I set explicit dependencies in my profile to resources to the other profiles. In your case that would mean:
But I understand that ordering profiles in a role is a common pattern and I do that myself alot as well. In that case just remove the |
Fix is available in #171 |
#171 has been merged so I think this can be closed now. |
Using systemd::unit_file in multiple, strictly ordered classes, causes a cyclic dependency error.
Consider the following code:
2.1. profile::systemd
2.2. profie::base_os
2.3. profile::monitoring
Unit tests or using this code on a system produce cyclic dependency error:
The text was updated successfully, but these errors were encountered: