feat(coreos-base/oem-ami): Adding support for openstack and brightbox

Added USE flags for specifying the provider (ec2, openstack, or brightbox). Renamed to oem-ec2-compat.
This commit is contained in:
Alex Crawford 2014-04-10 18:50:39 -07:00
parent 64773d3e14
commit fd8a691ca4
9 changed files with 58 additions and 34 deletions

View File

@ -1,27 +0,0 @@
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
DESCRIPTION="OEM suite for AMI images"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE=""
# no source directory
S="${WORKDIR}"
src_install() {
into "/usr/share/oem"
dobin ${FILESDIR}/ec2-ssh-key
dobin ${FILESDIR}/coreos-setup-environment
dobin ${FILESDIR}/coreos-c10n
dobin ${FILESDIR}/etcd-bootstrap
insinto "/usr/share/oem"
doins ${FILESDIR}/cloud-config.yml
}

View File

@ -18,7 +18,7 @@ coreos:
runtime: yes
content: |
[Unit]
Description=Cloudinit from EC2 metadata
Description=Cloudinit from EC2-style metadata
Requires=coreos-setup-environment.service
After=coreos-setup-environment.service
@ -31,7 +31,7 @@ coreos:
runtime: yes
content: |
[Unit]
Description=Legacy c10n support from EC2 metadata
Description=Legacy c10n support from EC2-style metadata
Requires=ec2-cloudinit.service
After=ec2-cloudinit.service
ConditionPathIsMountPoint=!/usr
@ -41,10 +41,10 @@ coreos:
RemainAfterExit=no
ExecStart=/usr/share/oem/bin/coreos-c10n
oem:
id: ami
name: Amazon EC2
home-url: http://aws.amazon.com/ec2/
bug-report-url: https://github.com/coreos/coreos-overlay
id: @@OEM_ID@@
name: @@OEM_NAME@@
home-url: @@OEM_HOME_URL@@
bug-report-url: https://github.com/coreos/bugs/issues
write_files:
- path: /run/systemd/system/etcd.service.d/10-oem.conf
permissions: 0644

View File

@ -0,0 +1 @@
oem-ami-compat-0.0.1.ebuild

View File

@ -0,0 +1,51 @@
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
DESCRIPTION="OEM suite for EC2 compatible images"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="ec2 openstack brightbox"
REQUIRED_USE="^^ ( ec2 openstack brightbox )"
# no source directory
S="${WORKDIR}"
src_prepare() {
if use ec2 ; then
ID="ami"
NAME="Amazon EC2"
HOME_URL="http://aws.amazon.com/ec2/"
elif use openstack ; then
ID="openstack"
NAME="Openstack"
HOME_URL="https://www.openstack.org/"
elif use brightbox ; then
ID="brightbox"
NAME="Brightbox"
HOME_URL="http://brightbox.com/"
else
die "Unknown OEM!"
fi
sed -e "s\\@@OEM_ID@@\\${ID}\\g" \
-e "s\\@@OEM_NAME@@\\${NAME}\\g" \
-e "s\\@@OEM_HOME_URL@@\\${HOME_URL}\\g" \
${FILESDIR}/cloud-config.yml > ${T}/cloud-config.yml || die
}
src_install() {
into "/usr/share/oem"
dobin ${FILESDIR}/ec2-ssh-key
dobin ${FILESDIR}/coreos-setup-environment
dobin ${FILESDIR}/coreos-c10n
dobin ${FILESDIR}/etcd-bootstrap
insinto "/usr/share/oem"
doins ${T}/cloud-config.yml
}