Hi John, I have solve that class issue. I have specified that as hostclass :'swift::proxy-ring' and it worked. My problem is I have to run the exec command in the script for which the Class "swift::proxy- install" is required. So, in general puppet DSL we will write that as follows:
exec {"somelabel": command => "command here", require => Class['swift::proxy-install'] } I need the equivalent Ruby DSL code. I have written the following: create_resource :exec, "some label", :command => "command here", :require => Class['swift::proxy-install']. Here I got error because I place Class['swift::proxy-install'] in require attribute. As Class is pre-defined in Ruby, we need to write it another way in Puppet DSL. I want that statement in Ruby DSL. Thanks in advance, Sateesh B. On Feb 8, 10:19 pm, jcbollinger <john.bollin...@stjude.org> wrote: > On Feb 8, 7:31 am, Walter Heck <walterh...@gmail.com> wrote: > > > Also no idea what you are trying to do, but your manifest should have > > .pp as it's extension. > > > On Wed, Feb 8, 2012 at 15:27, Felix Frank > > > <felix.fr...@alumni.tu-berlin.de> wrote: > > > On 02/08/2012 02:19 PM, sateesh wrote: > > >> Please give me any example for implementing this. Also when I am > > >> writing Puppet DSL, it is allowing me the dashes. > > > > Sorry, I have no idea what you're trying to do. I never heard of > > > "hostclass". > > He is writing in Ruby DSL, not Puppet DSL, which is why the file has > extension .rb. "hostclass" in Ruby DSL is analogous to "class" in > Puppet DSL. > > I am by no means well-versed in Ruby DSL, but it seems suspicious to > me that he is passing a String object to the hostclass() function when > that function's usual first argument is a symbol. It is possible that > manually converting the string to a symbol would solve the issue: > > hostclass "swift::proxy_ring".to_sym do > # ... > end > > Of course, that begs the question of why he wouldn't just write > > hostclass :'swift::proxy_ring' do > # ... > end > > My Ruby-fu is mediocre at best, but I think the quotes are required > because the symbol's string value contains colons. The initial colon > is definitely required as part of the syntax for a symbol literal. > > John -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.