Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: add getaddrinfo config to prefer IPv4 #3952

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ansible/roles/bootstrap/files/gai.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# getaddrinfo(3) configuration file
# Settings to prefer IPv4 addresses for hosts with limited IPv6 connectivity.

# Below settings are documented defaults but need to be duplicated since
# setting any precedence line means the default table is not used.
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20

# This line is changed from the default to give IPv4 higher precedence.
precedence ::ffff:0:0/96 100
11 changes: 11 additions & 0 deletions ansible/roles/bootstrap/tasks/partials/linuxonecc/rhel9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

# LinuxONE Community Cloud Red Hat Enterprise Linux 9

- name: Configure getaddrinfo to prefer IPv4 addresses
ansible.builtin.copy:
dest: /etc/gai.conf
group: root
mode: 0644
owner: root
src: "gai.conf"
8 changes: 8 additions & 0 deletions ansible/roles/bootstrap/tasks/partials/rhel8-s390x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@
insertafter: ":OUTPUT ACCEPT.*]"
line: "-A INPUT -s 127.0.0.2/32 -d 127.0.0.1/32 -j ACCEPT"
notify: restart iptables

- name: Configure getaddrinfo to prefer IPv4 addresses
ansible.builtin.copy:
dest: /etc/gai.conf
group: root
mode: 0644
owner: root
src: "gai.conf"