> HI, everyone, is there a way to get local ip address in cfengine3?

Hi,

You could use the builtin variable for hostname $(sys.fqhost) and use that to 
get the ip from you nameservice

Perhaps something in the lines of:

"ip" string => execresult("host $(sys.fqhost) | sed -ne 's/$(sys.fqhost) has 
address ([.0-9]+)/\1/p' ","useshell")

This ofcourse only works if you can resolv the host in dns. Im sure others will 
object if this is a inappropriate method for determining ip address. :)

/Andreas Larsson



_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to