Always apt-get update after replacing sources

To avoid an unfortunate bootstrapping race, make sure we always run
`apt-get update` after replacing the sources list but before any
packages are installed.

Change-Id: I30b9cb3d6cbfa5df59dd1c1eef88bf486f96a52c
This commit is contained in:
Jeremy Stanley 2016-03-31 14:41:22 +00:00
parent 9e9dd6c3ce
commit 29fb53f95b

View File

@ -190,7 +190,8 @@ class openstack_project::template (
case $::osfamily {
'Debian': {
# Purge and augment existing /etc/apt/sources.list if requested
# Purge and augment existing /etc/apt/sources.list if requested, and make
# sure apt-get update is run before any packages are installed
class { '::apt':
purge => { 'sources.list' => $purge_apt_sources }
}
@ -202,6 +203,13 @@ class openstack_project::template (
owner => 'root',
source => "puppet:///modules/openstack_project/sources.list.${::lsbdistcodename}",
}
exec { 'update-apt':
command => 'apt-get update',
refreshonly => true,
path => '/bin:/usr/bin',
subscribe => File['/etc/apt/sources.list.d/openstack-infra.list'],
}
Exec['update-apt'] -> Package <| |>
}
# Make sure dig is installed