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

Package Dependency Chain without tags breaks module for multistage environments #50

Open
oniGino opened this issue Mar 8, 2021 · 4 comments

Comments

@oniGino
Copy link

oniGino commented Mar 8, 2021

In https://github.com/edestecd/puppet-mariadb/blob/master/manifests/repo/yum.pp line 18

Yumrepo['mariadb'] -> Package<| |> should read something like Yumrepo['mariadb'] -> Package<| tag == 'mariadb'|>

Or else you have now required yumrepo to run prior to ALL packages in the entire repo, this includes packages not in the same stage as the class calls to this module. Thus creating dependency cycles

tag your package calls appropriately then add a tag to this dependency to fix

here is an example of the cycle from my codebase

(Anchor[::dnsmasq::end] => Class[Dnsmasq] => Stage[pre] => Stage[main] => Class[Mariadb::Repo::Yum] => Yumrepo[mariadb] => Package[puppet-agent] => Class[Puppet_agent::Install] => Stage[pre])\nCycle graph written to /opt/puppetlabs/puppet/cache/state/graphs/cycles.dot.
Error: Failed to apply catalog: One or more resource dependency cycles detected in graph

The package that is now required for YumRepo[mariadb] has no association what so ever with this module

@edestecd
Copy link
Owner

edestecd commented Mar 8, 2021

Are these packages tagged in the puppetlabs/mysql module like this? We rely in that module to actually install the packages

@edestecd
Copy link
Owner

edestecd commented Mar 8, 2021

@edestecd
Copy link
Owner

edestecd commented Mar 8, 2021

If you wanted to make a PR against puppetlabs/mysql to add tags to the package resources first then this seems like a good solution

@oniGino
Copy link
Author

oniGino commented Mar 8, 2021

Ok so why not just do

Yumrepo['mariadb'] -> Package<| name == 'mysql-server'|>

its faster than me filing multiple PR's and waiting forever for a version bump

oniGino pushed a commit to oniGino/puppet-mariadb that referenced this issue Mar 9, 2021
Patch forced yumrepo dependency chain
oniGino pushed a commit to oniGino/puppet-mariadb that referenced this issue Mar 9, 2021
Patch forced yumrepo dependency chain
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

2 participants