adding more flavors and nuo recipes
This commit is contained in:
104
recipes/nuo/provisionning/conf/common/templater.start
Normal file
104
recipes/nuo/provisionning/conf/common/templater.start
Normal file
@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Generate all the configuration files
|
||||
# Get all the values from the VLS_DIR
|
||||
# Process each template from the TPL_DIR with this values
|
||||
#
|
||||
|
||||
ENV_FILE=${ENV_FILE:-/var/run/one-context/one_env}
|
||||
TPL_DIR="/usr/share/builder/templates"
|
||||
VLS_DIR="/usr/share/builder/values"
|
||||
CONFIG=""
|
||||
|
||||
if [ -f "${ENV_FILE}" ]; then
|
||||
. ${ENV_FILE}
|
||||
fi
|
||||
|
||||
BTR="$(command -v btr)"
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
echo "Warning: Nothing to do the templater is not installed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -e "${TPL_DIR}" ]; then
|
||||
echo "Error: The template dir is missing (${TPL_DIR})"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e "${VLS_DIR}" ]; then
|
||||
echo "Error: The template dir is missing (${VLS_DIR})"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jsonQuery() {
|
||||
local data="${1}"
|
||||
local query="${2}"
|
||||
echo "${data}" | jq -cr "${query}"
|
||||
}
|
||||
|
||||
# NAME: @jsonMerge
|
||||
# AIM: Merge two json structures
|
||||
# NOTES:
|
||||
# The last one has de last word
|
||||
# if you have the same key in A and B
|
||||
# this keeps the value of the B structure.
|
||||
# PARAMS:
|
||||
# $1: original JSON Structure
|
||||
# $2: updated JSON Structure
|
||||
jsonMerge() {
|
||||
local data="${1}"
|
||||
local data2="${2}"
|
||||
|
||||
echo "${data} ${data2}" | jq -cr -s ".[0] * .[1]"
|
||||
}
|
||||
|
||||
jsonUpdateVal() {
|
||||
local json="${1}"
|
||||
local key="${2}"
|
||||
local value="${3}"
|
||||
|
||||
echo "${json}" | jq --arg a "${value}" "${key} = \$a"
|
||||
}
|
||||
|
||||
getValues() {
|
||||
|
||||
local values=""
|
||||
|
||||
for file in $(find ${VLS_DIR} -name "*.json"); do
|
||||
values="${values}$(cat ${file})"
|
||||
done
|
||||
|
||||
if [ -n "${RAW_CONFIG}" ]; then
|
||||
values="$(jsonMerge ${values} ${RAW_CONFIG})"
|
||||
fi
|
||||
|
||||
for svc in $(echo ${values} | jq -cr '.Services|keys[]'); do
|
||||
for key in $(echo ${values} | jq -cr ".Services.${svc}.Vars|keys[]"); do
|
||||
ukey=${key^^}
|
||||
vkeys="$(echo ${values} | jq -cr \".Services.${svc}.Vars.${key}\|keys[]\")"
|
||||
if [ ${?} -eq 0 ]; then
|
||||
for var in $(echo ${values} | jq -cr ".Services.${svc}.Vars.${key}|keys[]"); do
|
||||
uvar=${var^^}
|
||||
val=$(eval echo "\$${ukey}_${uvar}")
|
||||
if [ -n "${val}" ]; then
|
||||
values=$(jsonUpdateVal "${values}" ".Services.${svc}.Vars.${key}.${var}" "${val}")
|
||||
fi
|
||||
done
|
||||
else
|
||||
values=$(jsonUpdateVal "${values}" ".Services.${svc}.Vars.${key}" "${!ukey}")
|
||||
fi
|
||||
done
|
||||
done
|
||||
echo ${values}
|
||||
}
|
||||
|
||||
processTemplates() {
|
||||
${BTR} -t ${TPL_DIR} -c "${1}"
|
||||
}
|
||||
|
||||
VALUES=$(getValues)
|
||||
file=$(mktemp)
|
||||
echo "${VALUES}" > "${file}"
|
||||
processTemplates "${file}"
|
||||
rm -rf "${file}"
|
64
recipes/nuo/provisionning/conf/harbor/init.d/harbor
Executable file
64
recipes/nuo/provisionning/conf/harbor/init.d/harbor
Executable file
@ -0,0 +1,64 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
: ${SUBCFGDIR:=/srv}
|
||||
DOCKER_COMPOSE_UP_ARGS=${DOCKER_COMPOSE_UP_ARGS-"--no-build --no-recreate --no-deps"}
|
||||
|
||||
SUBSVC="${SVCNAME#*.}"
|
||||
[ -z "${SUBSVC}" ] && exit 1
|
||||
: ${SUBCFG:="${SUBCFGDIR}/${SUBSVC}/docker-compose.yml"}
|
||||
DOCOCMD="/usr/bin/docker-compose"
|
||||
export COMPOSE_HTTP_TIMEOUT=300
|
||||
|
||||
description="Manage docker services defined in ${SUBCFG}"
|
||||
extra_commands="configtest build"
|
||||
description_configtest="Check configuration via \"docker-compose -f ${SUBCFG} config\""
|
||||
description_build="Run \"docker-compose -f ${SUBCFG} build\""
|
||||
|
||||
depend() {
|
||||
need localmount net docker
|
||||
use dns
|
||||
after docker
|
||||
}
|
||||
|
||||
configtest() {
|
||||
if ! [ -f "${SUBCFG}" ]; then
|
||||
eerror "The config file ${SUBCFG} does not exist!"
|
||||
return 1
|
||||
fi
|
||||
if "${DOCOCMD}" -f "${SUBCFG}" config >&/dev/null; then
|
||||
einfo "config: ok"
|
||||
else
|
||||
eerror "config: error"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
configtest || return 1
|
||||
ebegin "Building dockerservice ${SUBSVC}"
|
||||
"${DOCOCMD}" -f "${SUBCFG}" build
|
||||
eend $?
|
||||
}
|
||||
|
||||
start() {
|
||||
configtest || return 1
|
||||
ebegin "Starting dockerservice ${SUBSVC}"
|
||||
sleep 5
|
||||
"${DOCOCMD}" -f "${SUBCFG}" up -d ${DOCKER_COMPOSE_UP_ARGS}
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping dockerservice ${SUBSVC}"
|
||||
"${DOCOCMD}" -f "${SUBCFG}" stop --timeout=300
|
||||
eend $?
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ "$("${DOCOCMD}" -f "${SUBCFG}" top | wc -l)" -gt "0" ]; then
|
||||
einfo "status: started"
|
||||
else
|
||||
einfo "status: stopped"
|
||||
return 3
|
||||
fi
|
||||
}
|
13
recipes/nuo/provisionning/conf/kind/initkind.start
Normal file
13
recipes/nuo/provisionning/conf/kind/initkind.start
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
CLUSTER_NAME="nuo"
|
||||
|
||||
if [ $(kind get clusters -q | grep "${CLUSTER_NAME}") ];then
|
||||
podman start -f name="^${CLUSTER_NAME}"
|
||||
else
|
||||
kind create cluster --config /etc/cluster.yaml | tee -a /var/log/kind-init.log
|
||||
fi
|
||||
|
||||
if [ ! $(which kubectl) ];then
|
||||
apk add kubectl --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||
fi
|
25
recipes/nuo/provisionning/conf/matchbox/initmatchbox.start
Normal file
25
recipes/nuo/provisionning/conf/matchbox/initmatchbox.start
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
FL_VERSIONS="current 3374.2.0"
|
||||
MATCHBOX_DIR="/var/lib/matchbox"
|
||||
ASSETS_DIR="${MATCHBOX_DIR}/assets/"
|
||||
|
||||
GPG_FNAME="Flatcar_Image_Signing_Key.asc"
|
||||
GPG_KEYS_URL="https://www.flatcar.org/security/image-signing-key/"
|
||||
|
||||
cd /tmp
|
||||
curl -L -O ${GPG_KEYS_URL}/${GPG_FNAME}
|
||||
gpg --import --keyid-format LONG ${GPG_FNAME}
|
||||
cd -
|
||||
|
||||
echo "Provisionning matchbox with flatcar images"
|
||||
tout=30
|
||||
for version in ${FL_VERSIONS}; do
|
||||
for i in $(seq 1 ${tout});do
|
||||
echo " * ${FL_VERSIONS} stable image (try ${i})"
|
||||
/usr/local/bin/get-flatcar stable ${version} ${ASSETS_DIR}
|
||||
if [[ "${?}" -eq 0 ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
10
recipes/nuo/provisionning/conf/matchbox/inittftp.start
Normal file
10
recipes/nuo/provisionning/conf/matchbox/inittftp.start
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
dest="${1}"
|
||||
|
||||
ipxeEFISource="http://boot.ipxe.org/ipxe.efi"
|
||||
kpxeSource="http://boot.ipxe.org/undionly.kpxe"
|
||||
|
||||
cd "${dest}"
|
||||
wget "${ipxeEFISource}"
|
||||
wget "${kpxeSource}"
|
38
recipes/nuo/provisionning/harbor.sh
Normal file
38
recipes/nuo/provisionning/harbor.sh
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
HARBOR_VERSION="2.8.2"
|
||||
HARBOR_SOURCE_URL="https://github.com/goharbor/harbor/releases/download/v${HARBOR_VERSION}/"
|
||||
HARBOR_INSTALLER="harbor-offline-installer-v${HARBOR_VERSION}.tgz"
|
||||
HARBOR_INSTALLER_ASC="${HARBOR_INSTALLER}.asc"
|
||||
export TERM=xterm
|
||||
|
||||
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --receive-keys 644FF454C0B4115C
|
||||
|
||||
cd /srv
|
||||
|
||||
wget -q ${HARBOR_SOURCE_URL}${HARBOR_INSTALLER}
|
||||
wget -q ${HARBOR_SOURCE_URL}${HARBOR_INSTALLER_ASC}
|
||||
|
||||
gpg -v --keyserver hkps://keyserver.ubuntu.com --verify ${HARBOR_INSTALLER}.asc
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Harbor sources ${HARBOR_SOURCE_URL}${HARBOR_INSTALLER} are corrupt"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
tar xzvf ${HARBOR_INSTALLER}
|
||||
|
||||
if [ ! -f ${HARBOR_SSL_CERT} ];then
|
||||
mkcert -install
|
||||
mkcert -cert-file ${HARBOR_SSL_CERT} -key-file ${HARBOR_SSL_KEY} ${HARBOR_DOMAIN}
|
||||
fi
|
||||
|
||||
cd harbor
|
||||
|
||||
ln -s /etc/harbor/harbor.yml .
|
||||
|
||||
service docker start
|
||||
sleep 5
|
||||
|
||||
./prepare
|
||||
./install.sh --with-notary --with-trivy
|
10
recipes/nuo/provisionning/kind.sh
Normal file
10
recipes/nuo/provisionning/kind.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Remove swap
|
||||
cat /etc/fstab | grep -v swap > temp.fstab
|
||||
cat temp.fstab > /etc/fstab
|
||||
rm temp.fstab
|
||||
swapoff -a
|
||||
|
||||
#lvremove -y /dev/vg0/lv_swap
|
||||
#lvextend -y -r -l +100%FREE /dev/vg0/lv_root
|
26
recipes/nuo/provisionning/letsencrypt.sh
Normal file
26
recipes/nuo/provisionning/letsencrypt.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
DESTDIR=/usr/local/share/ca-certificates
|
||||
UPDATE_CERTS_CMD=update-ca-certificates
|
||||
CERTS="$(cat <<EOF
|
||||
https://letsencrypt.org/certs/isrgrootx1.pem
|
||||
https://letsencrypt.org/certs/isrg-root-x2.pem
|
||||
https://letsencrypt.org/certs/lets-encrypt-r3.pem
|
||||
https://letsencrypt.org/certs/lets-encrypt-e1.pem
|
||||
https://letsencrypt.org/certs/lets-encrypt-r4.pem
|
||||
https://letsencrypt.org/certs/lets-encrypt-e2.pem
|
||||
EOF
|
||||
)"
|
||||
|
||||
cd "$DESTDIR"
|
||||
|
||||
for cert in $CERTS; do
|
||||
echo "Downloading '$cert'..."
|
||||
filename=$(basename "$cert")
|
||||
wget --tries=10 --timeout=30 -O "$filename" "$cert"
|
||||
#openssl x509 -in "$filename" -inform PEM -out "$filename.crt"
|
||||
done
|
||||
|
||||
$UPDATE_CERTS_CMD
|
39
recipes/nuo/provisionning/matchbox.sh
Normal file
39
recipes/nuo/provisionning/matchbox.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=0.10.0
|
||||
ARCH=amd64
|
||||
BIN="matchbox"
|
||||
FILENAME="matchbox-v${VERSION}-linux-${ARCH}.tar.gz"
|
||||
URL="https://github.com/poseidon/matchbox/releases/download/v${VERSION}/${FILENAME}"
|
||||
MATCHBOX_DIR="/var/lib/matchbox"
|
||||
ASSETS_DIR="${MATCHBOX_DIR}/assets/"
|
||||
TFTP_DIR="/var/lib/tftpboot"
|
||||
MATCHBOX_USER="matchbox"
|
||||
FL_VERSIONS="current 3374.2.0"
|
||||
|
||||
apk add wget
|
||||
|
||||
echo "Downloading matchbox"
|
||||
cd /tmp
|
||||
wget -q --show-progress "${URL}"
|
||||
tar -xzvf "${FILENAME}"
|
||||
cd ./matchbox-v${VERSION}-linux-${ARCH}
|
||||
|
||||
echo "Installing matchbox"
|
||||
cp ${BIN} /usr/local/bin
|
||||
|
||||
echo "Installing get-flatcar"
|
||||
cp ./scripts/get-flatcar /usr/local/bin
|
||||
chmod +x /usr/local/bin/get-flatcar
|
||||
|
||||
adduser "${MATCHBOX_USER}"
|
||||
mkdir -p "${ASSETS_DIR}"
|
||||
mkdir -p "${TFTP_DIR}"
|
||||
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${MATCHBOX_DIR}"
|
||||
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
|
||||
chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}"
|
||||
ls -lhaR ${ASSETS_DIR}
|
||||
|
||||
cp -rp ./scripts/tls /root
|
||||
|
||||
exit "${?}"
|
17
recipes/nuo/provisionning/nuo-3.18-install.sh
Normal file
17
recipes/nuo/provisionning/nuo-3.18-install.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
#set -xeo pipefail
|
||||
|
||||
# Run the installer
|
||||
setup-alpine -q
|
||||
#yes | setup-alpine -e -f /root/install.conf
|
||||
|
||||
# Copy ssh keys
|
||||
echo "Copy packer ssh key"
|
||||
mount /dev/vg0/lv_root /mnt
|
||||
cp -rp .ssh /mnt/root/
|
||||
sync
|
||||
umount /mnt
|
||||
|
||||
|
||||
echo "Rebooting the host after install"
|
||||
reboot -nf
|
23
recipes/nuo/provisionning/nuo-3.18-postinstall.sh
Normal file
23
recipes/nuo/provisionning/nuo-3.18-postinstall.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -xeo pipefail
|
||||
|
||||
apk add --no-cache wget curl jq haveged ca-certificates rsyslog bash shadow
|
||||
|
||||
rc-update add haveged boot
|
||||
rc-update add rsyslog boot
|
||||
rc-update add sshd boot
|
||||
|
||||
# Generate root password
|
||||
pass=$(openssl rand -base64 32 | tee -a .secret)
|
||||
chmod 600 .secret
|
||||
echo -e "${pass}\n${pass}" | passwd
|
||||
|
||||
# Remove expect package
|
||||
|
||||
# Prevent logs spamming like "process '/sbin/getty -L 0 ttyS0 vt100' (pid 2516) exited. Scheduling for restart."
|
||||
# We don't need an access to ttyS0
|
||||
sed -i 's@^\(ttyS0::respawn.*\)@#\1@' /etc/inittab
|
||||
|
||||
usermod --password $( echo "Cadoles;21" | openssl passwd -1 -stdin) root
|
||||
|
||||
sync
|
102
recipes/nuo/provisionning/one-context/net-96-templater
Normal file
102
recipes/nuo/provisionning/one-context/net-96-templater
Normal file
@ -0,0 +1,102 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Generate all the configuration files
|
||||
# Get all the values from the VLS_DIR
|
||||
# Process each template from the TPL_DIR with this values
|
||||
#
|
||||
|
||||
ENV_FILE=${ENV_FILE:-/var/run/one-context/one_env}
|
||||
TPL_DIR="/usr/share/builder/templates"
|
||||
VLS_DIR="/usr/share/builder/values"
|
||||
CONFIG=""
|
||||
|
||||
. ${ENV_FILE}
|
||||
|
||||
BTR="$(command -v btr)"
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
echo "Warning: Nothing to do the templater is not installed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -e "${TPL_DIR}" ]; then
|
||||
echo "Error: The template dir is missing (${TPL_DIR})"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -e "${VLS_DIR}" ]; then
|
||||
echo "Error: The template dir is missing (${VLS_DIR})"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jsonQuery() {
|
||||
local data="${1}"
|
||||
local query="${2}"
|
||||
echo "${data}" | jq -cr "${query}"
|
||||
}
|
||||
|
||||
# NAME: @jsonMerge
|
||||
# AIM: Merge two json structures
|
||||
# NOTES:
|
||||
# The last one has de last word
|
||||
# if you have the same key in A and B
|
||||
# this keeps the value of the B structure.
|
||||
# PARAMS:
|
||||
# $1: original JSON Structure
|
||||
# $2: updated JSON Structure
|
||||
jsonMerge() {
|
||||
local data="${1}"
|
||||
local data2="${2}"
|
||||
|
||||
echo "${data} ${data2}" | jq -cr -s ".[0] * .[1]"
|
||||
}
|
||||
|
||||
jsonUpdateVal() {
|
||||
local json="${1}"
|
||||
local key="${2}"
|
||||
local value="${3}"
|
||||
|
||||
echo "${json}" | jq --arg a "${value}" "${key} = \$a"
|
||||
}
|
||||
|
||||
getValues() {
|
||||
|
||||
local values=""
|
||||
|
||||
for file in $(find ${VLS_DIR} -name "*.json"); do
|
||||
values="${values}$(cat ${file})"
|
||||
done
|
||||
|
||||
if [ -n "${RAW_CONFIG}" ]; then
|
||||
values="$(jsonMerge ${values} ${RAW_CONFIG})"
|
||||
fi
|
||||
|
||||
for svc in $(echo ${values} | jq -cr '.Services|keys[]'); do
|
||||
for key in $(echo ${values} | jq -cr ".Services.${svc}.Vars|keys[]"); do
|
||||
ukey=${key^^}
|
||||
vkeys="$(echo ${values} | jq -cr \".Services.${svc}.Vars.${key}\|keys[]\")"
|
||||
if [ ${?} -eq 0 ]; then
|
||||
for var in $(echo ${values} | jq -cr ".Services.${svc}.Vars.${key}|keys[]"); do
|
||||
uvar=${var^^}
|
||||
val=$(eval echo "\$${ukey}_${uvar}")
|
||||
if [ -n "${val}" ]; then
|
||||
values=$(jsonUpdateVal "${values}" ".Services.${svc}.Vars.${key}.${var}" "${val}")
|
||||
fi
|
||||
done
|
||||
else
|
||||
values=$(jsonUpdateVal "${values}" ".Services.${svc}.Vars.${key}" "${!ukey}")
|
||||
fi
|
||||
done
|
||||
done
|
||||
echo ${values}
|
||||
}
|
||||
|
||||
processTemplates() {
|
||||
${BTR} -t ${TPL_DIR} -c "${1}"
|
||||
}
|
||||
|
||||
VALUES=$(getValues)
|
||||
file=$(mktemp)
|
||||
echo "${VALUES}" > "${file}"
|
||||
processTemplates "${file}"
|
||||
rm -rf "${file}"
|
21
recipes/nuo/provisionning/one-context/net-97-k3s
Normal file
21
recipes/nuo/provisionning/one-context/net-97-k3s
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ENV_FILE=${ENV_FILE:-/var/run/one-context/one_env}
|
||||
|
||||
# $TOKENTXT is available only through the env. file
|
||||
# shellcheck disable=SC1090
|
||||
if [ -f "${ENV_FILE}" ]; then
|
||||
. "${ENV_FILE}"
|
||||
fi
|
||||
|
||||
###
|
||||
|
||||
if [ -n "${K3S_ROLE}" ]; then
|
||||
if [ "${K3S_ROLE}" = "server" ]; then
|
||||
rc-update add dnsmasq default
|
||||
service dnsmasq start
|
||||
|
||||
rc-update add k3s default
|
||||
service k3s start
|
||||
fi
|
||||
fi
|
1
recipes/nuo/provisionning/ssh/cadoles/pcaseiro.pub
Normal file
1
recipes/nuo/provisionning/ssh/cadoles/pcaseiro.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDph3zh6ojSvH44k13z9B6xj+Hargo3uzkxnYv5s5NI4yagNuBXEc3aS++KdocND+FtVfLK+iVE8qHo2bvmpMmVkqU6WU2apN7DfIP0QGLlSGeo+UOZ9hGeEDlgVO4AOnZKZ5kPGBEPZ84JXuE9CmhKfwEVCK8w3B8XQttA8alFl4A4/4F14x2w4njsSLY1H3b0qah7hgYKU5zHIGLg8Lxx+1BxGIF0l5n5m5rqAskRNaF+aYbs0CcWHv49bPK0sJJ0qPV2r2sq8BlzuZFHExnZRIxpsIXdce4Bm4rdlGi7tBmmurLk4OOtDkwvhD0LMaNJf10k6QLSmRUTVzgsYz/dmGxopbMtwwIXkwi014uSZgi8wAuznXx5I4j2TUGPZHOVf+1iw/yaxWlgTVOSoX7ZxyhDgW5cCgZZGNzU5UWe0vUuVTB+hfSMj50/Q6+Vi92/mDMbPhm4nBoVzD5DT15mB+yGyN45Ej61m0JzVUyZexfvVaffEug1/u5dnwilP0WGKr4i2OXxOXtvSdAs5rlZjvppZk6IxRCwXIcPwEFL97ZrQZAxlVS5Nh+ZnlSwTe3zfQhzHj1ao0AdCAHFPUEdoUPJhSb0OjyCvZ9XZ1KCkXhuhuN/3IUhuoWl4soNCeC3KmU/USx1wda438Exj0hM1mTyBZScDPGyD9nw78DGw== Philippe Caseiro
|
1
recipes/nuo/provisionning/ssh/cadoles/vfebvre.pub
Normal file
1
recipes/nuo/provisionning/ssh/cadoles/vfebvre.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZxr8C81Dm5Zl2AtDzTVa8hFs04aV1z8ANrXYVHnLf7gEG4c1BI9iWbm94gVCQT4IvoKR5oZxjxGnx1a7VaX6h6dt33+p/s2IJiwG+9/DykPnImw+ALTcnMcyrwOYh68jnQIOGkYzK/VaHRzrvFNuoVWIU+FqfN+sW+bLQWi9v/K5oiup83xQBze6kjMEL2PT48bJwT/dQgP5cnTTEYwcOK/Yes1Cmb+VqjAs5B3uiHDoch10fy4b4duuALozPGhgoOfTLqe9Ekbt8PdIhUzGxFCw79W7IBA9vw79tYBy4B2et8Zb9sf+sMmxPINDkouYmfSnU0PjNjida7Tii2IEWbrb/qbSkRNcyIBmpGKz6VnSIvomv4FA9dGkOLYRyvTjAM6Shy5aiGV8F7T9hMxm3zGDjiVseyPVtMdSjM2SCx95uPCH5oSrj8M1OIjC2D+w3DsmTPFvTjA1gmKEYnXfFj82DvO+wDcbb6/DF2qS6y5rNpdnPWDb57iBqKeZISQ5x+h8arV0U3yItHoi7z4Cb51V29pdBE0xgFx5DE5akuPO3RC+BP0CK242HBdb94YXQCfmoQ1dV59mvu0ObAhP4CH/efOqONHXjTG9eurQyJWUr8yYO9DI7HkQHwvYDS7xuEO9yvs7gizm22FOTcxBPc4M/KFhPfnUs7Nyfw6I0Nw== vfebvre@cadoles.com
|
1
recipes/nuo/provisionning/ssh/cnous/nmelin.pub
Normal file
1
recipes/nuo/provisionning/ssh/cnous/nmelin.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOsoXFfQcqFp6+5QbB1o1ZpjCGeiPMM9aOK2DoZoMM/7 nicolas.melin@cnous.fr
|
1
recipes/nuo/provisionning/ssh/cnous/operrot.pub
Normal file
1
recipes/nuo/provisionning/ssh/cnous/operrot.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCwyKvtyfZibpHNDDsfg7N6PHPnv9AzA2PowGd7iqF6YRv6CgGPnUixWE791bmekr57TR1QwW58aSEPSQMfLBwo0OwZ7GXYbOb9Fdb6WHAUJHSyMNsFvakgjq0g7TERMw3UksiYpUBCLgvWhF5jNjKsXgK3LyMUVqJs9KlUBt6elxy3CWoMYaWVJTQwXqLEbvr7W9F1rb9PQi80vxcSZXgk5XPPZH4vh7oN7GLB5UwaTFRh4lcup0xnV938gSgLxttPg4t5li5cmvXXMgtCrIDj7JPh9Cic+UXo80cV14nOpX23nuu408Veys/4p5tYiYFCg6NnUtW2dJrfyga9W1h6nc/6JaY8aXdoE+pi7lL7XrMvJPQxVYdwA9rPUBSZAIOmZQQx2aKFMsXocyVXQDzLQyg8lAF9gbMkjXH7DluXd+s0OAdijW9VFxhjutojaC76vhH+ZqSq511vdCTuq+6juW/By/pYQRtKiL1jJqfQoC+JU8RmOVOml5ciT7I0OM/0dakdIMYINX1FaRuSYb8wm0k3pKh+PGmMigja5lY7Bv8M89gRRw+8bJ42h5XkR0Jd04Wagd9eFXvaLa9OdarwF5rE2d6NM5Gfr2wJ4XuDMC7C3r/b6U3sZr6CWvQ5URrXS9OLtZG09DtEGIIuMcu0pgqclitVDi06Ffz5dZMnVQ== olivier.perrot@cnous.fr
|
23
recipes/nuo/provisionning/templater-install.sh
Normal file
23
recipes/nuo/provisionning/templater-install.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
TOOL_DIR="${1:-/usr/local/bin}"
|
||||
TOOL_USER="${2:-root}"
|
||||
TOOL_GROUP="${3:-root}"
|
||||
ATTACHMENT_URL="https://forge.cadoles.com/attachments/"
|
||||
|
||||
installTool() {
|
||||
NAME="${1}"
|
||||
URL="${2}"
|
||||
|
||||
curl -k -o ${TOOL_DIR}/${NAME} ${URL}
|
||||
chmod +x ${TOOL_DIR}/${NAME}
|
||||
}
|
||||
|
||||
apk add curl
|
||||
|
||||
# Install templater
|
||||
installTool "tpr" "https://forge.cadoles.com/attachments/242b3cba-8d07-4b89-80ab-7c12253a8524"
|
||||
# Install bootstraper
|
||||
installTool "btr" "https://forge.cadoles.com/attachments/e8442b2a-2065-4282-b4a4-648681fa044c"
|
27
recipes/nuo/provisionning/tools/additionnal-disk
Normal file
27
recipes/nuo/provisionning/tools/additionnal-disk
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Quick and dirty script to add disk space
|
||||
# It creates a new PV (with the additionnal disk),
|
||||
# a new VG and a new LV with 100% disk space
|
||||
# The names and devices are provided with env variables:
|
||||
# - PV_DEVICE : The /dev/xxx device
|
||||
# - VG_NAME: The new vg name
|
||||
# - LV_NAME: Then new lv name
|
||||
# - LV_MTP: The mount point for the FS created on the LV
|
||||
# - LV_FS: The fstype of the new FS
|
||||
#
|
||||
if [ -e ${PV_DEVICE} ]; then
|
||||
pvcreate ${PV_DEVICE}
|
||||
vgcreate ${VG_NAME} ${PV_DEVICE}
|
||||
lvcreate -Ay -l 100%FREE -n ${LV_NAME} ${VG_NAME}
|
||||
mkfs.${LV_FS} /dev/${VG_NAME}/${LV_NAME}
|
||||
if [ ! -d ${LV_MTP} ]; then
|
||||
mkdir -p ${LV_MTP}
|
||||
fi
|
||||
mount /dev/${VG_NAME}/${LV_NAME} ${LV_MTP}
|
||||
echo "/dev/${VG_NAME}/${LV_NAME} ${LV_MTP} ${LV_FS} rw,relatime 0 1" >> /etc/fstab
|
||||
else
|
||||
echo "${PV_DEVICE} is missing"
|
||||
exit 3
|
||||
fi
|
Reference in New Issue
Block a user