what i thought would be a simple edit using augeas is turning out to not be
so straight forward, can anyone please help ?
the plan is to edit sendmail.cf and change the default DS to
DShostname.domain
class mail {
$key = DS
service {
''sendmail'':;
}
augeas { "sendmail.cf/$key":
context => "/files/etc/mail/sendmail.cf",
changes => "set $key mail.hostname.domain",
notify => Service[''sendmail''];
}
}
debug: Augeas[sendmail.cf/DS](provider=augeas): Opening augeas with root /,
lens path , flags 0
debug: Augeas[sendmail.cf/DS](provider=augeas): Augeas version 0.9.0 is
installed
debug: Augeas[sendmail.cf/DS](provider=augeas): Will attempt to save and
only run if files changed
debug: Augeas[sendmail.cf/DS](provider=augeas): sending command
''set'' with
params ["/files/etc/mail/sendmail.cf/DS",
"mail.hostname.domain"]
debug: Augeas[sendmail.cf/DS](provider=augeas): Skipping because no files
were changed
debug: Augeas[sendmail.cf/DS](provider=augeas): Closed the augeas connection
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/bAKjIzLscaYJ.
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.
might be easier to just use sed in a exec statement to replace all occurances of DS with DShostname.domain Ex: sed ''s/DS/c DShostname.domain'' /etc/mail/sendmail.cf On Thursday, January 24, 2013 2:28:34 PM UTC+10, kdo wrote:> > what i thought would be a simple edit using augeas is turning out to not > be so straight forward, can anyone please help ? > > the plan is to edit sendmail.cf and change the default DS to > DShostname.domain > > class mail { > $key = DS > > service { > ''sendmail'':; > } > augeas { "sendmail.cf/$key": > context => "/files/etc/mail/sendmail.cf", > changes => "set $key mail.hostname.domain", > notify => Service[''sendmail'']; > } > } > > > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > Opening augeas with root /, lens path , flags 0 > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > Augeas version 0.9.0 is installed > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > Will attempt to save and only run if files changed > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > sending command ''set'' with params ["/files/etc/mail/sendmail.cf/DS", > "mail.hostname.domain"] > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > Skipping because no files were changed > debug: Augeas[sendmail.cf/DS](provider=augeas)<http://sendmail.cf/DS%5D(provider=augeas)>: > Closed the augeas connection > > > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/m8UfPL9e84cJ. 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.
On 24/01/13 04:28, kdo wrote:> what i thought would be a simple edit using augeas is turning out to not > be so straight forward, can anyone please help ? > > the plan is to edit sendmail.cf and change the default DS to > DShostname.domain > > class mail { > $key = DS > > service { > ''sendmail'':; > } > augeas { "sendmail.cf/$key": > context => "/files/etc/mail/sendmail.cf", > changes => "set $key mail.hostname.domain", > notify => Service[''sendmail'']; > } > }There''s no Augeas lens for sendmail.cf files. From Puppet 3, it''ll now warn you if using context and a file wasn''t loaded. Otherwise check in augtool with "print" to see if the file can be loaded. Maybe use stdlib''s file_line type? -- Dominic Cleal Red Hat Engineering -- 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.
Seemingly Similar Threads
- Converting augeas snippet to puppet augeas resource
- Long processing time using Augeas
- [PATCH] inspect: Include more information for augeas parse errors (RHBZ#1229119)
- [PATCH] Rely on new augeas lens for modules.conf and conf.modules
- [PATCH] Improve augeas error reporting