Hi there, I want to manage some files with puppet that control the installation of packages in Gentoo (/etc/make.conf, /etc/portage/*). These files must be downloaded to the client before any package resource is processed, so they are installed correctly. Is there any way to do this? Possible solutions: 1. Include in *every* package require => [ list of files ] inside a case statement, so this is only valid for Gentoo (and of course add other operating systems with similar behavior). I think this is kind of cumbersome, not scalable and prone to errors. 2. Include a default for package: case $operatingsystem { gentoo: { Package { require => [ File["/etc/make.conf"], File["/etc/portage/package.keywords"], File["/etc/portage/package.use"] ] } } This would fail if any package resource overrides require. Any other solution? What I would really like to say is: "every package installed with portage requires some files, and they may require additional things", and I have the feeling that puppet doesn''t let me say such a thing. Best regards Jose _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Feb 8, 2007, at 9:00 AM, José González Gómez wrote:> Hi there, > > I want to manage some files with puppet that control the > installation of packages in Gentoo (/etc/make.conf, /etc/portage/ > *). These files must be downloaded to the client before any package > resource is processed, so they are installed correctly. Is there > any way to do this? Possible solutions: > > 1. Include in *every* package require => [ list of files ] inside a > case statement, so this is only valid for Gentoo (and of course add > other operating systems with similar behavior). I think this is > kind of cumbersome, not scalable and prone to errors. > 2. Include a default for package: > case $operatingsystem { > gentoo: { > Package { require => [ File["/etc/make.conf"], File["/etc/ > portage/package.keywords"], File["/etc/portage/package.use"] ] > } > } > This would fail if any package resource overrides require. > > Any other solution? What I would really like to say is: "every > package installed with portage requires some files, and they may > require additional things", and I have the feeling that puppet > doesn''t let me say such a thing.The short answer is that there''s currently no good way to do this. It seems we should be able to specify that a given resource should happen before all resources of another type, which would suffice in this case. It would be even better if we could say that a given resource should happen before all resources of a given type matching a given parameter (e.g., your case of all package resources whose provider is gentoo). It might also suffice just to say that a given resource should be "first", which would restrict it from having any dependencies but would guarantee that it would be among the first batch of resources applied (that is, all resources marked ''first'' would get applied, then the rest of the resources). -- He played the king as if afraid someone else would play the ace. --John Mason Brown --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
2007/2/8, Luke Kanies <luke@madstop.com>:> > On Feb 8, 2007, at 9:00 AM, José González Gómez wrote: > > > Hi there, > > > > I want to manage some files with puppet that control the > > installation of packages in Gentoo (/etc/make.conf, /etc/portage/ > > *). These files must be downloaded to the client before any package > > resource is processed, so they are installed correctly. Is there > > any way to do this? Possible solutions: > > > > 1. Include in *every* package require => [ list of files ] inside a > > case statement, so this is only valid for Gentoo (and of course add > > other operating systems with similar behavior). I think this is > > kind of cumbersome, not scalable and prone to errors. > > 2. Include a default for package: > > case $operatingsystem { > > gentoo: { > > Package { require => [ File["/etc/make.conf"], File["/etc/ > > portage/package.keywords"], File["/etc/portage/package.use"] ] > > } > > } > > This would fail if any package resource overrides require. > > > > Any other solution? What I would really like to say is: "every > > package installed with portage requires some files, and they may > > require additional things", and I have the feeling that puppet > > doesn''t let me say such a thing. > > The short answer is that there''s currently no good way to do this. > > It seems we should be able to specify that a given resource should > happen before all resources of another type, which would suffice in > this case. It would be even better if we could say that a given > resource should happen before all resources of a given type matching > a given parameter (e.g., your case of all package resources whose > provider is gentoo). > > It might also suffice just to say that a given resource should be > "first", which would restrict it from having any dependencies but > would guarantee that it would be among the first batch of resources > applied (that is, all resources marked ''first'' would get applied, > then the rest of the resources). > >I''ve been thinking about this, and I think the simplest solution is to have some kind of "hard" default. I mean, when you define a default value for some parameter, you may override it in any resource. What if you could define a default value, so when some resource overrides it, instead of losing the default values they get added to the values specified in the resource? Of course this should only be done on parameters that admit arrays of values. Best regards Jose _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 09/02/07 10:55 +0100, Jos? Gonz?lez G?mez wrote: <snip>> > I''ve been thinking about this, and I think the simplest solution is to have > some kind of "hard" default. I mean, when you define a default value forI would say that we have a packagemanager keyword. On any Puppet run, any resource tagged by packagemanager must be processed first. Once the package manager is made up to date, it can pull down everything else as appropriate. I believe this would just be easier instead of trying to add (or remove) values from arrays, and possibly result in a generic ordering solution. Devdas Bhagat
On Feb 9, 2007, at 5:25 AM, Devdas Bhagat wrote:> > I would say that we have a packagemanager keyword. On any Puppet run, > any resource tagged by packagemanager must be processed first. Once > the > package manager is made up to date, it can pull down everything > else as > appropriate. > > I believe this would just be easier instead of trying to add (or > remove) > values from arrays, and possibly result in a generic ordering > solution.This doesn''t scale very well, at least unless it''s made abstract. For instance, if we were to use a different user setup, we''d want to configure that user setup before managing users, so we''d have the same problem. We need a generic way of specifying these situations. -- The only difference between the Democrats and the Republicans is that the Democrats allow the poor to be corrupt, too. -- Oscar Levant --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Feb 9, 2007, at 3:55 AM, José González Gómez wrote:> > I''ve been thinking about this, and I think the simplest solution is > to have some kind of "hard" default. I mean, when you define a > default value for some parameter, you may override it in any > resource. What if you could define a default value, so when some > resource overrides it, instead of losing the default values they > get added to the values specified in the resource? Of course this > should only be done on parameters that admit arrays of values.This is essentially impossible in practice. You don''t want default modes to be added to, you want them to be replaced. Relationships are fundamentally different beasts, and they should be treated differently. They need to be pulled out of the parameters and made their own sytnax. I''d like something that enabled us to view this as a separate layer, but I think that would be too difficult to implement; you''d end up being very repetitious. It''s got to stay in the language, but it''s got to be simple to specify and it can''t use parameters. -- I love deadlines. I like the whooshing sound they make as they fly by. --Douglas Adams --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com