Add collectd build & installation changes/91/16891/5
authorGuo Ruijing <ruijing.guo@intel.com>
Thu, 14 Jul 2016 22:24:12 +0000 (06:24 +0800)
committerGuo Ruijing <ruijing.guo@intel.com>
Sun, 17 Jul 2016 18:28:50 +0000 (02:28 +0800)
Change-Id: I9305715bae269fb2e65a083e4e19f1ed6c9b8331
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
src/fuel-plugin/build-collectd.sh [new file with mode: 0755]
src/fuel-plugin/deployment_scripts/install.sh
src/fuel-plugin/deployment_scripts/puppet/manifests/collectd_install.pp
src/fuel-plugin/pre_build_hook

diff --git a/src/fuel-plugin/build-collectd.sh b/src/fuel-plugin/build-collectd.sh
new file mode 100755 (executable)
index 0000000..30166a0
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+BUILD_HOME="$(pwd)"
+
+set -eux
+sudo apt-get -y install build-essential dh-autoreconf fakeroot dpkg-dev devscripts dpkg-dev git wget
+
+sudo apt-get -y install debhelper dpkg-dev po-debconf dh-systemd \
+    bison  flex autotools-dev libltdl-dev pkg-config \
+    iptables-dev \
+    javahelper \
+    libatasmart-dev  \
+    libcap-dev  \
+    libcurl4-gnutls-dev \
+    libdbi0-dev \
+    libesmtp-dev \
+    libganglia1-dev \
+    libgcrypt11-dev \
+    libglib2.0-dev \
+    libhiredis-dev \
+    libldap2-dev \
+    liblvm2-dev  \
+    libmemcached-dev \
+    libmodbus-dev \
+    libmnl-dev  \
+    libnotify-dev \
+    libopenipmi-dev \
+    liboping-dev \
+    libow-dev \
+    libpcap0.8-dev \
+    libpcap-dev \
+    libperl-dev \
+    libpq-dev \
+    librdkafka-dev \
+    librabbitmq-dev \
+    librrd-dev  \
+    libsensors4-dev \
+    libsigrok-dev  \
+    libsnmp9-dev \
+    libsnmp-dev \
+    perl \
+    libtokyocabinet-dev  \
+    libtokyotyrant-dev  \
+    libudev-dev  \
+    libupsclient-dev \
+    libvarnishapi-dev \
+    libvirt-dev \
+    libxml2-dev \
+    libyajl-dev \
+    linux-libc-dev \
+    default-jdk \
+    protobuf-c-compiler \
+    python-dev
+
+
+cd ${BUILD_HOME}
+rm -rf collectd
+git clone https://github.com/collectd/collectd; cd collectd; git checkout 37fe166;
+git clone https://github.com/collectd/pkg-debian; cd pkg-debian; git checkout e2e3b00; mv debian ..
+cd ${BUILD_HOME}/collectd
+
+./build.sh
+debian/rules build || true
+debian/rules build
+fakeroot debian/rules binary
index 9a9bf61..8f4edef 100755 (executable)
@@ -47,7 +47,7 @@ cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf
         # # Ceilometer user creds
         OS_USERNAME "$OS_USERNAME"
         OS_PASSWORD "$OS_PASSWORD"
-        OS_TENANT_NAME "service"
+        OS_TENANT_NAME "services"
 
     </Module>
 </Plugin>
index 63a2e94..ffe3d6d 100644 (file)
@@ -1,6 +1,5 @@
 if $operatingsystem == 'Ubuntu' {
-    exec { "install collectd":
-        command => "apt-get install -y collectd",
-        path   => "/usr/bin:/usr/sbin:/bin:/sbin";
+    package { 'collectd':
+        ensure => installed,
     }
 }
index eda8601..ffb4934 100755 (executable)
@@ -14,11 +14,21 @@ function build_pkg {
   case $1 in
     ubuntu)
       rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu
+     
+      rm -rf ${DIR}/build; mkdir -p ${DIR}/build; cd ${DIR}/build;
+  
       git clone https://github.com/openstack/collectd-ceilometer-plugin
       cd  collectd-ceilometer-plugin
       git checkout 3a4a1087566d1f9e8dd2d8d2e0608cb975942446
+      cat << EOF > collectd_ceilometer/__init__.py
+"""Collectd Ceilometer plugin implementation"""
+EOF
       tar cfvz ${DIR}/repositories/ubuntu/collectd-ceilometer.tgz . --exclude=collectd-ceilometer.tgz
-      cd ..; rm -rf collectd-ceilometer-plugin
+
+      cd ${DIR}/build; ../build-collectd.sh
+      cp *.deb ${DIR}/repositories/ubuntu
+
+      rm -rf ${DIR}/build
       ;;
     *) echo "Not supported system"; exit 1;;
   esac