microstack/snap-overlay/bin/set-default-config

108 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
set -ex
# Initialize Config
# TODO: put this in a nice yaml format, and parse it.
# General snap-wide settings
snapctl set \
config.clustered=false \
config.post-setup=true \
;
snapctl set \
config.keystone.region-name=microstack \
;
# Networking related settings.
snapctl set \
config.network.dns-servers=1.1.1.1 \
config.network.dns-domain=microstack.example. \
config.network.ext-gateway=10.20.20.1 \
config.network.control-ip=10.20.20.1 \
config.network.node-fqdn=`hostname -f` \
config.network.compute-ip=10.20.20.1 \
config.network.ext-cidr=10.20.20.1/24 \
config.network.security-rules=true \
config.network.dashboard-allowed-hosts="*" \
config.network.ports.dashboard=80 \
config.network.ports.mysql=3306 \
config.network.ports.rabbit=5672 \
config.network.external-bridge-name=br-ex \
config.network.physnet-name=physnet1 \
;
# Passwords, certs, etc.
snapctl set \
config.credentials.os-password=keystone \
config.credentials.key-pair="/home/{USER}/snap/{SNAP_NAME}/common/.ssh/id_microstack" \
config.credentials.nova-password=nova \
config.credentials.cinder-password=cinder \
config.credentials.neutron-password=neutron \
config.credentials.placement-password=placement \
config.credentials.glance-password=glance \
;
# Cinder volume backend config.
snapctl set \
config.cinder.setup-loop-based-cinder-lvm-backend=false \
config.cinder.loop-device-file-size=32G \
config.cinder.lvm-backend-volume-group=cinder-volumes \
;
# Host optimizations and fixes.
snapctl set \
config.host.ip-forwarding=false \
config.host.check-qemu=true \
;
# Enable or disable groups of services.
snapctl set \
config.services.control-plane=true \
config.services.hypervisor=true \
config.services.spice-console=true \
;
# Clustering roles
snapctl set \
config.cluster.role=control \
config.cluster.password=null \
;
# Uninstall stuff
snapctl set \
config.cleanup.delete-bridge=true \
config.cleanup.remove=true \
;
# Filebeat
snapctl set \
config.logging.datatag="" \
config.logging.host="localhost:5044" \
config.logging.custom-config="$SNAP_COMMON/etc/filebeat/filebeat-microstack.yaml" \
config.services.extra.enabled=false \
config.services.extra.filebeat=false \
;
# services won't start if disabled in install hook
# see https://github.com/snapcore/snapd/blob/53dd10a71d1754610eda2d3d776465b81b3281cd/wrappers/services.go#L139
snapctl stop --disable ${SNAP_NAME}.filebeat
# NRPE
snapctl set \
config.alerting.custom-config="$SNAP_COMMON/etc/nrpe/nrpe-microstack.cfg" \
config.services.extra.nrpe=false \
;
snapctl stop --disable ${SNAP_NAME}.telegraf
# Telegraf
snapctl set \
config.monitoring.ipmi="" \
config.monitoring.custom-config="$SNAP_COMMON/etc/telegraf/telegraf-microstack.conf" \
config.services.extra.telegraf=false \
;
snapctl stop --disable ${SNAP_NAME}.nrpe