Jeffrey Hulten
2008-Dec-08 06:52 UTC
[Puppet Users] Puppet Users] Re: Looking up information from the config...
Rodney, Do you have any examples of how you are using RALSH that you can share? Thanks, Jeff On Sun, Dec 7, 2008 at 7:31 PM, RodneyQ <imcocoy@gmail.com> wrote:> > Hi Jeffrey, > > I''m also new to puppet and currently using the ralsh to query > packages, services. > Hope others can also share their own info. :) > > Cheers, > Rodney > > > > On Dec 5, 6:41 am, Jeffrey Hulten <jhul...@gmail.com> wrote: > > Is there a way, in a puppet config, to query the current nodes config > > elements and use them in a template? My specific case is a JBOSS > > configuration with multiple instances on one server installation. I > > have the server configured as a class (with unpacking the zip file and > > making the server level changes), then each instance in a definition > > (making a copy of the default instance config and changing instance > > specific settings). > > > > The class needs to be able to look at the expected instances and make > > some server level config changes (like one line in a common config for > > each instance). > > > > Is this possible? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Dec-08 16:58 UTC
[Puppet Users] Re: Puppet Users] Re: Looking up information from the config...
On Dec 8, 2008, at 12:52 AM, Jeffrey Hulten wrote:> Rodney, > > Do you have any examples of how you are using RALSH that you can > share?I can give a few examples of how I use it, but I can''t promise this mode will fit all that way for others. I mostly use ralsh for investigation or ad-hoc administration. For investigation, you can use ralsh to inspect any resource or list of resources it can manage. For instance, inspect my user: $ sudo ralsh user luke Or get a list of all users: $ sudo ralsh user The same works for packages, or any other resource type Puppet can manage. It works great for ad-hoc administration, especially on platforms like OS X that don''t have tolerable CLI tools for some kinds of administration: $ sudo ralsh user luke ensure=present This creates a user, using the default provider. You can add or modify any fields you want: $ sudo ralsh user luke ensure=present shell=/usr/bin/bash And, of course, it''s just as idempotent as normal Puppet, so you can change the params and run it again if you want. Given the ability of ralsh to produce Puppet code, you can easily query state with ralsh and then copy the results into your manifests; or even scp or pipe the results to another host and execute it directly. And ralsh has a --host option that allows you to connect to remote hosts, if those remote hosts have enabled their ''resource'' API. That''s basically it -- ralsh is pretty simple, but it can be a great way to avoid learning your local operating system or to get around the lack of tools. I now don''t have to remember whether it''s rpm --erase or rpm --remove, even for ad-hoc administration. -- Always behave like a duck - keep calm and unruffled on the surface but paddle like the devil underneath. -- Jacob Braude --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RodneyQ
2008-Dec-09 06:02 UTC
[Puppet Users] Re: Puppet Users] Re: Looking up information from the config...
Hi Jeff, Here is my example: I tried to check the types(service,packages,users,..etc) then check it again with another exec. node nx.example.org { ... ... exec { "getservices": command => "ralsh service mysq l |grep enable > /tmp/retval", path=> "/bin:/usr/bin", } exec {"check_file_run": command => "/bin/echo ''replace or run a command here'' > /tmp/ out.txt", path=> "/bin:/usr/bin", onlyif => ["test -f /tmp/retval","grep -r true /tmp/ retval" ], require => Exec["getservices"] } } On Dec 8, 2:52 pm, "Jeffrey Hulten" <jhul...@gmail.com> wrote:> Rodney, > > Do you have any examples of how you are using RALSH that you can share? > > Thanks, > Jeff > > On Sun, Dec 7, 2008 at 7:31 PM, RodneyQ <imco...@gmail.com> wrote: > > > Hi Jeffrey, > > > I''m also new to puppet and currently using the ralsh to query > > packages, services. > > Hope others can also share their own info. :) > > > Cheers, > > Rodney > > > On Dec 5, 6:41 am, Jeffrey Hulten <jhul...@gmail.com> wrote: > > > Is there a way, in a puppet config, to query the current nodes config > > > elements and use them in a template? My specific case is a JBOSS > > > configuration with multiple instances on one server installation. I > > > have the server configured as a class (with unpacking the zip file and > > > making the server level changes), then each instance in a definition > > > (making a copy of the default instance config and changing instance > > > specific settings). > > > > The class needs to be able to look at the expected instances and make > > > some server level config changes (like one line in a common config for > > > each instance). > > > > Is this possible?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RodneyQ
2008-Dec-09 06:12 UTC
[Puppet Users] Re: Puppet Users] Re: Looking up information from the config...
Hi Luke,>And ralsh has a --host option that allows you to connect to >remote hosts, if those remote hosts have enabled their ''resource'' API.Can you please elaborate on this? How to enable the resource API? Is this just adding the listen option, port and include the namespaceauth.conf to puppetd? Thanks in advance. Rodney On Dec 9, 12:58 am, Luke Kanies <l...@madstop.com> wrote:> On Dec 8, 2008, at 12:52 AM, Jeffrey Hulten wrote: > > > Rodney, > > > Do you have any examples of how you are using RALSH that you can > > share? > > I can give a few examples of how I use it, but I can''t promise this > mode will fit all that way for others. > > I mostly use ralsh for investigation or ad-hoc administration. > > For investigation, you can use ralsh to inspect any resource or list > of resources it can manage. For instance, inspect my user: > > $ sudo ralsh user luke > > Or get a list of all users: > > $ sudo ralsh user > > The same works for packages, or any other resource type Puppet can > manage. > > It works great for ad-hoc administration, especially on platforms like > OS X that don''t have tolerable CLI tools for some kinds of > administration: > > $ sudo ralsh user luke ensure=present > > This creates a user, using the default provider. You can add or > modify any fields you want: > > $ sudo ralsh user luke ensure=present shell=/usr/bin/bash > > And, of course, it''s just as idempotent as normal Puppet, so you can > change the params and run it again if you want. > > Given the ability of ralsh to produce Puppet code, you can easily > query state with ralsh and then copy the results into your manifests; > or even scp or pipe the results to another host and execute it > directly. And ralsh has a --host option that allows you to connect to > remote hosts, if those remote hosts have enabled their ''resource'' API. > > That''s basically it -- ralsh is pretty simple, but it can be a great > way to avoid learning your local operating system or to get around the > lack of tools. I now don''t have to remember whether it''s rpm --erase > or rpm --remove, even for ad-hoc administration. > > -- > Always behave like a duck - keep calm and unruffled on the surface but > paddle like the devil underneath. -- Jacob Braude > --------------------------------------------------------------------- > Luke Kanies |http://reductivelabs.com|http://madstop.com--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---