perhaps you should add a check :onlyif cannot find pattern(dns_search_path)
in resolv.conf,then puppet actions.


can you paste your full code . I didnot see the define or param class or
(custom type?)line_replace?
thank you~~~

>From China mainland[?]



On Thu, Jun 2, 2011 at 1:01 PM, Giovanni Bordello <g...@gentlemail.com>wrote:

> Hi guys,
>
> I've got /etc/resolve.conf managed by Puppet:
>
>        file { "/etc/resolv.conf":
>                ensure => present,
>                source =>
> "puppet:///modules/system/etc/resolv.conf.${dns_zone}.${dc_use}",
>                group   => "root",
>                owner => "root",
>                mode  => "0644"
>        }
>
>        if $dns_search_path {
>                line_replace { "/etc/resolv.conf":
>                        replacement => "search ${dns_search_path}",
>                        pattern => "search .*",
>                        require => File["/etc/resolv.conf"],
>                }
>        }
>
> The trouble is that the file is fetched from the server on every puppet
> agent run and line_replace() is then executed.
>
> info: Caching catalog for ssutt1ldv.example.com
> info: Applying configuration version '1306990268'
> --- /etc/resolv.conf    2011-06-02 16:46:22.000000000 +1200
> +++ /tmp/puppet-file.18828.0    2011-06-02 16:51:10.000000000 +1200
> @@ -1,3 +1,3 @@
> -search something.else.example.com
> +search example.com
>  nameserver 172.26.203.23
>  nameserver 172.27.203.23
> info: FileBucket got a duplicate file {md5}8a9e992c28b98fbc544d99512f54e657
> info: /Stage[main]/System::Files/File[/etc/resolv.conf]: Filebucketed
> /etc/resolv.conf to puppet with sum 8a9e992c28b98fbc544d99512f54e657
> notice: /Stage[main]/System::Files/File[/etc/resolv.conf]/content: content
> changed '{md5}8a9e992c28b98fbc544d99512f54e657' to
> '{md5}10e974d9fac3b24d638478ac1852d896'
> notice:
> /Stage[main]/System::Files/Line_replace[/etc/resolv.conf]/Exec[/usr/bin/perl
> -pi -e 's/search .*/search something.else.example.com/'
> '/etc/resolv.conf']/returns: executed successfully
> notice: Finished catalog run in 5.93 seconds
>
> Can I do something about it? For instance record the search path somewhere
> and only trigger the whole thing if it changes?
>
> For most servers the default path is good but some require a different one
> that I specify in their 'node { $dns_search_path = ... }'.
>
> Thanks!
>
> GiBo
>
> --
> 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.

<<35C.gif>>

Reply via email to