system-config/modules/openstack_project/manifests/server.pp
Colleen Murphy e203232abc Don't purge apt sources on infracloud
Without this change, puppetting an infracloud machine from scratch
results in an error[1]. The order of events that causes this issue is:

1) Puppet purges /etc/apt/sources.list, removing all of apt's knowledge
   of other sources
2) Puppet creates /etc/apt/sources.list.d/openstack-infra.list, but
   this will have no effect on apt's knowledge of other sources until
   an apt-get update is run
3) The puppet-openstack_extras module runs an exec to install the
   ubuntu-cloud-keyring package. (This is done with an exec type rather
   than a package type because it needs to be run before
   Exec['apt_update'] which is defined in the puppetlabs-apt module.)
   Since apt at this point knows of no apt sources in the world, it
   fails to find the package.
4) Apt-get update is run and the world is right again, so subsequent
   puppet runs or manual installs of ubuntu-cloud-keyring are
   confusingly successful.

A potential fix for this is to create another exec resource that runs
apt-get update after adding openstack-infra.list but before installing
ubuntu-cloud-keyring, after which apt-get update will run once again.
This is inefficient and ugly. Since on these particular nodes we
control the base images, and the default apt sources list is sane and
matches what we have set in openstack-infra.list anyway, we can just
disable the purging of the original sources.list and there will no
longer be any point during which apt has no sources.

[1] http://paste.openstack.org/show/488079/

Change-Id: I2cb375979d55e612fe8acc4cc7abdd393f39c2b9
2016-02-24 10:50:08 -08:00

39 lines
1.5 KiB
Puppet

# == Class: openstack_project::server
#
# A server that we expect to run for some time
class openstack_project::server (
$iptables_public_tcp_ports = [],
$iptables_public_udp_ports = [],
$iptables_rules4 = [],
$iptables_rules6 = [],
$sysadmins = [],
$certname = $::fqdn,
$pin_puppet = '3.',
$ca_server = undef,
$enable_unbound = true,
$afs = false,
$afs_cache_size = 500000,
$puppetmaster_server = 'puppetmaster.openstack.org',
$manage_exim = true,
$pypi_index_url = 'https://pypi.python.org/simple',
$purge_apt_sources = true,
) {
class { 'openstack_project::template':
iptables_public_tcp_ports => $iptables_public_tcp_ports,
iptables_public_udp_ports => $iptables_public_udp_ports,
iptables_rules4 => $iptables_rules4,
iptables_rules6 => $iptables_rules6,
certname => $certname,
pin_puppet => $pin_puppet,
ca_server => $ca_server,
puppetmaster_server => $puppetmaster_server,
enable_unbound => $enable_unbound,
afs => $afs,
afs_cache_size => $afs_cache_size,
manage_exim => $manage_exim,
sysadmins => $sysadmins,
pypi_index_url => $pypi_index_url,
purge_apt_sources => $purge_apt_sources,
}
}