From ebf9f194a92a52804fdc007db1984f5f67573111 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 2 Jan 2018 18:55:33 -0200 Subject: Manage /etc/apt/apt.conf.d/1000-force-ipv4-transport --- manifests/subsystem/apt.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'manifests') diff --git a/manifests/subsystem/apt.pp b/manifests/subsystem/apt.pp index 387a4e8..409a9e3 100644 --- a/manifests/subsystem/apt.pp +++ b/manifests/subsystem/apt.pp @@ -4,12 +4,23 @@ class nodo::subsystem::apt( $hour = 2, $minute = 0, ) { + # See https://www.cyberciti.biz/faq/howto-use-apt-get-with-ipv6-or-ipv4-transport-on-ubuntu-debian/ + # https://unix.stackexchange.com/questions/370750/wget-uses-ipv6-address-and-takes-too-long-to-complete + file { '/etc/apt/apt.conf.d/1000-force-ipv4-transport': + ensure => absent, + owner => root, + group => root, + mode => '0644', + content => "Acquire::ForceIPv4 \"true\";\n", + } + file { '/etc/apt/sources.list': ensure => present, owner => root, group => root, mode => '0644', notify => Exec['nodo-apt-auto-update'], + require => File['/etc/apt/apt.conf.d/1000-force-ipv4-transport'], content => $ensure ? { 'present' => template("nodo/apt/${::operatingsystem}.sources.list.erb"), default => undef, -- cgit v1.2.3