Commit 69771c77 authored by Vangelis Koukis's avatar Vangelis Koukis
Browse files

Migrate default settings to files under conf/

Migrate default settings to files under conf/ for every
Synnefo component.

TODO: Obliterate snf-cyclades-app/synnefo/appt_settings/default/*
and similar files. Make import of synnefo settings common throughout
the code.
parent 1e61d1ce
## -*- coding: utf-8 -*-
##
## Admin names and email addresses
###################################
#
#ADMINS = (
# # ('Your Name', 'your_email@domain.com'),
#)
#
#MANAGERS = ADMINS
#
## Email configuration
#EMAIL_HOST = "127.0.0.1"
#EMAIL_HOST_USER = ""
#EMAIL_HOST_PASSWORD = ""
#EMAIL_SUBJECT_PREFIX = "[email-subject-prefix] "
#DEFAULT_CHARSET = 'utf-8'
#
## Address to use for outgoing emails
#DEFAULT_FROM_EMAIL = "~okeanos <no-reply@grnet.gr>"
## -*- coding: utf-8 -*-
##
## Ganeti backend configuration
####################################
#
## This prefix gets used when determining the instance names
## of Synnefo VMs at the Ganeti backend.
## The dash must always appear in the name!
#BACKEND_PREFIX_ID = "snf-"
#
## The following dictionary defines deployment-specific
## arguments to the RAPI CreateInstance call.
## At a minimum it should contain the
## 'disk_template', 'os_provider', and 'hvparams' keys.
##
## More specifically:
## a) disk_template:
## The disk template to use when creating the instance.
## Suggested values: 'plain', or 'drbd'.
## b) os:
## The OS provider to use (customized Ganeti Instance Image)
## c) hvparams:
## Hypervisor-specific parameters (serial_console = False, see #785)
## d) If using the DRBD disk_template, you may want to include
## wait_for_sync = False (see #835).
##
#GANETI_CREATEINSTANCE_KWARGS = {
# 'os': 'snf-image+default',
# 'hvparams': {'serial_console': False},
# 'wait_for_sync': False}
#
## If True, qemu-kvm will hotplug a NIC when connecting a vm to
## a network. This requires qemu-kvm=1.0.
#GANETI_USE_HOTPLUG = False
#
## This module implements the strategy for allocating a vm to a backend
#BACKEND_ALLOCATOR_MODULE = "synnefo.logic.allocators.default_allocator"
## Refresh backend statistics timeout, in minutes, used in backend allocation
#BACKEND_REFRESH_MIN = 15
#CLOUDBAR_ACTIVE = True
#CLOUDBAR_LOCATION = 'https://accounts.okeanos.grnet.gr/static/im/cloudbar/'
#CLOUDBAR_COOKIE_NAME = '_pithos2_a'
#CLOUDBAR_ACTIVE_SERVICE = 'cloud'
#CLOUDBAR_SERVICES_URL = 'https://accounts.okeanos.grnet.gr/im/get_services'
#CLOUDBAR_MENU_URL = 'https://accounts.okeanos.grnet.gr/im/get_menu'
#
## -*- coding: utf-8 -*-
##
## Plankton configuration
#########################
#
## Backend settings
#BACKEND_DB_CONNECTION = 'sqlite:////usr/share/synnefo/pithos/backend.db'
#BACKEND_BLOCK_PATH = '/usr/share/synnefo/pithos/data/'
#
## The Pithos container where images will be stored by default
#DEFAULT_PLANKTON_CONTAINER = 'images'
#
#ALLOWED_DISK_FORMATS = ('diskdump', 'extdump', 'ntfsdump')
#DEFAULT_DISK_FORMAT = 'diskdump'
#
#ALLOWED_CONTAINER_FORMATS = ('aki', 'ari', 'ami', 'bare', 'ovf')
#DEFAULT_CONTAINER_FORMAT = 'bare'
#
## The owner of the images that will be marked as "system images" by the UI
#SYSTEM_IMAGES_OWNER = 'okeanos'
## -*- coding: utf-8 -*-
##
## Queues, exchanges and bindings for AMQP
############################################
#
## List of RabbitMQ endpoints
#AMQP_HOSTS = ["amqp://username:password@host:port"]
## AMQP Backend Client. Currently only puka
#AMQP_BACKEND = 'puka'
#
#EXCHANGE_GANETI = "ganeti" # Messages from Ganeti
## -*- coding: utf-8 -*-
##
## UI settings
####################
#
## API URL
#COMPUTE_API_URL = '/api/v1.1'
#
## base url for ui static files
## if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
#UI_MEDIA_URL = '/static/ui/static/snf/'
#
## UI requests to the API layer time out after that many milliseconds
#TIMEOUT = 10 * 1000
#
## A list of suggested server tags (server metadata keys)
#DEFAULT_KEYWORDS = ["OS", "Role", "Location", "Owner"]
#
## A list of allowed icons for OS Images
#IMAGE_ICONS = ["redhat", "ubuntu", "debian", "windows", "gentoo", "archlinux",
# "centos", "fedora", "freebsd", "netbsd", "openbsd", "slackware",
# "suse", "kubuntu"]
#
## How often should the UI request changes from the API
#UI_UPDATE_INTERVAL = 5000
#
## Milieconds to increase the interval after UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT calls
## of recurrent api requests
#UI_UPDATE_INTERVAL_INCREASE = UI_UPDATE_INTERVAL / 4
#UI_UPDATE_INTERVAL_INCREASE_AFTER_CALLS_COUNT = 4
#
## Maximum update interval
#UI_UPDATE_INTERVAL_MAX = UI_UPDATE_INTERVAL * 3
#
## Fast update interval
#UI_UPDATE_INTERVAL_FAST = UI_UPDATE_INTERVAL / 2
#
## Miliseconds to remove from the previous server response time used in
## consecutive API calls (aligning changes-since attribute).
#UI_CHANGES_SINCE_ALIGNMENT = 0
#
## List of emails used for sending the feedback messages to (following the ADMINS format)
#FEEDBACK_CONTACTS = (
# # ('Contact Name', 'contact_email@domain.com'),
#)
#
## Email from which the feedback emails will be sent from
#FEEDBACK_EMAIL_FROM = "~okeanos <no-reply@grnet.gr>"
#
## URL to redirect not authenticated users
#UI_LOGIN_URL = "/im/login"
#
## URL to redirect user to when he logs out from the ui
#UI_LOGOUT_URL = "/im/logout"
#
## Cookie name to retrieve authentication data from
#UI_AUTH_COOKIE_NAME = '_pithos2_a'
#
## Flavor options that we provide to the user as predefined
## cpu/ram/disk combinations on vm create wizard
#VM_CREATE_SUGGESTED_FLAVORS = {
# 'small': {
# 'cpu': 1,
# 'ram': 1024,
# 'disk': 20,
# 'disk_template': 'drbd'
# },
# 'medium': {
# 'cpu': 2,
# 'ram': 2048,
# 'disk': 30,
# 'disk_template': 'drbd'
#
# },
# 'large': {
# 'cpu': 4,
# 'ram': 4096,
# 'disk': 40,
# 'disk_template': 'drbd'
#
# }
#}
#
## A list of metadata keys to clone from image
## to the virtual machine on its creation.
#VM_IMAGE_COMMON_METADATA = ["OS", "loginname", "logindomain", "users", "remote"]
#
## A list of suggested vm roles to display to user on create wizard
#VM_CREATE_SUGGESTED_ROLES = ["Database server", "File server", "Mail server", "Web server", "Proxy"]
#
## Template to be used for suggesting the user a default name for newly created
## vms. {0} gets replaced by the image OS value
#VM_CREATE_NAME_TPL = "My {0} server"
#
## Template to use to build vm hostname
#UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.okeanos.grnet.gr'
#
## Name/description metadata for the available flavor disk templates
## Dict key is the disk_template value as stored in database
#UI_FLAVORS_DISK_TEMPLATES_INFO = {
# 'drbd': {'name': 'DRBD',
# 'description': 'DRBD storage.'},
#}
#
## Override default connect prompt messages. The setting gets appended to the
## ui default values so you only need to modify parameters you need to alter.
##
## Indicative format:
## {
## '<browser os1>': {
## '<vm os family1>': ['top message....', 'bottom message'],
## '<vm os family 2>': ['top message....', 'bottom message'],
## 'ssh_message': 'ssh %(user)s@%(hostname)s'
## }
##
## you may use the following parameters to format ssh_message:
##
## * server_id: the database pk of the vm
## * ip_address: the ipv4 address of the public vm nic
## * hostname: vm hostname
## * user: vm username
##
## you may assign a callable python object to the ssh_message, if so the above
## parameters get passed as arguments to the provided object.
#UI_CONNECT_PROMPT_MESSAGES = {}
#
## extend rdp file content. May be a string with format parameters similar to
## those used in UI_CONNECT_PROMPT_MESSAGES `ssh_message` or a callable object.
#UI_EXTRA_RDP_CONTENT = None
#
#
########################
## UI BEHAVIOUR SETTINGS
########################
#
## Whether to increase the time of recurrent requests (networks/vms update) if
## window loses its focus
#UI_DELAY_ON_BLUR = False
#
## Whether not visible vm views will update their content if vm changes
#UI_UPDATE_HIDDEN_VIEWS = False
#
## After how many timeouts of reccurent ajax requests to display the timeout
## error overlay
#UI_SKIP_TIMEOUTS = 1
#
## Whether UI should display error overlay for all Javascript exceptions
#UI_HANDLE_WINDOW_EXCEPTIONS = True
#
## A list of os names that support ssh public key assignment
#UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu',
# 'centos', 'archlinux']
#
## OS/username map to identify default user name for the specified os
#UI_OS_DEFAULT_USER_MAP = {
# 'debian':'root', 'fedora': 'root', 'okeanos': 'root',
# 'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
# 'windows': 'Administrator'
#}
#
###########################
## UI NETWORK VIEW SETTINGS
###########################
#
## Available network types for use to choose when creating a private network
## If only one set, no select options will be displayed
#UI_NETWORK_AVAILABLE_NETWORK_TYPES = {'PRIVATE_MAC_FILTERED': 'mac-filtering'}
#
## Suggested private networks to let the user choose from when creating a private
## network with dhcp enabled
#UI_NETWORK_AVAILABLE_SUBNETS = ['10.0.0.0/24', '192.168.0.0/24']
#
## UI will use this setting to find an available network subnet if user requests
## automatic subnet selection.
#UI_AUTOMATIC_NETWORK_RANGE_FORMAT = "192.168.%d.0/24"
#
## Whether to display already connected vm's to the network connect overlay
#UI_NETWORK_ALLOW_DUPLICATE_VM_NICS = False
#
## Whether to display destroy action on private networks that contain vms. If
## set to True, destroy action will only get displayed if user disconnect all
## virtual machines from the network.
#UI_NETWORK_STRICT_DESTROY = True
#
## Whether or not to group public networks nics in a single network view
#UI_GROUP_PUBLIC_NETWORKS = True
#
## The name of the grouped network view
#UI_GROUPED_PUBLIC_NETWORK_NAME = 'Internet'
#
#
################
## UI EXTENSIONS
################
#
## Glance images API endpoint
#UI_GLANCE_API_URL = '/plankton'
#
## Whether or not UI should display images from the Glance API
## set in UI_GLANCE_API_URL, if setting is set to False, ui will
## request images from Compute API
#UI_ENABLE_GLANCE = True
#
## a dict of image owner ids and their associate name
## to be displayed on images list
#UI_SYSTEM_IMAGES_OWNERS = {
# 'admin@synnefo.gr': 'system',
# 'images@synnefo.gr': 'system'
#}
#
## -*- coding: utf-8 -*-
##
## Userdata settings
####################
#
## Genetared SSH key bits length
#USERDATA_SSH_KEY_LENGTH = 2048
#
## Generated SSH key exponent
#USERDATA_SSH_KEY_EXPONENT = 65537
#
## Maximum number of ssh keys a user is allowed to have
#USERDATA_MAX_SSH_KEYS_PER_USER = 10
#!/bin/sh
#
# This file is a shell script to be sourced by the appropriate
# init.d script
#
VERBOSE=yes
# Run as a daemon? true/false
SNF_DSPTCH_ENABLE=true
# User to run the dispatcher as
SNF_USER="www-data"
SNF_DSPTCH_OPTS="--workers=2"
#!/bin/sh
### BEGIN INIT INFO
# Provides: snf-dispatcher
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Synnefo dispatcher daemon
# Description: Dispatcher is a daemon for the synnefo middleware logic layer
### END INIT INFO
set -e
# /etc/init.d/snf-dispatcher: start and stop the dispatcher daemon
DAEMON=/usr/bin/snf-dispatcher
SNF_DSPTCH_OPTS=''
SNF_DSPTCH_DEFAULTS_FILE=/etc/default/snf-dispatcher
SNF_DSPTCH_RUNDIR=/var/run/synnefo
SNF_DSPTCH_PID_FILE=$SNF_DSPTCH_RUNDIR/snf_dispatcher.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
if [ -s $SNF_DSPTCH_DEFAULTS_FILE ]; then
. $SNF_DSPTCH_DEFAULTS_FILE
SNF_DSPTCH_OPTS=$SNF_DSPTCH_OPTS" -p $SNF_DSPTCH_PID_FILE"
case "x$SNF_DSPTCH_ENABLE" in
xtrue|xfalse) ;;
*) log_failure_msg "Value of SNF_DSPTCH_ENABLE in $SNF_DSPTCH_DEFAULTS_FILE must be either 'true' or 'false';"
log_failure_msg "not starting dispatcher daemon."
exit 1
;;
esac
fi
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
dispatcher_start() {
if start-stop-daemon --start --chuid $SNF_USER --exec $DAEMON -- $SNF_DSPTCH_OPTS; then
rc=0
sleep 1
if ! kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
log_failure_msg "snf-dispatcher daemon failed to start"
rc=1
fi
else
rc=1
fi
if [ $rc -eq 0 ]; then
log_end_msg 0
else
log_end_msg 1
rm -f $SNF_DSPTCH_PID_FILE
fi
} # dispatcher_start
case "$1" in
start)
# Ensure the directory containing the pidfile exists
# and has the right permissions
mkdir -p $SNF_DSPTCH_RUNDIR
chown $SNF_USER $SNF_DSPTCH_RUNDIR
chmod 0755 $SNF_DSPTCH_RUNDIR
if "$SNF_DSPTCH_ENABLE"; then
log_daemon_msg "Starting snf-dispatcher daemon" "snf-dispatcher"
if [ -s $SNF_DSPTCH_PID_FILE ] && kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
dispatcher_start
else
[ "$VERBOSE" != no ] && log_warning_msg "snf-dispatcher daemon not enabled in $SNF_DSPTCH_DEFAULTS_FILE, not starting..."
fi
;;
stop)
log_daemon_msg "Stopping snf-dispatcher daemon" "snf-dispatcher"
start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_DSPTCH_PID_FILE
log_end_msg $?
rm -f $SNF_DSPTCH_PID_FILE
;;
restart)
set +e
if $SNF_DSPTCH_ENABLE; then
log_daemon_msg "Restarting dispatcher daemon" "dispatcher"
if [ -s $SNF_DSPTCH_PID_FILE ] && kill -0 $(cat $SNF_DSPTCH_PID_FILE) >/dev/null 2>&1; then
start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_DSPTCH_PID_FILE || true
sleep 1
else
log_warning_msg "dispatcher daemon not running, attempting to start."
rm -f $SNF_DSPTCH_PID_FILE
fi
dispatcher_start
else
[ "$VERBOSE" != no ] && log_warning_msg "dispatcher daemon not enabled in $SNF_DSPTCH_DEFAULTS_FILE, not starting..."
fi
;;
status)
status_of_proc -p $SNF_DSPTCH_PID_FILE "$DAEMON" dispatcher
exit $? # notreached due to set -e
;;
*)
echo "Usage: /etc/init.d/snf-dispatcher {start|stop|restart|status}"
exit 1
esac
exit 0
## snf-cyclades-gtools settings
#
#BACKEND_PREFIX_ID = "snf-"
#EXCHANGE_GANETI = "ganeti"
#
## List of RabbitMQ endpoints
#AMQP_HOSTS = ["amqp://username:password@host:port"]
## AMQP Backend Client. Currently only puka
#AMQP_BACKEND = 'puka'
#!/bin/sh
SNF_EVENTD_ENABLE=false
SNF_USER="root"
SNF_EVENTD_OPTS=""
#! /bin/sh
### BEGIN INIT INFO
# Provides: snf-ganeti-eventd
# Required-Start: $remote_fs $syslog ganeti
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Start-After: ganeti
# Short-Description: Synnefo ganeti-eventd daemon
# Description: ganeti-eventd is a daemon
### END INIT INFO
set -e
# /etc/init.d/snf-ganeti-eventd: start and stop the ganeti-eventd daemon
# script skeleton stolen from rsyncd
DAEMON=/usr/sbin/snf-ganeti-eventd
SNF_EVENTD_PID_FILE=/var/run/snf-ganeti-eventd.pid
SNF_EVENTD_DEFAULTS=/etc/default/snf-ganeti-eventd
SNF_EVENTD_OPTS=''
SNF_EVENTD_ENABLE=true
SNF_USER="root"
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
if [ -s $SNF_EVENTD_DEFAULTS ]; then
. $SNF_EVENTD_DEFAULTS
fi
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
check_ganeti_master() {
MASTER=`/usr/sbin/gnt-cluster getmaster`
HOST=`/bin/hostname -f`
if [ "x$MASTER" != x$HOST ]; then
log_warning_msg "snf-ganeti-eventd should run on the ganeti master only, aborting start (use 'force-start' if you know what you are doing)"
log_end_msg 0
exit 0
fi
}
eventd_start() {
if start-stop-daemon --start --chuid $SNF_USER --pidfile $SNF_EVENTD_PID_FILE \
--exec $DAEMON -- $SNF_EVENTD_OPTS
then
rc=0
sleep 1
if ! kill -0 $(cat $SNF_EVENTD_PID_FILE) >/dev/null 2>&1; then
log_failure_msg "snf-ganeti-eventd daemon failed to start"
rc=1
fi
else
rc=1
fi
if [ $rc -eq 0 ]; then
log_end_msg 0
else
log_end_msg 1
rm -f $SNF_EVENTD_PID_FILE
fi
} # eventd_start
case "$1" in
start)
if "$SNF_EVENTD_ENABLE"; then
log_daemon_msg "Starting snf-ganeti-eventd daemon" "snf-ganeti-eventd"
if [ -s $SNF_EVENTD_PID_FILE ] && kill -0 $(cat $SNF_EVENTD_PID_FILE) >/dev/null 2>&1; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
# Check if we are on the Ganeti master node
check_ganeti_master
eventd_start
else
if [ -s "$SNF_EVENTD_DEFAULTS" ]; then
[ "$VERBOSE" != no ] && log_warning_msg "snf-ganeti-eventd daemon not enabled in $SNF_EVENTD_DEFAULTS, not starting..."
fi
fi
;;
force-start)
if "$SNF_EVENTD_ENABLE"; then
log_daemon_msg "Starting snf-ganeti-eventd daemon" "snf-ganeti-eventd"
else
if [ -s "$SNF_EVENTD_DEFAULTS" ]; then
[ "$VERBOSE" != no ] && log_warning_msg "snf-ganeti-eventd daemon not enabled in $SNF_EVENTD_DEFAULTS, starting anyway"
fi
fi
if [ -s $SNF_EVENTD_PID_FILE ] && kill -0 $(cat $SNF_EVENTD_PID_FILE) >/dev/null 2>&1; then
log_progress_msg "apparently already running"
log_end_msg 0
exit 0
fi
eventd_start
;;
stop)
log_daemon_msg "Stopping snf-ganeti-eventd daemon" "snf-ganeti-eventd"
start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_EVENTD_PID_FILE
log_end_msg $?
rm -f $SNF_EVENTD_PID_FILE
;;
restart)
set +e
if $SNF_EVENTD_ENABLE; then
log_daemon_msg "Restarting snf-ganeti-eventd daemon" "snf-ganeti-eventd"
if [ -s $SNF_EVENTD_PID_FILE ] && kill -0 $(cat $SNF_EVENTD_PID_FILE) >/dev/null 2>&1; then
start-stop-daemon --stop --quiet --oknodo --pidfile $SNF_EVENTD_PID_FILE || true
sleep 1
else
log_warning_msg "snf-ganeti-eventd daemon not running, attempting to start."
rm -f $SNF_EVENTD_PID_FILE
fi
# Check if we are on the Ganeti master node, before starting
check_ganeti_master
eventd_start
else
if [ -s "$SNF_EVENTD_DEFAULTS" ]; then
[ "$VERBOSE" != no ] && log_warning_msg "snf-ganeti-eventd daemon not enabled in $SNF_EVENTD_DEFAULTS, not starting..."
fi
fi
;;
status)
status_of_proc -p $SNF_EVENTD_PID_FILE "$DAEMON" ganeti-eventd
exit $? # notreached due to set -e
;;
*)