Hi

I am looking at a way of maintaining my resolv.conf file and was trying to 
understand the example provided "unit_resolveconf.cf"

In this example, it looks like a class (am_name_server) is defined, but 
never used... Ok  I understand this, but I was looking to use it and 
expand on it.
In the example,
          "am_name_server" expression => 
reglist("@(nameservers)","$(sys.ipv4[eth1])");

Most of my servers have multiple interfaces and even ones with single 
interfaces will not always be eth1.
Additionally, I also have solaris that itself has different interface 
names.


My main question is how do I dynamically check a dynamic list of 
interfaces to a list of nameservers so that I can maintain a single class?

I hope I explained what I am trying to do.

Thanks,
Ian


body common control

                        "search abc.def.com"
                        };

 "nameservers" slist => {
                        "10.12.69.141",
                        "10.12.69.142",
                        "169.16.32.158",
                        "10.12.69.143"
                        };
classes:

  "am_name_server" expression => 
reglist("@(nameservers)","$(sys.ipv4[eth0])");
}

bundle agent resolver(s,n)

{
files:

  # When passing parameters down, we have to refer to
  # a source context

#  "$(sys.resolv)"  # test on "/tmp/resolv.conf" #
am_name_server::

  "/tmp/resolv.conf"  # test on "/tmp/resolv.conf" #

      create        => "true",
      edit_line     => doresolv("@(this.s)","@(this.n)"),
      edit_defaults => reconstruct;
 # or edit_defaults => modify

reports:
am_name_server::
  "I AM A NAME SERVER 1 $(sys.ipv4[eth0])";
  "I AM A NAME SERVER 2 $(sys.ipv4)";
 "I AM A NAME SERVER 3 @(g.nameservers)";




Jefferies archives and monitors outgoing and incoming e-mail. The contents of 
this email, including any attachments, are confidential to the ordinary user of 
the email address to which it was addressed. If you are not the addressee of 
this email you may not copy, forward, disclose or otherwise use it or any part 
of it in any form whatsoever. This email may be produced at the request of 
regulators or in connection with civil litigation. Jefferies accepts no 
liability for any errors or omissions arising as a result of transmission. Use 
by other than intended recipients is prohibited.  In the United Kingdom, 
Jefferies operates as Jefferies International Limited; registered in England: 
no. 1978621; registered office: Vintners Place, 68 Upper Thames Street, London 
EC4V 3BJ.  Jefferies International Limited is authorised and regulated by the 
Financial Services Authority.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to