func@xxxxxxxxxxxxx wrote:
I think others might find it useful since the get_hostname() function is essentially attempting to figure it out dynamically but there is no guarantee that it will guess correctly or as desired. Also, it does save some resources when it's being specified such that it's returned immediately without doing some network connections and such.
Just pushed a variation of this idea to git.
Instead of configuring the minion name in certmaster.conf, you configure
it in /etc/func/minion.conf.
I moved the guts of the existing utils.get_hostname to
func.utils.get_hostname_by_route. I also
added support to that of the minion_name attribute, and looking up the
hostname of the
listen_addr.
So now funcd behaviour should be more or less:
- use minion_name if it exists
- use the hostname of the ip in listen_addr if it exists
- try looking up the hostname by socket.gethostname()
- varify we haven't gotten loopback or localhost
- try the hostname of the ip of the interface that the route to
certmaster uses
It's not well tested yet, so could use some eyes.
Adrian
_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list