Giuseppe Lavagetto has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/404307 )
Change subject: apt: make apt::conf happen before removing apt.conf
......................................................................
apt: make apt::conf happen before removing apt.conf
Else, we might end up with a period where packages are installed with an
invalid configuration and can fail to install, or even be installed at
wrong versions.
Change-Id: I321f86d185e642e810e72d21cbcdc964162b6f6e
---
M modules/apt/manifests/init.pp
1 file changed, 14 insertions(+), 8 deletions(-)
Approvals:
Giuseppe Lavagetto: Looks good to me, approved
jenkins-bot: Verified
Volans: Looks good to me, but someone else must approve
diff --git a/modules/apt/manifests/init.pp b/modules/apt/manifests/init.pp
index ed35d23..9f376a9 100644
--- a/modules/apt/manifests/init.pp
+++ b/modules/apt/manifests/init.pp
@@ -49,14 +49,6 @@
purge => $purge_sources,
}
- # This will munge /etc/apt/apt.conf that get's created during installation
- # process (either labs vmbuilder or d-i). Given the ones below exist, it is
- # no longer needed after the installation is over
- file { '/etc/apt/apt.conf':
- ensure => absent,
- notify => Exec['apt-get update'],
- }
-
if $use_proxy {
$http_proxy = "http://webproxy.${::site}.wmnet:8080"
@@ -66,12 +58,14 @@
priority => '80',
key => 'Acquire::http::Proxy::security.debian.org',
value => $http_proxy,
+ before => File['/etc/apt/apt.conf'],
}
apt::conf { 'security-cdn-debian-proxy':
ensure => present,
priority => '80',
key => 'Acquire::http::Proxy::security-cdn.debian.org',
value => $http_proxy,
+ before => File['/etc/apt/apt.conf']
}
} elsif $::operatingsystem == 'Ubuntu' {
apt::conf { 'security-ubuntu-proxy':
@@ -79,6 +73,7 @@
priority => '80',
key => 'Acquire::http::Proxy::security.ubuntu.com',
value => $http_proxy,
+ before => File['/etc/apt/apt.conf']
}
apt::conf { 'ubuntu-cloud-archive-proxy':
@@ -86,6 +81,7 @@
priority => '80',
key =>
'Acquire::http::Proxy::ubuntu-cloud.archive.canonical.com',
value => $http_proxy,
+ before => File['/etc/apt/apt.conf']
}
apt::conf { 'old-releases-proxy':
@@ -93,6 +89,7 @@
priority => '80',
key => 'Acquire::http::Proxy::old-releases.ubuntu.com',
value => $http_proxy,
+ before => File['/etc/apt/apt.conf']
}
} else {
fail("Unknown operating system '${::operatingsystem}'.")
@@ -150,5 +147,14 @@
priority => '90',
key => 'APT::Install-Recommends',
value => '0',
+ before => File['/etc/apt/apt.conf'],
+ }
+
+ # This will munge /etc/apt/apt.conf that get's created during installation
+ # process (either labs vmbuilder or d-i). Given the ones below exist, it is
+ # no longer needed after the installation is over
+ file { '/etc/apt/apt.conf':
+ ensure => absent,
+ notify => Exec['apt-get update'],
}
}
--
To view, visit https://gerrit.wikimedia.org/r/404307
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I321f86d185e642e810e72d21cbcdc964162b6f6e
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits