Hello: I''d like to ensure that I''ve set-up various gconf settings for users. I cobbled together this little sad definition: define gconf($type, $value, $user) { exec{"set $name to $value": command => "/bin/su $user -c ''/usr/bin/gconftool-2 --config-source xml:readwrite:/home/$user/.gconf --type=$type --set $name \"$value\"''", } } used like this: gconf{"/apps/gnome-terminal/profiles/Default/font": type => "string", value => "Monospace 16", user => "rbdixon", } It all seems a little verbose. Any suggestions on how to improve this? Maybe trying to puppet manage gconf entries is a bad idea? Brad --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/20/2009 4:52 PM, Brad Dixon wrote:> Hello: > > I''d like to ensure that I''ve set-up various gconf settings for users. > I cobbled together this little sad definition: > > define gconf($type, $value, $user) { > exec{"set $name to $value": > command => "/bin/su $user -c ''/usr/bin/gconftool-2 > --config-source xml:readwrite:/home/$user/.gconf --type=$type --set > $name \"$value\"''", > } > } > > used like this: > > gconf{"/apps/gnome-terminal/profiles/Default/font": > type => "string", > value => "Monospace 16", > user => "rbdixon", > } > > It all seems a little verbose. Any suggestions on how to improve this?I can see setting a default type of "string", perhaps: define gconf($type="string", $value, $user) { ... but other than that, I don''t know how much less verbose you could make it and still have it be reasonably complete. However, you could (and probably should) put all the common gconf defines into classes that you can apply as a group: class site_gnome_terminal_settings { gconf("/apps/gnome-terminal/profiles/Default/font": value => "Monospace 16", user => "rbdixon", } .... } Not that it helps with verbosity, but you''ll want to include an ''unless'' parameter in the exec to make it idempotent. Otherwise, it''ll run every time puppet does. If gconftool also lets you query values, then you can probably grep the user, name, and value strings from its output and do it pretty cleanly. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Fri, Feb 20, 2009 at 05:52:09PM -0500, Brad Dixon wrote:> I''d like to ensure that I''ve set-up various gconf settings for users. > I cobbled together this little sad definition: > > define gconf($type, $value, $user) { > exec{"set $name to $value":You probably want "set $name to $value for $user" to avoid duplicates... Also, perhaps an "onlyif" parameter to avoid setting this every time (unless gconftool already checks current value and no-ops if no change is required). -- Marcin Owsiany <marcin@owsiany.pl> http://marcin.owsiany.pl/ GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216 "Every program in development at MIT expands until it can read mail." -- Unknown --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
> > It all seems a little verbose. Any suggestions on how to improve this? > Maybe trying to puppet manage gconf entries is a bad idea?It''s been a while since I''ve looked at automated configuring gnome, but I think the upstream suggested way to do this would be to use Sabayon to create and apply profiles, but that might not be suitable for your environment. http://projects.gnome.org/sabayon/ There still seems to be some activity on list and svn. Paul --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---