mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-18 21:11:08 +02:00
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:
parent
64773d3e14
commit
fd8a691ca4
@ -1 +0,0 @@
|
||||
oem-ami-0.0.1.ebuild
|
@ -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
|
||||
}
|
@ -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
|
@ -0,0 +1 @@
|
||||
oem-ami-compat-0.0.1.ebuild
|
@ -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
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user