Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit 82b70b2c290091684c6b940b4a563e5d71140b71
- Author: Kiall Mac Innes <kiall@managedit.ie>
- Date: Mon Jan 31 01:11:19 2011 +0000
- Initial Support for debconf selections. Not all common settings are available yet.
- diff --git a/ext/debian/mcollective.config b/ext/debian/mcollective.config
- new file mode 100755
- index 0000000..1bcc33f
- --- /dev/null
- +++ b/ext/debian/mcollective.config
- @@ -0,0 +1,74 @@
- +#!/bin/bash -e
- +
- +# Source debconf library.
- +. /usr/share/debconf/confmodule
- +
- +# Stomp Questions
- +db_input medium mcollective/plugin_stomp_host || true
- +db_go
- +
- +db_input medium mcollective/plugin_stomp_port || true
- +db_go
- +
- +db_input medium mcollective/plugin_stomp_user || true
- +db_go
- +
- +db_input medium mcollective/plugin_stomp_password || true
- +db_go
- +
- +# Security Questions
- +db_input medium mcollective/securityprovider || true
- +db_go
- +
- +db_get mcollective/securityprovider
- +
- +SECURITY_PROVIDER=$RET
- +
- +if [ "$SECURITY_PROVIDER" == "psk" ]; then
- + db_input medium mcollective/plugin_psk || true
- + db_go
- +fi
- +
- +if [ "$SECURITY_PROVIDER" == "ssl" ]; then
- + # No Extra Questions Needed
- + # TODO: Make this show some info on the next steps for setting up SSL auth
- + break
- +fi
- +
- +if [ "$SECURITY_PROVIDER" == "aes" ]; then
- + # No Extra Questions Needed
- + # TODO: Make this show some info on the next steps for setting up AES auth
- + break
- +fi
- +
- +# Logging Questions
- +db_input medium mcollective/loggertype || true
- +db_go
- +
- +db_get mcollective/loggertype
- +
- +LOGGER_TYPE=$RET
- +
- +if [ "$LOGGER_TYPE" == "file" ]; then
- + db_input medium mcollective/logfile || true
- + db_go
- +
- + db_input medium mcollective/keeplogs || true
- + db_go
- +
- + db_input medium mcollective/max_log_size || true
- + db_go
- +fi
- +
- +if [ "$LOGGER_TYPE" == "syslog" ]; then
- + # No Extra Questions Needed
- + break
- +fi
- +
- +if [ "$LOGGER_TYPE" == "console" ]; then
- + # No Extra Questions Needed
- + break
- +fi
- +
- +db_input medium mcollective/loglevel || true
- +db_go
- diff --git a/ext/debian/mcollective.postinst b/ext/debian/mcollective.postinst
- new file mode 100755
- index 0000000..73033c9
- --- /dev/null
- +++ b/ext/debian/mcollective.postinst
- @@ -0,0 +1,81 @@
- +#!/bin/bash -e
- +
- +# Source debconf library.
- +. /usr/share/debconf/confmodule
- +
- +replace_or_add () {
- + # $1 = Config Setting Name
- + # $2 = New value
- + local CFG_NAME=`sed -e 's/\(\/\|\\\|&\)/\\&/g' <<< $1`
- + local CFG_VALUE=`sed -e 's/\(\/\|\\\|&\)/\\&/g' <<< $2`
- +# local CFG_NAME=$1
- +# local CFG_VALUE=$2
- +
- + sed -i -e "/^\($CFG_NAME[[:blank:]]*=[[:blank:]]*\).*/!ba" -e "s//$CFG_VALUE/" -e h -e b -e :a -e '$!b' -e p -e g -e '/./d' -e "s/.*/$CFG_NAME = $CFG_VALUE/" /etc/mcollective/server.cfg
- +}
- +
- +# Stomp Questions
- +db_get mcollective/plugin_stomp_host
- +replace_or_add "plugin.stomp.host" "$RET"
- +
- +db_get mcollective/plugin_stomp_port
- +replace_or_add "plugin.stomp.port" "$RET"
- +
- +db_get mcollective/plugin_stomp_user
- +replace_or_add "plugin.stomp.user" "$RET"
- +
- +db_get mcollective/plugin_stomp_password
- +replace_or_add "plugin.stomp.password" "$RET"
- +
- +# Security Questions
- +db_get mcollective/securityprovider
- +replace_or_add "securityprovider" "$RET"
- +
- +SECURITY_PROVIDER=$RET
- +
- +if [ "$SECURITY_PROVIDER" == "psk" ]; then
- + db_get mcollective/plugin_psk
- + replace_or_add "plugin.psk" "$RET"
- +fi
- +
- +if [ "$SECURITY_PROVIDER" == "ssl" ]; then
- + # Do Nothing for the moment!
- + break
- +fi
- +
- +if [ "$SECURITY_PROVIDER" == "aes" ]; then
- + # Do Nothing for the moment!
- + break
- +fi
- +
- +# Logging Questions
- +db_get mcollective/loggertype
- +replace_or_add "loggertype" "$RET"
- +
- +LOGGER_TYPE=$RET
- +
- +if [ "$LOGGER_TYPE" == "file" ]; then
- + db_get mcollective/logfile
- + replace_or_add "logfile" "$RET"
- +
- + db_get mcollective/keeplogs
- + replace_or_add "keeplogs" "$RET"
- +
- + db_get mcollective/max_log_size
- + replace_or_add "max_log_size" "$RET"
- +fi
- +
- +if [ "$LOGGER_TYPE" == "syslog" ]; then
- + # Do Nothing for the moment!
- + break
- +fi
- +
- +if [ "$LOGGER_TYPE" == "console" ]; then
- + # Do Nothing for the moment!
- + break
- +fi
- +
- +db_get mcollective/loglevel
- +replace_or_add "loglevel" "$RET"
- +
- +
- diff --git a/ext/debian/templates b/ext/debian/templates
- new file mode 100644
- index 0000000..7dc2ad1
- --- /dev/null
- +++ b/ext/debian/templates
- @@ -0,0 +1,58 @@
- +Template: mcollective/plugin_stomp_host
- +Type: string
- +Default: stomp.example.com
- +Description: Stomp host:
- +
- +Template: mcollective/plugin_stomp_port
- +Type: string
- +Default: 6163
- +Description: Stomp port:
- +
- +Template: mcollective/plugin_stomp_user
- +Type: string
- +Default: mcollective
- +Description: Stomp username:
- +
- +Template: mcollective/plugin_stomp_password
- +Type: string
- +Default: marionette
- +Description: Stomp password:
- +
- +Template: mcollective/securityprovider
- +Type: select
- +Default: psk
- +Choices: psk, ssl, aes
- +Description: Security Provider:
- +
- +Template: mcollective/plugin_psk
- +Type: string
- +Default: marionette
- +Description: Pre-Shared Key (for use with the PSK Security Provider):
- +
- +Template: mcollective/loggertype
- +Type: select
- +Default: syslog
- +Choices: file, syslog, console
- +Description: Logger Type:
- +
- +Template: mcollective/logfile
- +Type: string
- +Default: /var/log/mcollective.log
- +Description: Logger File:
- +
- +Template: mcollective/keeplogs
- +Type: string
- +Default: 5
- +Description: Keep Logs:
- +
- +Template: mcollective/max_log_size
- +Type: string
- +Default: 2097152
- +Description: Max Log Size:
- +
- +Template: mcollective/loglevel
- +Type: select
- +Default: warn
- +Choices: info, warn, debug, fatal, error
- +Description: Log Level:
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement