{"id":20407836,"url":"https://github.com/restorando/chef-ip_finder","last_synced_at":"2025-04-12T15:21:37.549Z","repository":{"id":9660603,"uuid":"11599521","full_name":"restorando/chef-ip_finder","owner":"restorando","description":"ip_finder cookbook for Chef","archived":false,"fork":false,"pushed_at":"2013-08-06T18:20:06.000Z","size":112,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-26T09:51:16.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restorando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-23T04:24:15.000Z","updated_at":"2020-10-21T20:22:16.000Z","dependencies_parsed_at":"2022-09-08T22:11:57.415Z","dependency_job_id":null,"html_url":"https://github.com/restorando/chef-ip_finder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fchef-ip_finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fchef-ip_finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fchef-ip_finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restorando%2Fchef-ip_finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restorando","download_url":"https://codeload.github.com/restorando/chef-ip_finder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586265,"owners_count":21129006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:26:29.049Z","updated_at":"2025-04-12T15:21:37.524Z","avatar_url":"https://github.com/restorando.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"ip_finder Cookbook\n================\n\nThis library cookbook adds the class `Chef::IPFinder`. It allows you to find IP addresses in a specific node, given an IP scope or a network interface. It also has some utility methods to discover all the IP addresses in a node, or to guess the scope of a given ip address.\n\n\nUsage\n-----\n\nYou must include the recipe `ip_finder::default` in the node's run list before using `Chef::IPFinder`.\n\n\n### Finding IP addresses by scope\n\n`Chef::IPFinder` supports finding IP addresses by a list of properties called scope. Properties can be  IP protocol version (ie. ipv4, ipv6), network addressing private, global, multicast, unicast, etc.\n\nFor instance, you can build queries like these:\n\nFind all IPv4 addresses belonging to a private network:\n\n```ruby\nIPFinder.find(node, :private_ipv4)\n#=\u003e ['10.2.123.14', '192.168.1.14']\n```\n\nFind a public IPv6 address:\n```ruby\nIPFinder.find_one(node, :public_ipv6)\n#=\u003e '2600:3c00::f03c:91ff:fedf:f63c'\n```\n\nFind a multicast IPv4 address:\n```ruby\nIPFinder.find_one(node, :multicast_ipv4)\n#=\u003e '239.12.11.123'\n```\n\nFind all IPv4 addresses in node separated by scope:\n```ruby\nIPFinder.find_all(node)\n#=\u003e { \"node\" =\u003e [\"127.0.0.1\"], \"private\" =\u003e [\"10.20.112.32\"], \"public\" =\u003e [\"200.23.142.11\"] }\n```\n\nFind all IPv6 addresses in node separated by scope:\n```ruby\nIPFinder.find_all(node, :ipv6)\n#=\u003e { \"public\" =\u003e \"2600:3c00::f03c:91ff:fedf:f63c\" }\n```\n\n### Finding IP addresses by network interface\n\nYou can find IP addresses attached to a certain network interface like so:\n\nFind a private IPv4 address attached to `eth1`:\n```ruby\nIPFinder.find_by_interface(node, 'eth1', :private_ipv4)\n#=\u003e '192.168.1.14'\n```\n\nFind an IPv6 address attached to `eth0`:\n```ruby\nIPFinder.find_by_interface(node, 'eth0', :ipv6)\n#=\u003e '2600:3c00::f03c:91ff:fedf:f63c'\n```\n\nFind an IPv4 address attached to the loopback interface `lo`:\n\n```ruby\nIPFinder.find_by_interface(node, 'lo')\n#=\u003e '127.0.0.1'\n```\n\n\nLicense\n-------\n\nCopyright (c) 2013 Restorando\n\nMIT License\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestorando%2Fchef-ip_finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestorando%2Fchef-ip_finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestorando%2Fchef-ip_finder/lists"}