summaryrefslogtreecommitdiffstats
path: root/src/fuel-plugin/deployment_scripts
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-07-12 01:57:52 +0800
committerGuo Ruijing <ruijing.guo@intel.com>2016-07-12 01:58:53 +0800
commit54ea933ac9643d2d2f3714aa06afc978fc60551e (patch)
treec8df88f89aa75f095af4fbe7d3a3b64746c9f16a /src/fuel-plugin/deployment_scripts
parent215a65015908064b6ca996286584933002f0287a (diff)
Add Fuel Plugin
Change-Id: Ib1a4b7057678e435683b23692310f4e309c3fe10 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'src/fuel-plugin/deployment_scripts')
-rwxr-xr-xsrc/fuel-plugin/deployment_scripts/install.sh54
-rw-r--r--src/fuel-plugin/deployment_scripts/puppet/manifests/collectd-ceilometer_install.pp23
-rw-r--r--src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_install.pp6
-rw-r--r--src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_restart.pp4
4 files changed, 87 insertions, 0 deletions
diff --git a/src/fuel-plugin/deployment_scripts/install.sh b/src/fuel-plugin/deployment_scripts/install.sh
new file mode 100755
index 0000000..9a9bf61
--- /dev/null
+++ b/src/fuel-plugin/deployment_scripts/install.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+set -eux
+
+INSTALL_HOME=/opt/collectd-ceilometer
+
+HOST=$1
+OS_AUTH_URL=$2
+OS_USERNAME=$3
+OS_PASSWORD=$4
+
+CEILOMETER_URL_TYPE=${CEILOMETER_URL_TYPE:-internalURL}
+CEILOMETER_TIMEOUT=${CEILOMETER_TIMEOUT:-1000}
+
+rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
+cd $INSTALL_HOME
+curl http://$HOST:8080/plugins/fuel-plugin-collectd-ceilometer-0.9/repositories/ubuntu/collectd-ceilometer.tgz | tar xzvf -
+
+cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf
+<LoadPlugin python>
+ Globals true
+</LoadPlugin>
+
+<Plugin python>
+ ModulePath "$INSTALL_HOME"
+ LogTraces true
+ Interactive false
+ Import "collectd_ceilometer_plugin"
+
+ <Module collectd_ceilometer_plugin>
+
+ # Verbosity 1|0
+ #VERBOSE 0
+
+ # Batch size
+ BATCH_SIZE 3
+
+ # Service endpoint addresses
+ OS_AUTH_URL "$OS_AUTH_URL"
+
+ # Ceilometer address
+ #CEILOMETER_ENDPOINT
+ CEILOMETER_URL_TYPE "$CEILOMETER_URL_TYPE"
+
+ # Ceilometer timeout in ms
+ CEILOMETER_TIMEOUT "$CEILOMETER_TIMEOUT"
+
+ # # Ceilometer user creds
+ OS_USERNAME "$OS_USERNAME"
+ OS_PASSWORD "$OS_PASSWORD"
+ OS_TENANT_NAME "service"
+
+ </Module>
+</Plugin>
+EOF
diff --git a/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd-ceilometer_install.pp b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd-ceilometer_install.pp
new file mode 100644
index 0000000..6b6a76d
--- /dev/null
+++ b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd-ceilometer_install.pp
@@ -0,0 +1,23 @@
+$master_ip = hiera('master_ip')
+$use_ceilometer = hiera('use_ceilometer', false)
+
+$management_vip = hiera('management_vip')
+$service_endpoint = hiera('service_endpoint', $management_vip)
+$ssl_hash = hiera_hash('use_ssl', {})
+$auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')
+$auth_endpoint = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [$service_endpoint])
+$auth_uri = "${auth_protocol}://${auth_endpoint}:5000/v2.0"
+
+$ceilometer_hash = hiera_hash('ceilometer', {'user'=>'ceilometer'})
+$auth_user = 'ceilometer'
+$auth_password = $ceilometer_hash['user_password']
+
+$exe_url = "http://${master_ip}:8080/plugins/fuel-plugin-collectd-ceilometer-0.9/deployment_scripts/install.sh"
+
+if ($use_ceilometer) {
+
+ exec { "install collectd-ceilometer":
+ command => "curl ${exe_url} | bash -s ${master_ip} ${auth_uri} ${auth_user} ${auth_password}",
+ path => "/usr/bin:/usr/sbin:/bin:/sbin";
+ }
+}
diff --git a/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_install.pp b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_install.pp
new file mode 100644
index 0000000..63a2e94
--- /dev/null
+++ b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_install.pp
@@ -0,0 +1,6 @@
+if $operatingsystem == 'Ubuntu' {
+ exec { "install collectd":
+ command => "apt-get install -y collectd",
+ path => "/usr/bin:/usr/sbin:/bin:/sbin";
+ }
+}
diff --git a/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_restart.pp b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_restart.pp
new file mode 100644
index 0000000..59f5151
--- /dev/null
+++ b/src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_restart.pp
@@ -0,0 +1,4 @@
+exec { "restart collectd":
+ command => "service collectd restart",
+ path => "/usr/bin:/usr/sbin:/bin:/sbin";
+}