I want to add a server on top of the stack in ntp.conf like:

server time.example.com iburst
server 0.rhel.pool.ntp.org iburst
...

I came up with this:

  augeas { 'ntp.conf':
    context => '/files/etc/ntp.conf',
    changes => [
      'ins server before server[1]',
      'set server[1] time.example.com' ,
    ],
    onlyif  => 'match server[. = "time.example.com"] size == 0',
  }

This in fact adds "time.example.com" on top of "0.rhel.pool.ntp.org iburst"
but excludes "iburst" at the end of the line.

server time.example.com
server 0.rhel.pool.ntp.org iburst
...

I tried "'set server[1] "time.example.com iburst"' but get error "Could not
evaluate: Save failed with return code false."

augtool prints this:
/files/etc/ntp.conf/server[1] = "0.rhel.pool.ntp.org"
/files/etc/ntp.conf/server[1]/iburst

So the iburst line doesn't really have a variable.

How do I append "iburst" at the end of "time.example.com?"

Thanks,

-- 
Kent

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2BnSE387szbuxeLyAEW40YB4as2CuGDxQiEaghnUDXiLSKnwOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to