-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add devstack plugin
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
function preinstall_sg-core { | ||
install_package $SG_CORE_CONTAINER_EXECUTABLE | ||
} | ||
|
||
function install_sg-core { | ||
$SG_CORE_CONTAINER_EXECUTABLE pull $SG_CORE_CONTAINER_IMAGE | ||
} | ||
|
||
function configure_sg-core { | ||
sudo mkdir -p `dirname $SG_CORE_CONF` | ||
sudo cp $SG_CORE_DIR/devstack/sg-core.conf.yaml $SG_CORE_CONF | ||
} | ||
|
||
function init_sg-core { | ||
$SG_CORE_CONTAINER_EXECUTABLE run -v $SG_CORE_CONF:/etc/sg-core.conf.yaml --network host --name sg-core -d $SG_CORE_CONTAINER_IMAGE | ||
} | ||
|
||
# check for service enabled | ||
if is_service_enabled sg-core; then | ||
|
||
if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then | ||
# Set up system services | ||
echo_summary "Configuring system services sg-core" | ||
preinstall_sg-core | ||
|
||
elif [[ "$1" == "stack" && "$2" == "install" ]]; then | ||
# Perform installation of service source | ||
echo_summary "Installing sg-core" | ||
install_sg-core | ||
|
||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then | ||
# Configure after the other layer 1 and 2 services have been configured | ||
echo_summary "Configuring sg-core" | ||
configure_sg-core | ||
|
||
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then | ||
# Initialize and start the sg-core service | ||
echo_summary "Initializing sg-core" | ||
init_sg-core | ||
fi | ||
|
||
if [[ "$1" == "unstack" ]]; then | ||
$SG_CORE_CONTAINER_EXECUTABLE stop sg-core | ||
$SG_CORE_CONTAINER_EXECUTABLE rm sg-core | ||
fi | ||
|
||
if [[ "$1" == "clean" ]]; then | ||
$SG_CORE_CONTAINER_EXECUTABLE rmi sg-core:latest | ||
fi | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
define_plugin sg-core | ||
plugin_requires sg-core ceilometer | ||
enable_service sg-core | ||
enable_service ceilometer | ||
|
||
SG_CORE_DIR=$DEST/sg-core | ||
SG_CORE_CONF_DIR=/etc/sg-core | ||
SG_CORE_CONF=$SG_CORE_CONF_DIR/sg-core.conf.yaml | ||
|
||
SG_CORE_CONTAINER_REPOSITORY=${SG_CORE_CONTAINER_REPOSITORY:-quay.io/infrawatch/sg-core} | ||
SG_CORE_CONTAINER_TAG=${SG_CORE_CONTAINER_TAG:-latest} | ||
SG_CORE_CONTAINER_IMAGE=$SG_CORE_CONTAINER_REPOSITORY:$SG_CORE_CONTAINER_TAG | ||
|
||
SG_CORE_CONTAINER_EXECUTABLE="podman" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
|
||
pluginDir: /usr/lib64/sg-core | ||
logLevel: debug | ||
|
||
transports: | ||
- name: socket | ||
config: | ||
type: tcp | ||
socketaddr: 127.0.0.1:4242 | ||
handlers: | ||
- name: ceilometer-metrics | ||
config: | ||
source: tcp | ||
|
||
applications: | ||
- name: prometheus | ||
config: | ||
host: 0.0.0.0 | ||
port: 3000 |