From 0ae34e014c9763bda20bc601adc9790e2ffcfbba Mon Sep 17 00:00:00 2001 From: Olivier Bourdon Date: Thu, 22 Dec 2016 09:37:23 +0100 Subject: [PATCH] Add support for MOS 10.0 Change-Id: I59d8a42e9e83a49a73aee73d598be15481e75f6c --- .gitignore | 2 + README.md | 16 +++---- doc/plugin-guide/source/changelog.rst | 4 ++ doc/plugin-guide/source/conf.py | 2 +- doc/plugin-guide/source/description.rst | 10 ++--- doc/plugin-guide/source/installation.rst | 10 ++--- doc/plugin-guide/source/revisionhistory.rst | 25 ++++++----- doc/qa/source/conf.py | 2 +- doc/specs/source/conf.py | 2 +- doc/specs/source/index.rst | 4 +- functions.sh | 15 ++----- metadata.yaml | 17 ++++--- pre_build_hook | 50 ++++++++++++--------- repositories/ubuntu/trusty/.gitkeep | 0 repositories/ubuntu/xenial/.gitkeep | 0 tox.ini | 2 +- 16 files changed, 87 insertions(+), 74 deletions(-) create mode 100644 repositories/ubuntu/trusty/.gitkeep create mode 100644 repositories/ubuntu/xenial/.gitkeep diff --git a/.gitignore b/.gitignore index e44b259..ee217a3 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ Gemfile.lock *.noarch.rpm repositories/centos/*.rpm repositories/ubuntu/*.deb +repositories/ubuntu/trusty/*.deb +repositories/ubuntu/xenial/*.deb deployment_scripts/puppet/modules/snmp diff --git a/README.md b/README.md index 844a03f..6c26026 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ It is a base for additional plugins which adds specific SNMP traps monitoring. Requirements ------------ -| Requirement | Version/Comment | -|:---------------------------------|:----------------------------| -| Mirantis OpenStack compatibility | 7.0, 8.0, 9.0, 9.1, and 9.2 | -| Zabbix plugin for Fuel | 2.5.2 | +| Requirement | Version/Comment | +|:---------------------------------|:---------------------------------| +| Mirantis OpenStack compatibility | 7.0, 8.0, 9.0, 9.1, 9.2 and 10.0 | +| Zabbix plugin for Fuel | 2.5.3 | Installation Guide ================== @@ -36,20 +36,20 @@ To install SNMP trap daemon plugin, follow these steps: that. If you do not have the Fuel Master node yet, see [Quick Start Guide](https://software.mirantis.com/quick-start/) : - # scp zabbix_snmptrapd-1.1-1.1.1-1.noarch.rpm root@:/tmp + # scp zabbix_snmptrapd-1.1-1.1.2-1.noarch.rpm root@:/tmp 4. Install the plugin: # cd /tmp - # fuel plugins --install zabbix_snmptrapd-1.1-1.1.1-1.noarch.rpm + # fuel plugins --install zabbix_snmptrapd-1.1-1.1.2-1.noarch.rpm 5. Check if the plugin was installed successfully: # fuel plugins id | name | version | package_version ---|-------------------|---------|---------------- - 1 | zabbix_monitoring | 2.5.2 | 3.0.0 - 2 | zabbix_snmptrapd | 1.1.1 | 3.0.0 + 1 | zabbix_monitoring | 2.5.3 | 3.0.0 + 2 | zabbix_snmptrapd | 1.1.2 | 3.0.0 For more information and instructions, see the SNMP trap daemon plugin Guide in the [Fuel Plugins Catalog](https://software.mirantis.com/fuel-plugins) diff --git a/doc/plugin-guide/source/changelog.rst b/doc/plugin-guide/source/changelog.rst index a1df545..37a08ae 100644 --- a/doc/plugin-guide/source/changelog.rst +++ b/doc/plugin-guide/source/changelog.rst @@ -1,6 +1,10 @@ Release notes / Changelog ========================= +**1.1.2** + +* Compatibility with MOS 10.0 + **1.1.1** * Compatibility with MOS 9.2 diff --git a/doc/plugin-guide/source/conf.py b/doc/plugin-guide/source/conf.py index 0e9f451..a351f7d 100644 --- a/doc/plugin-guide/source/conf.py +++ b/doc/plugin-guide/source/conf.py @@ -56,7 +56,7 @@ author = u'Mirantis Inc.' # The short X.Y version. version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.1-1.1.1-1' +release = '1.1-1.1.2-1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/plugin-guide/source/description.rst b/doc/plugin-guide/source/description.rst index 19c04e5..3f3b8bb 100644 --- a/doc/plugin-guide/source/description.rst +++ b/doc/plugin-guide/source/description.rst @@ -17,10 +17,10 @@ additional plugins to add monitoring of SNMP traps specific for their hardware. Requirements ============ -====================== ========================== +====================== ================================ Requirement Version/Comment -====================== ========================== -Fuel 7.0, 8.0, 9.0, 9.1 and 9.2 -Zabbix plugin for Fuel 2.5.2 -====================== ========================== +====================== ================================ +Fuel 7.0, 8.0, 9.0, 9.1, 9.2 and 10.0 +Zabbix plugin for Fuel 2.5.3 +====================== ================================ diff --git a/doc/plugin-guide/source/installation.rst b/doc/plugin-guide/source/installation.rst index ccb02c3..e338112 100644 --- a/doc/plugin-guide/source/installation.rst +++ b/doc/plugin-guide/source/installation.rst @@ -21,20 +21,20 @@ To install SNMP trap daemon for Zabbix plugin, follow these steps: Fuel Master node using ssh. If you do not have the Fuel Master node yet, see `Quick Start Guide `_:: - # scp zabbix_snmptrapd-1.1-1.1.1-1.noarch.rpm root@:/tmp + # scp zabbix_snmptrapd-1.1-1.1.2-1.noarch.rpm root@:/tmp #. Log into the Fuel Master node. Install the plugin:: # cd /tmp - # fuel plugins --install zabbix_snmptrapd-1.1-1.1.1-1.noarch.rpm + # fuel plugins --install zabbix_snmptrapd-1.1-1.1.2-1.noarch.rpm #. Check if the plugin was installed successfully:: # fuel plugins id | name | version | package_version ---|---------------------------|----------|---------------- - 1 | zabbix_monitoring | 2.5.2 | 3.0.0 - 2 | zabbix_snmptrapd | 1.1.1 | 3.0.0 + 1 | zabbix_monitoring | 2.5.3 | 3.0.0 + 2 | zabbix_snmptrapd | 1.1.2 | 3.0.0 SNMP trap daemon for Zabbix plugin removal ========================================== @@ -45,7 +45,7 @@ To uninstall SNMP Trap Daemon for Zabbix plugin, follow these steps: #. Uninstall the plugin:: - # fuel plugins --remove zabbix_snmptrapd==1.1.1 + # fuel plugins --remove zabbix_snmptrapd==1.1.2 #. Check if the plugin was uninstalled successfully:: diff --git a/doc/plugin-guide/source/revisionhistory.rst b/doc/plugin-guide/source/revisionhistory.rst index f49e96e..6054dca 100644 --- a/doc/plugin-guide/source/revisionhistory.rst +++ b/doc/plugin-guide/source/revisionhistory.rst @@ -2,32 +2,35 @@ Revision history ================ -======= ============= ============================ ===================== +======= ============= ============================ ====================== Version Revision date Editor Comment -======= ============= ============================ ===================== +======= ============= ============================ ====================== 0.1 06.19.2015 Piotr Misiak First release (pmisiak@mirantis.com) -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 0.2 08.12.2015 Piotr Misiak Updated release (pmisiak@mirantis.com) -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 0.3 08.02.2015 Marciej Relewicz Updated for fix (mrelewicz@mirantis.com) -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 1.0.0 11.20.2015 Swann Croiset New Major version (scroiset@mirantis.com) -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 1.0.1 03.14.2016 Olivier Bourdon Added MOS 8.0 support (obourdon@mirantis.com) Doc fixes -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 1.1.0 05.11.2016 Olivier Bourdon Added MOS 9.0 support (obourdon@mirantis.com) -------- ------------- ---------------------------- --------------------- +------- ------------- ---------------------------- ---------------------- 1.1.0 10.19.2016 Olivier Bourdon Added MOS 9.1 support (obourdon@mirantis.com) -------- ------------- ---------------------------- --------------------- -1.1.1 02.17.2017 Olivier Bourdon Added MOS 9.2 support +------- ------------- ---------------------------- ---------------------- +1.1.1 02.17.2017 Olivier Bourdon Added MOS 9.2 support (obourdon@mirantis.com) -======= ============= ============================ ===================== +------- ------------- ---------------------------- ---------------------- +1.1.2 02.20.2017 Olivier Bourdon Added MOS 10.0 support + (obourdon@mirantis.com) +======= ============= ============================ ====================== diff --git a/doc/qa/source/conf.py b/doc/qa/source/conf.py index eb7247a..f607ce4 100644 --- a/doc/qa/source/conf.py +++ b/doc/qa/source/conf.py @@ -56,7 +56,7 @@ author = u'Mirantis Inc.' # The short X.Y version. version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.1-1.1.1-1' +release = '1.1-1.1.2-1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/specs/source/conf.py b/doc/specs/source/conf.py index e130894..906ed27 100644 --- a/doc/specs/source/conf.py +++ b/doc/specs/source/conf.py @@ -56,7 +56,7 @@ author = u'Mirantis Inc.' # The short X.Y version. version = '1.1' # The full version, including alpha/beta/rc tags. -release = '1.1-1.1.1-1' +release = '1.1-1.1.2-1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/specs/source/index.rst b/doc/specs/source/index.rst index 2a911d9..9ef871b 100644 --- a/doc/specs/source/index.rst +++ b/doc/specs/source/index.rst @@ -118,8 +118,8 @@ Work Items Dependencies ============ -* Fuel 7.0, 8.0, 9.0, 9.1 and 9.2 -* Zabbix plugin for Fuel 2.5.2 +* Fuel 7.0, 8.0, 9.0, 9.1, 9.2 and 10.0 +* Zabbix plugin for Fuel 2.5.3 Testing ======= diff --git a/functions.sh b/functions.sh index cf9e407..88fe388 100644 --- a/functions.sh +++ b/functions.sh @@ -17,22 +17,14 @@ set -eux ROOT="$(dirname "$(readlink -f "$0")")" MODULES_DIR="${ROOT}"/deployment_scripts/puppet/modules -RPM_REPO="${ROOT}"/repositories/centos/ -DEB_REPO="${ROOT}"/repositories/ubuntu/ # Download RPM or DEB packages and store them in the local repository directory function download_package { + REPO="$1" + shift while [ $# -gt 0 ]; do - if [[ "$1" == *.deb ]]; then - REPO=$DEB_REPO - elif [[ "$1" == *.rpm ]]; then - REPO=$RPM_REPO - else - echo "Invalid URL for download_package(): $1" - fi - FILE=$(basename "$1") - wget -qO - "$1" > "$REPO"/"$FILE" + wget -qO "$REPO"/"$FILE" "$1" shift done } @@ -43,4 +35,3 @@ function download_puppet_module { mkdir -p "${MODULES_DIR}"/"$1" wget -qO- "$2" | tar -C "${MODULES_DIR}/$1" --strip-components=1 -xz } - diff --git a/metadata.yaml b/metadata.yaml index a9c1e6e..24a8530 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -2,11 +2,11 @@ name: zabbix_snmptrapd title: SNMP trap daemon for Zabbix plugin # Plugin version -version: 1.1.1 +version: 1.1.2 # Description description: Gives ability to receive SNMP traps and pass them to Zabbix. # Required fuel version -fuel_version: ['7.0', '8.0', '9.0'] +fuel_version: ['7.0', '8.0', '9.0', '10.0'] # Groups groups: ['monitoring'] # Licenses @@ -22,22 +22,27 @@ releases: version: 2015.1.0-7.0 mode: ['ha'] deployment_scripts_path: deployment_scripts/ - repository_path: repositories/ubuntu + repository_path: repositories/ubuntu/trusty - os: ubuntu version: liberty-8.0 mode: ['ha'] deployment_scripts_path: deployment_scripts/ - repository_path: repositories/ubuntu + repository_path: repositories/ubuntu/trusty - os: ubuntu version: liberty-9.0 mode: ['ha'] deployment_scripts_path: deployment_scripts/ - repository_path: repositories/ubuntu + repository_path: repositories/ubuntu/trusty - os: ubuntu version: mitaka-9.0 mode: ['ha'] deployment_scripts_path: deployment_scripts/ - repository_path: repositories/ubuntu + repository_path: repositories/ubuntu/trusty + - os: ubuntu + version: newton-10.0 + mode: ['ha'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/ubuntu/xenial # Version of plugin package package_version: '3.0.0' diff --git a/pre_build_hook b/pre_build_hook index 7bf1be9..eb81f46 100755 --- a/pre_build_hook +++ b/pre_build_hook @@ -1,7 +1,21 @@ #!/bin/bash +# Copyright 2017 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -eux -ROOT="$(dirname `readlink -f $0`)" +ROOT="$(dirname "$(readlink -f "$0")")" . "${ROOT}"/functions.sh @@ -10,30 +24,24 @@ ROOT="$(dirname `readlink -f $0`)" SNMP_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/razorsedge-snmp-3.3.1.tar.gz" RPM_REPO="${ROOT}"/repositories/centos -DEB_REPO="${ROOT}"/repositories/ubuntu -MODULES="${ROOT}"/deployment_scripts/puppet/modules -mkdir -p $RPM_REPO $DEB_REPO +DEB_TRUSTY_REPO="${ROOT}"/repositories/ubuntu/trusty +DEB_XENIAL_REPO="${ROOT}"/repositories/ubuntu/xenial +mkdir -p $RPM_REPO $DEB_TRUSTY_REPO $DEB_XENIAL_REPO -# Downloads needed RPM or DEB packages -function download { - case "$1" in - deb) REPO=$DEB_REPO;; - rpm) REPO=$RPM_REPO;; - esac - shift +SNMP_TRUSTY_VERSION="5.7.2~dfsg-8.1ubuntu3.1" +SNMP_TRUSTY_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_${SNMP_TRUSTY_VERSION}_amd64.deb \ + http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_${SNMP_TRUSTY_VERSION}_amd64.deb \ + http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_${SNMP_TRUSTY_VERSION}_amd64.deb" - while [ $# -gt 0 ]; do - FILE=$(basename "$1") - wget -qO - $1 > "$REPO/$FILE" - shift - done -} +COMMON_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/s/snmptt/snmptt_1.4-1_all.deb" -download deb http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \ - http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \ - http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_5.7.2~dfsg-8.1ubuntu3.1_amd64.deb \ - http://archive.ubuntu.com/ubuntu/pool/universe/s/snmptt/snmptt_1.4-1_all.deb +download_package "$DEB_TRUSTY_REPO" $SNMP_TRUSTY_PACKAGES $COMMON_PACKAGES +SNMP_XENIAL_VERSION="5.7.3+dfsg-1ubuntu4" +SNMP_XENIAL_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/universe/n/net-snmp/libsnmp-perl_${SNMP_XENIAL_VERSION}_amd64.deb \ + http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmpd_${SNMP_XENIAL_VERSION}_amd64.deb \ + http://archive.ubuntu.com/ubuntu/pool/main/n/net-snmp/snmp_${SNMP_XENIAL_VERSION}_amd64.deb" +download_package "$DEB_XENIAL_REPO" $SNMP_XENIAL_PACKAGES $COMMON_PACKAGES # Install puppet manifests download_puppet_module "snmp" "$SNMP_TARBALL_URL" diff --git a/repositories/ubuntu/trusty/.gitkeep b/repositories/ubuntu/trusty/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/repositories/ubuntu/xenial/.gitkeep b/repositories/ubuntu/xenial/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tox.ini b/tox.ini index 368df1b..047bbcf 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ whitelist_externals= commands = rm -rf .build bash -c 'rm -rf doc/*/build' - bash -c 'rm -rf repositories/ubuntu/*.deb repositories/centos/*.rpm' + bash -c 'rm -rf repositories/ubuntu/*.deb repositories/ubuntu/trusty/*.deb repositories/ubuntu/xenial/*.deb repositories/centos/*.rpm' fpb --check {toxinidir} --debug fpb --build {toxinidir} --debug