Re: [Puppet Users] augeas, rhel6, setm

2011-04-13 Thread Dominic Cleal
On 28/03/11 08:54, hai wu wrote:
 It turns out augeas on RHEL6 is 0.7.2, which does not have 'setm'
 command available. 'setm' is available in augeas release 0.8, which is
 available in EPEL, but not available for RHEL6 (the reason is the
 package is already in RHEL6, thus no package would be released in EPEL
 for this. 

The setm command is supported in 0.7.2, which you can check with
augtool.  From http://augeas.net/news.html:

0.7.2 - 2010-06-22
* new API call aug_setm to set/create multiple nodes simultaneously

I've just checked with augtool from the optional software channel on 6.1
and it's there.

 All I want to do is to put console=ttyS0 on all kernel lines in
 /etc/grub.conf. Since there is no such 'setm' available with augeas
 0.7.2, is there any other workaround using augeas? Or the only way is to
 ask RedHat to upgrade its augeas package on RHEL6?

It's deeper than this, as you'll need ruby-augeas 0.4.0 or the 0.3.0-2
RPM from EPEL (which was patched) to support setm.  These seem to be
missing for EPEL6 at the moment though... I've asked David to see if
0.4.0 can be pushed.

Once you've got that, you'll also need the patch from this issue to
support it in the Puppet provider which has to natively understand each
command:
http://projects.puppetlabs.com/issues/6494

Given all of the above, I'd consider using 'grubby' instead:

define boot_kernel_arg($arg, $value) {
exec { grubby-arg-$arg:
command = grubby --update-kernel DEFAULT --args '$arg=$value',
unless  = grubby --info DEFAULT | grep args= | grep
'$arg=$value',
}
}

boot_kernel_arg { kernel-console:
arg   = console,
value = ttyS0,
}

You might be able to do something involving ALL instead of DEFAULT too
(check the man page).

-- 
Dominic Cleal
Red Hat Consulting
m: +44 (0)7818 512168

-- 
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.



Re: [Puppet Users] augeas, rhel6, setm

2011-04-13 Thread hai wu
Thanks, but this would not work here, where we need 2 console (one for tty0,
one for ttyS1). Augeas could handle in this case ..

On Wed, Apr 13, 2011 at 6:40 AM, Dominic Cleal dcl...@redhat.com wrote:

 On 28/03/11 08:54, hai wu wrote:
  It turns out augeas on RHEL6 is 0.7.2, which does not have 'setm'
  command available. 'setm' is available in augeas release 0.8, which is
  available in EPEL, but not available for RHEL6 (the reason is the
  package is already in RHEL6, thus no package would be released in EPEL
  for this.

 The setm command is supported in 0.7.2, which you can check with
 augtool.  From http://augeas.net/news.html:

 0.7.2 - 2010-06-22
* new API call aug_setm to set/create multiple nodes simultaneously

 I've just checked with augtool from the optional software channel on 6.1
 and it's there.

  All I want to do is to put console=ttyS0 on all kernel lines in
  /etc/grub.conf. Since there is no such 'setm' available with augeas
  0.7.2, is there any other workaround using augeas? Or the only way is to
  ask RedHat to upgrade its augeas package on RHEL6?

 It's deeper than this, as you'll need ruby-augeas 0.4.0 or the 0.3.0-2
 RPM from EPEL (which was patched) to support setm.  These seem to be
 missing for EPEL6 at the moment though... I've asked David to see if
 0.4.0 can be pushed.

 Once you've got that, you'll also need the patch from this issue to
 support it in the Puppet provider which has to natively understand each
 command:
 http://projects.puppetlabs.com/issues/6494

 Given all of the above, I'd consider using 'grubby' instead:

 define boot_kernel_arg($arg, $value) {
exec { grubby-arg-$arg:
command = grubby --update-kernel DEFAULT --args '$arg=$value',
unless  = grubby --info DEFAULT | grep args= | grep
 '$arg=$value',
}
 }

 boot_kernel_arg { kernel-console:
arg   = console,
value = ttyS0,
 }

 You might be able to do something involving ALL instead of DEFAULT too
 (check the man page).

 --
 Dominic Cleal
 Red Hat Consulting
 m: +44 (0)7818 512168

 --
 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.



-- 
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.



[Puppet Users] augeas, rhel6, setm

2011-03-28 Thread hai wu
It turns out augeas on RHEL6 is 0.7.2, which does not have 'setm' command
available. 'setm' is available in augeas release 0.8, which is available in
EPEL, but not available for RHEL6 (the reason is the package is already in
RHEL6, thus no package would be released in EPEL for this.

All I want to do is to put console=ttyS0 on all kernel lines in
/etc/grub.conf. Since there is no such 'setm' available with augeas 0.7.2,
is there any other workaround using augeas? Or the only way is to ask RedHat
to upgrade its augeas package on RHEL6?

-- 
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.