On 12/29/2010 12:44 AM, Dmytro Bablinyuk wrote:> Hi Everyone,
>
> I am trying to modify /etc/drbd.d/global_common.conf that in general
> looks like this
>
> ...
> net {
> # snd‐buf-size rcvbuf-size timeout connect-int ping-
> int ping-timeout max-buffers
> # max-epoch-size ko-count allow-two-primaries cram-
> hmac-alg shared-secret
> # after-sb-0pri after-sb-1pri after-sb-2pri data-
> integrity-alg no-tcp-cork
> }
>
> syncer {
> # rate after al-extents use-rle cpu-mask verify-alg
> csums-alg
> }
>
> At first I attempt to use augeas but looks like (according to augtool)
> it''s not making a tree out of the file
>
> root@puppet-client-ubuntu:~# augtool
> augtool> print /files/etc/drbd.d/global_common.conf
> augtool>
>
> The next option I have is to use regex to modify that file e.g. to run
> something like this ''s/syncer {/syncer {\n\t\trate 50M
;/''
The crude way would indeed be to use an exec of sed with an expression
like you suggest.
Note that more often than not, it will be a lot cleaner to template the
whole DRBD config and define sensible resource types that will spit out
the whole config the way you need it.
If you don''t want puppet to take full control over your files (and
assuming you are somewhat comfortable with hacking in ruby), writing
your own plugin would be superior to a sed solution.
Regards,
Felix
--
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.