Ask Your Question

Server-Facts: Get all IPs

asked 2016-03-29 10:23:18 -0600

SPQRInc gravatar image


I would like to add exceptions to fail2ban or lfd - so I need to know all ips of the node. In the documentation of the server-facts I only found the master-IP.

Is there a way how to get all ips?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-30 03:14:28 -0600

davemidd gravatar image

updated 2016-03-30 03:14:45 -0600

Something like this?

facter --puppet | grep ^ipaddress_

ipaddress_enp0s3 =>
ipaddress_enp0s8 =>
ipaddress_enp0s9 =>
ipaddress_lo =>
edit flag offensive delete link more


Hi davemidd and thank you very much for your answer. How could I use the output of that in a YAML or hiera-file or in a simple manifest? Something like ${serverips} ...?

SPQRInc gravatar imageSPQRInc ( 2016-03-30 03:31:58 -0600 )edit

You may need to make your own custom fact that could get all of those values and return them, I'm not sure if you can do a 'grep' style lookup of other facter facts within facter, but you could parse the information from some other means...

DarylW gravatar imageDarylW ( 2016-03-31 11:44:09 -0600 )edit

Perhaps the post I found the above on helps? (I just added the '_' to the regex to not return a duplicate address)

davemidd gravatar imagedavemidd ( 2016-03-31 12:08:01 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-03-29 10:23:18 -0600

Seen: 87 times

Last updated: Mar 30 '16