Ask Your Question
0

Server-Facts: Get all IPs

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

SPQRInc gravatar image

Hello,

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
0

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

davemidd gravatar image

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

Something like this?

facter --puppet | grep ^ipaddress_

ipaddress_enp0s3 => 10.0.2.15
ipaddress_enp0s8 => 192.168.56.101
ipaddress_enp0s9 => 192.168.100.26
ipaddress_lo => 127.0.0.1
edit flag offensive delete link more

Comments

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 -0500 )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 -0500 )edit

Perhaps the post I found the above on helps? (I just added the '_' to the regex to not return a duplicate address) http://stackoverflow.com/a/18393161

davemidd gravatar imagedavemidd ( 2016-03-31 12:08:01 -0500 )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

2 followers

Stats

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

Seen: 46 times

Last updated: Mar 30 '16