{"id":20622310,"url":"https://github.com/smoeding/puppet-gai","last_synced_at":"2025-04-15T12:33:32.689Z","repository":{"id":12073174,"uuid":"14660415","full_name":"smoeding/puppet-gai","owner":"smoeding","description":"Manage /etc/gai.conf with Puppet","archived":false,"fork":false,"pushed_at":"2023-12-14T08:49:50.000Z","size":90,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T20:12:14.176Z","etag":null,"topics":["ipv4","ipv6","puppet"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smoeding.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-11-24T11:58:37.000Z","updated_at":"2022-05-06T07:41:48.000Z","dependencies_parsed_at":"2023-11-11T15:23:44.362Z","dependency_job_id":"563f3e2f-4605-4f4d-abe4-94c4eddf5520","html_url":"https://github.com/smoeding/puppet-gai","commit_stats":{"total_commits":58,"total_committers":1,"mean_commits":58.0,"dds":0.0,"last_synced_commit":"c5ed6a3bd6dd98f707203e3edee847b7abcff558"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Fpuppet-gai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Fpuppet-gai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Fpuppet-gai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Fpuppet-gai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smoeding","download_url":"https://codeload.github.com/smoeding/puppet-gai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249072343,"owners_count":21208173,"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":["ipv4","ipv6","puppet"],"created_at":"2024-11-16T12:22:07.137Z","updated_at":"2025-04-15T12:33:32.641Z","avatar_url":"https://github.com/smoeding.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gai\n\n[![Build Status](https://github.com/smoeding/puppet-gai/actions/workflows/CI.yaml/badge.svg)](https://github.com/smoeding/puppet-gai/actions/workflows/CI.yaml)\n[![Puppet Forge](http://img.shields.io/puppetforge/v/stm/gai.svg)](https://forge.puppetlabs.com/stm/gai)\n[![License](https://img.shields.io/github/license/smoeding/puppet-gai.svg)](https://raw.githubusercontent.com/smoeding/puppet-gai/master/LICENSE)\n\n#### Table of Contents\n\n1. [Overview](#overview)\n2. [Module Description - What does the module do?](#module-description)\n3. [Setup - The basics of getting started with gai](#setup)\n    * [What gai affects](#what-gai-affects)\n    * [Beginning with gai](#beginning-with-gai)\n4. [Usage - Configuration options and additional functionality](#usage)\n5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)\n5. [Limitations - OS compatibility, etc.](#limitations)\n6. [Development - Guide for contributing to the module](#development)\n\n## Overview\n\nManage the configuration of the default address selection for IPv6 in `/etc/gai.conf`.\n\n## Module description\n\nRFC 3484 provides an algorithm to sort the result of a call to `getaddrinfo(3)` when multiple answers are returned. Especially for hosts connected to an IPv4 and an IPv6 network it might be necessary to modify these static rules. For Linux using the glibc implementation this can be done with the `/etc/gai.conf` configuration file. This module provides a way to manage this file in your environment.\n\n## Setup\n\n### What gai affects\n\nThe module creates and modifies the `/etc/gai.conf` file. The settings in this file can affect the order in which network addresses are used when connecting to a remote host. See [RFC 3484](https://www.ietf.org/rfc/rfc3484.txt) for details.\n\n### Beginning with gai\n\nDeclare the gai class to install an configuration file containing comments only. In this case the operating system enforces the default rules. [RFC 3484](https://www.ietf.org/rfc/rfc3484.txt) has the details.\n\n```puppet\nclass { 'gai': }\n```\n\n## Usage\n\n### Modify the precedence rules to prefer IPv4 addresses\n\nThe class parameter `precedence` takes a hash where the keys are netmasks and the associated values define the order in which these netmasks are checked. The following example shows a setup where IPv4 addresses are preferred when the destination host also has an IPv6 address.\n\n```puppet\nclass { 'gai':\n  precedence =\u003e {\n    '::/96'         =\u003e '20',\n    '2002::/16'     =\u003e '30',\n    '::/0'          =\u003e '40',\n    '::1/128'       =\u003e '50',\n    '::ffff:0:0/96' =\u003e '100',\n  }\n}\n```\n\nThere is also a builtin class that can be used as a shortcut for this configuration.\n\n```puppet\nclass { 'gai::preferipv4': }\n```\n\n## Reference\n\n### Classes\n\n#### Public Classes\n\n* `gai`: The main class which installs the `/etc/gai.conf` file.\n\n* `gai::preferipv4`: Installs a predefined set of preference rules that cause the system to prefer IPv4 addresses.\n\n#### Class: `gai`\n\nThe main class to manage the `/etc/gai.conf` file.\n\n##### Parameters (all optional)\n\n* `label`: A hash with netmask/precedence pairs for the label table. The precedence value should be an integer. It is used to define the order of evaluation.\n\n* `precedence`: A hash with netmask/precedence pairs for the precedence table. Again the precedence value should be an integer defining the order of evaluation.\n\n* `scopev4`: A hash with mask/value pairs for the scope table. Entries are added to the RFC 3484 scope table.\n\n* `reload`: Indicate if the config should be reloaded for every lookup. Valid options: 'yes', 'no' or undefined (which doesn't set any value in the file). Default: undef\n\n#### Class: `gai::preferipv4`\n\nThe class can be used as a shortcut to install a configuration where IPv4 addresses are prefered over IPv6 addresses.\n\n## Limitations\n\nThis module is only useful on systems using glibc and the `/etc/gai.conf` file. It is therefore probably limited to Linux only.\n\n## Development\n\nFeel free to send pull requests for new features. Documentation updates with real world configurations are especially appreciated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmoeding%2Fpuppet-gai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmoeding%2Fpuppet-gai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmoeding%2Fpuppet-gai/lists"}