mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
contrib/systemd: Add systemd build and deploy example
* docs: Compile bootcfg from source, start a systemd unit * Install bootcfg static binary to /usr/local/bin * Add default configs /etc/bootcfg.conf and /etc/bootcfg
This commit is contained in:
46
Documentation/deployment.md
Normal file
46
Documentation/deployment.md
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
# Deployment
|
||||
|
||||
## Binary
|
||||
|
||||
Clone the coreos-baremetal project into your $GOPATH.
|
||||
|
||||
go get github.com/coreos/coreos-baremetal
|
||||
cd $GOPATH/src/github.com/coreos/coreos-baremetal
|
||||
|
||||
Build `bootcfg` from source.
|
||||
|
||||
make
|
||||
|
||||
Install the `bootcfg` static binary to `/usr/local/bin`.
|
||||
|
||||
$ sudo make install
|
||||
|
||||
Run `bootcfg`
|
||||
|
||||
$ sudo bootcfg -version
|
||||
$ sudo bootcfg -address 0.0.0.0:8080
|
||||
main: starting bootcfg HTTP server on 0.0.0.0:8080
|
||||
|
||||
See [flags and variables](config.md).
|
||||
|
||||
### systemd
|
||||
|
||||
Add and start bootcfg's example systemd unit.
|
||||
|
||||
sudo cp contrib/systemd/bootcfg.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl start bootcfg.service
|
||||
|
||||
Check the logs with `journalctl`.
|
||||
|
||||
journalctl -u bootcfg.service
|
||||
|
||||
Enable the `bootcfg` service if you'd like it to start at boot time.
|
||||
|
||||
sudo systemctl enable bootcfg.service
|
||||
|
||||
### Uninstall
|
||||
|
||||
sudo systemctl stop bootcfg.service
|
||||
sudo make uninstall
|
||||
40
Makefile
Normal file
40
Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
BIN_DIR=/usr/local/bin
|
||||
CONF_DIR=/etc/bootcfg
|
||||
VAR_DIR=/var/bootcfg
|
||||
|
||||
CONF_FILE=/etc/bootcfg.conf
|
||||
ENV_FILE=/etc/bootcfg.env
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
./build
|
||||
|
||||
test:
|
||||
./test
|
||||
|
||||
install:
|
||||
cp bin/bootcfg $(BIN_DIR)
|
||||
cp -n examples/default.yaml $(CONF_FILE)
|
||||
touch $(ENV_FILE)
|
||||
mkdir -p $(CONF_DIR)/{profiles,ignition,cloud}
|
||||
mkdir -p $(VAR_DIR)
|
||||
cp -n -R examples/profiles $(CONF_DIR)
|
||||
cp -n -R examples/ignition $(CONF_DIR)
|
||||
cp -n -R examples/cloud $(CONF_DIR)
|
||||
@echo "*****************"
|
||||
@echo "bootcfg INSTALLED"
|
||||
@echo "*****************"
|
||||
@echo "bootcfg was installed to /usr/local/bin/bootcfg"
|
||||
@echo "The config file is located at /etc/bootcfg.conf"
|
||||
@echo "The environment file is located at /etc/bootcfg.env"
|
||||
|
||||
uninstall:
|
||||
rm $(BIN_DIR)/bootcfg
|
||||
rm $(CONF_FILE)
|
||||
rm $(ENV_FILE)
|
||||
rm -rf $(CONF_DIR)
|
||||
rm -rf $(VAR_DIR)
|
||||
|
||||
.PHONY: build
|
||||
@@ -23,6 +23,8 @@ CoreOS on Baremetal contains guides for network booting and configuring CoreOS c
|
||||
* [OpenPGP Signing](Documentation/openpgp.md)
|
||||
* [Flags](Documentation/config.md)
|
||||
* [API](Documentation/api.md)
|
||||
* Deployment
|
||||
* [systemd](Documentation/deployment.md#systemd)
|
||||
* [Troubleshooting](Documentation/troubleshooting.md)
|
||||
* [Hacking](Documentation/dev/develop.md)
|
||||
|
||||
|
||||
11
contrib/systemd/bootcfg.service
Normal file
11
contrib/systemd/bootcfg.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=CoreOS bootcfg Server
|
||||
Documentation=https://github.com/coreos/coreos-baremetal
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/etc/bootcfg.env
|
||||
ExecStart=/usr/local/bin/bootcfg -address=0.0.0.0:8080 -log-level=debug
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
6
examples/default.yaml
Normal file
6
examples/default.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
api_version: v1alpha1
|
||||
groups:
|
||||
- name: PXE Boot to CoreOS
|
||||
profile: pxe
|
||||
metadata:
|
||||
Reference in New Issue
Block a user