OpenStack in a snap!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

90 lines
2.5 KiB

#!/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 \
;
# Networking related settings.
snapctl set \
config.network.dns=1.1.1.1 \
config.network.ext-gateway=10.20.20.1 \
config.network.control-ip=10.20.20.1 \
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 \
;
# 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.neutron-password=neutron \
config.credentials.placement-password=placement \
config.credentials.glance-password=glance \
;
# 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 \
;
# Clustering roles
snapctl set \
cluster.role=control \
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