coreos-base/oem-packet: drop cloud-config

Ignition (starting with 0.14.0) will apply this configuration
instead. This also depends on coreos-metadata supporting
PACKET_PHONE_HOME_URL, which will be present starting in 0.8.0.
This commit is contained in:
Alex Crawford 2017-03-13 17:57:03 -07:00
parent 51e22be86d
commit 7504bbaef8
6 changed files with 21 additions and 79 deletions

View File

@ -1,31 +0,0 @@
#cloud-config
coreos:
units:
- name: oem-cloudinit.service
command: restart
runtime: yes
content: |
[Unit]
Description=Cloudinit from Packet metadata
[Service]
Type=oneshot
ExecStart=/usr/bin/coreos-cloudinit --oem=packet
- name: oem-phone-home.service
command: start
content: |
[Unit]
Description=Basic setup tasks to initialize the machine.
Wants=sys-devices-virtual-net-bond0.device
After=sys-devices-virtual-net-bond0.device
[Service]
Type=oneshot
ExecStart=/usr/share/oem/bin/phone-home.sh
oem:
id: packet
name: Packet
version-id: @@OEM_VERSION_ID@@
home-url: https://packet.net
bug-report-url: https://issues.coreos.com

View File

@ -0,0 +1,5 @@
ID=packet
VERSION_ID=@@OEM_VERSION_ID@@
NAME="Packet"
HOME_URL="https://packet.net"
BUG_REPORT_URL="https://issues.coreos.com"

View File

@ -1,13 +0,0 @@
#!/bin/bash
set -e
API_URL=$(curl -s https://metadata.packet.net/metadata | jq ".api_url" | sed -e 's/^"//' -e 's/"$//')
while ! wget --inet4-only --spider --quiet "${API_URL}/build_info.txt"; do
echo "$0: API unavailable: $API_URL" >&2
sleep 2
done
logger "Making a call to tell the packet API this machine is online."
curl -X POST $API_URL/phone-home
logger "This device has been announced to the packet API."

View File

@ -0,0 +1,13 @@
[Unit]
Description=Basic setup tasks to initialize the machine.
ConditionFirstBoot=true
Requires=coreos-metadata.service
After=coreos-metadata.service
[Service]
EnvironmentFile=/run/metadata/coreos
Type=oneshot
ExecStart=/usr/bin/curl --request POST "${COREOS_PACKET_PHONE_HOME_URL}"
[Install]
WantedBy=multi-user.target

View File

@ -1,30 +0,0 @@
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=5
DESCRIPTION="OEM suite for Packet images"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
# no source directory
S="${WORKDIR}"
src_prepare() {
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
}
src_install() {
into "/usr/share/oem"
dobin "${FILESDIR}/phone-home.sh"
dobin "${FILESDIR}/reset-interfaces.sh"
insinto "/usr/share/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
}

View File

@ -16,14 +16,12 @@ S="${WORKDIR}"
src_prepare() {
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
"${FILESDIR}/cloud-config.yml" > "${T}/cloud-config.yml" || die
"${FILESDIR}/oem-release" > "${T}/oem-release" || die
}
src_install() {
into "/usr/share/oem"
dobin "${FILESDIR}/phone-home.sh"
insinto "/usr/share/oem"
doins "${T}/cloud-config.yml"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/units"
}