blob: 54f33a2eb960b4e9b70d80b3beadda78f58df44d [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
EAPI=6
DESCRIPTION="Configuration of cloud-init for lakitu"
HOMEPAGE=""
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
IUSE="platform_aws platform_azure platform_gcp platform_vsphere default_cos_user"
DEPEND="app-emulation/cloud-init"
RDEPEND="
${DEPEND}
!<app-emulation/cloud-init-18.5-r4
"
S=${WORKDIR}
src_install() {
# override the default cloud.cfg
insinto /etc/cloud
if use platform_azure; then
doins "${FILESDIR}"/azure/cloud.cfg
else
doins "${FILESDIR}"/cloud.cfg
fi
doins "${FILESDIR}"/ds-identify.cfg
insinto /etc/cloud/cloud.cfg.d
# disable ssh publishing hostkeys for the gcp
if use platform_gcp; then
doins "${FILESDIR}/gcp/10-disable_ssh_publish_hostkeys.cfg"
fi
# enable platform specific configurations.
if use platform_aws; then
doins "${FILESDIR}"/aws/91-datasource.cfg
elif use platform_azure; then
doins "${FILESDIR}"/azure/10_hostname.cfg
doins "${FILESDIR}"/azure/91-datasource.cfg
elif use platform_vsphere; then
doins "${FILESDIR}"/vsphere/10_hostname.cfg
doins "${FILESDIR}"/vsphere/91-datasource.cfg
else
# by default we add [GCE, NoCloud, None] as the datasource.
doins "${FILESDIR}/gcp/91-datasource.cfg"
fi
# add default cos user
if use default_cos_user; then
doins "${FILESDIR}"/90-default-user.cfg
fi
}