Replies: 2 comments 1 reply
-
Hi and welcome :) This has come up quite a few times. So far, every item (such as So that's the design reason why this is the way it is. The "proper" way to deal with the practical issue of multiple bundles wanting the same thing is through metadata. Create a dedicated for pkg in node.metadata.get('apt/packages', set()):
pkg_apt[pkg] = {} In your other bundles, you can then do this in defaults = {
'apt': {
'packages': {
'git',
},
},
} While this is a little more complicated than just using Does that work for you? |
Beta Was this translation helpful? Give feedback.
-
Thanks, that works - but it sees to do this at the cost of a bit extra
complexity, and a global impact on all the bundles which install
packages. Because of this problem with two bundles, I need to rewrite
all my bundles?
Then there's PPAs - I think I'd have to factor all that into the apt
bundle too.
Is there a well-written example of this apt bundle already existing
which I can start from, which handles PPAs? I see there's one in
kunsi/bundlewrap (link below), but it's not well documented and it isn't
very obvious what it's doing and why. It seems to deal with other
packaging systems, but looks a but hardwired to the package requirements
of the author.
https://git.franzi.business/kunsi/bundlewrap/src/branch/main/bundles/apt
If this and apt bundle is a recommended solution, it would be good to
know this sooner rather than later. The documentation could highlight
this and point to a suggested implementation?
Thinking more: I do also wonder about your point about the conflicting
attributes. The apt bundle solution solves the conflict at the cost of
preventing *any* attributes being used (or at least, any difference).
If I'm not using any different attributes on the various duplicate
package requirements in the first place, then surely Bundlewrap has no
problems to solve, and could just go ahead and perform the install.
Could Bundlewrap have a configuration which tells it to check for
attribute conflicts when installing any given package, and only raise an
error if there are any?
|
Beta Was this translation helpful? Give feedback.
-
New to bundlewrap here. Refugee from Ansible, which I've found to be the least-worst tool for the job so far (having tried Puppet, Chef, and researched a few others about a decade ago). I was getting tired of working around Ansible's clunky re-invention of imperative programming in YAML, and was looking for a stable python API for Ansible, but didn't find any. I am hopeful that bundlewrap is going to be better than the least-worst! So far so good, it's overall an improvement I think, just lacking in mindshare.
Anyway, as there's a bit of a shortage of bundlewrap online know-how, so I'm going to ask some questions. Here's my first.
I have two bundles, call them A and B. They both need git, so have a dependency on
pkg_apt:git
defined initems.py
.However, I get an error when applying: "bundlewrap.exceptions.BundleError: duplicate definition of pkg_apt:git".
This would be fair enough if I didn't intend it - but is there a way of telling bundlewrap this is intentional, so not to worry about this and go ahead anyway?
Beta Was this translation helpful? Give feedback.
All reactions