From 651999d4b4b4d75386bbe44f11a3afc8f0a6d8f8 Mon Sep 17 00:00:00 2001 From: Fedor Date: Wed, 14 Dec 2016 13:42:25 +0400 Subject: [PATCH] Initial commit --- .gitignore | 97 ++----------------- README.md | 5 +- bond_config.yaml | 5 + components.yaml | 12 +++ .../puppet/manifests/congress.pp | 3 + deployment_scripts/puppet/modules/.gitkeep | 0 deployment_tasks.yaml | 43 ++++++++ environment_config.yaml | 18 ++++ metadata.yaml | 38 ++++++++ network_roles.yaml | 1 + nic_config.yaml | 4 + node_config.yaml | 4 + node_roles.yaml | 6 ++ pre_build_hook | 70 +++++++++++++ repositories/centos/.gitkeep | 0 repositories/ubuntu/.gitkeep | 0 tasks.yaml | 29 ++++++ volumes.yaml | 4 + 18 files changed, 249 insertions(+), 90 deletions(-) create mode 100644 bond_config.yaml create mode 100644 components.yaml create mode 100644 deployment_scripts/puppet/manifests/congress.pp create mode 100644 deployment_scripts/puppet/modules/.gitkeep create mode 100644 deployment_tasks.yaml create mode 100644 environment_config.yaml create mode 100644 metadata.yaml create mode 100644 network_roles.yaml create mode 100644 nic_config.yaml create mode 100644 node_config.yaml create mode 100644 node_roles.yaml create mode 100755 pre_build_hook create mode 100644 repositories/centos/.gitkeep create mode 100644 repositories/ubuntu/.gitkeep create mode 100644 tasks.yaml create mode 100644 volumes.yaml diff --git a/.gitignore b/.gitignore index 72364f9..430f43a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,89 +1,8 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# IPython Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# dotenv -.env - -# virtualenv -venv/ -ENV/ - -# Spyder project settings -.spyderproject - -# Rope project settings -.ropeproject +.idea +.tox +.build +*.pyc +*.deb +*.rpm +deployment_scripts/puppet/modules/congress +tmp \ No newline at end of file diff --git a/README.md b/README.md index 250c52d..4c505a2 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -# fuel-plugin-congress \ No newline at end of file +The Congress plugin for Fuel +============================ + +The Congress plugin for Fuel is a plugin to install Congress. \ No newline at end of file diff --git a/bond_config.yaml b/bond_config.yaml new file mode 100644 index 0000000..61c5192 --- /dev/null +++ b/bond_config.yaml @@ -0,0 +1,5 @@ +# This file contains additional bond attributes provided by plugin. +# Please, take a look at following link for the details: +# - https://blueprints.launchpad.net/fuel/+spec/nics-and-nodes-attributes-via-plugin +# - https://specs.openstack.org/openstack/fuel-specs/specs/10.0/nics-and-nodes-attributes-via-plugin.html + diff --git a/components.yaml b/components.yaml new file mode 100644 index 0000000..a23a051 --- /dev/null +++ b/components.yaml @@ -0,0 +1,12 @@ +# This file contains wizard components descriptions that are pretty similar to +# the `environment_config.yaml`. +# Please, take a look at following link for the details: +# - https://blueprints.launchpad.net/fuel/+spec/component-registry +# - https://specs.openstack.org/openstack/fuel-specs/specs/8.0/component-registry.html + +- name: additional_service:congress + compatible: [] + requires: [] + incompatible: [] + label: "Install Congress" + description: "Component description (optional)" diff --git a/deployment_scripts/puppet/manifests/congress.pp b/deployment_scripts/puppet/manifests/congress.pp new file mode 100644 index 0000000..2456473 --- /dev/null +++ b/deployment_scripts/puppet/manifests/congress.pp @@ -0,0 +1,3 @@ +notice('MODULAR: congress.pp') + +# TODO implement \ No newline at end of file diff --git a/deployment_scripts/puppet/modules/.gitkeep b/deployment_scripts/puppet/modules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml new file mode 100644 index 0000000..b5916c8 --- /dev/null +++ b/deployment_tasks.yaml @@ -0,0 +1,43 @@ +# These tasks will be merged into deployment graph. Here you +# can specify new tasks for any roles, even built-in ones. + +- id: congress + type: group + role: [congress] + parameters: + strategy: + type: parallel + +- id: congress-install + type: puppet + version: 2.1.0 + groups: [congress] + cross-depends: + - name: congress-db + - name: congress-keystone + parameters: + puppet_manifest: puppet/manifests/congress.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 3600 + +- id: congress-keystone + type: puppet + version: 2.1.0 + groups: [primary-controller] + cross-depends: + - name: /(primary-)?keystone/ + parameters: + puppet_manifest: puppet/manifests/congress-keystone.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 1800 + +- id: congress-db + type: puppet + version: 2.1.0 + groups: [primary-controller] + cross-depends: + - name: /(primary-)?database/ + parameters: + puppet_manifest: puppet/manifests/congess-db.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 1800 \ No newline at end of file diff --git a/environment_config.yaml b/environment_config.yaml new file mode 100644 index 0000000..39a8a4b --- /dev/null +++ b/environment_config.yaml @@ -0,0 +1,18 @@ +attributes: + metadata: + # Settings group can be one of "general", "security", "compute", "network", + # "storage", "logging", "openstack_services" and "other". + group: 'openstack_services' + db_password: + generator: 'password' + user_password: + generator: 'password' + user: 'congress' + port: 1789 + service: 'congress-server' + debug: + value: false + label: 'Debug logging' + description: 'Debug logging mode provides more information, but requires more disk space.' + weight: 25 + type: "checkbox" diff --git a/metadata.yaml b/metadata.yaml new file mode 100644 index 0000000..0184f6b --- /dev/null +++ b/metadata.yaml @@ -0,0 +1,38 @@ +# Plugin name +name: fuel-plugin-congress +# Human-readable name for your plugin +title: Fuel Congress plugin +# Plugin version +version: '1.0.0' +# Description +description: Install Congress +# Required fuel version +fuel_version: ['9.0', '10.0'] +# Specify license of your plugin +licenses: ['Apache License Version 2.0'] +# Specify author or company name +authors: ['Fedor Zhadaev', 'Mirantis'] +# A link to the plugin's page +homepage: 'https://github.com/openstack/fuel-plugin-congress' +# Specify a group which your plugin implements, possible options: +# network, storage, storage::cinder, storage::glance, hypervisor +groups: [] +# Change `false` to `true` if the plugin can be installed in the environment +# after the deployment. +is_hotpluggable: false + +# The plugin is compatible with releases in the list +releases: + - os: ubuntu + version: mitaka-9.0 + mode: ['ha'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/ubuntu + - os: ubuntu + version: newton-10.0 + mode: ['ha'] + deployment_scripts_path: deployment_scripts/ + repository_path: repositories/ubuntu + +# Version of plugin package +package_version: '5.0.0' diff --git a/network_roles.yaml b/network_roles.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/network_roles.yaml @@ -0,0 +1 @@ +[] diff --git a/nic_config.yaml b/nic_config.yaml new file mode 100644 index 0000000..d3ed991 --- /dev/null +++ b/nic_config.yaml @@ -0,0 +1,4 @@ +# This file contains additional nic attributes provided by plugin. +# Please, take a look at following link for the details: +# - https://blueprints.launchpad.net/fuel/+spec/nics-and-nodes-attributes-via-plugin +# - https://specs.openstack.org/openstack/fuel-specs/specs/10.0/nics-and-nodes-attributes-via-plugin.html diff --git a/node_config.yaml b/node_config.yaml new file mode 100644 index 0000000..baf43ba --- /dev/null +++ b/node_config.yaml @@ -0,0 +1,4 @@ +# This file contains additional node's attributes provided by plugin. +# Please, take a look at following link for the details: +# - https://blueprints.launchpad.net/fuel/+spec/nics-and-nodes-attributes-via-plugin +# - https://specs.openstack.org/openstack/fuel-specs/specs/10.0/nics-and-nodes-attributes-via-plugin.html diff --git a/node_roles.yaml b/node_roles.yaml new file mode 100644 index 0000000..5291b08 --- /dev/null +++ b/node_roles.yaml @@ -0,0 +1,6 @@ +congress: + name: "Congress" + description: "Install Congress" + has_primary: false + public_ip_required: false + weight: 150 diff --git a/pre_build_hook b/pre_build_hook new file mode 100755 index 0000000..f4f29e7 --- /dev/null +++ b/pre_build_hook @@ -0,0 +1,70 @@ +#!/bin/bash + +# Add here any the actions which are required before plugin build +# like packages building, packages downloading from mirrors and so on. +# The script should return 0 if there were no errors. + +set -eux + +ROOT="$(dirname "$(readlink -f "$0")")" +MODULES_DIR="${ROOT}/deployment_scripts/puppet/modules" +TMP_DIR="${ROOT}/tmp" +UBUNTU_REPO_DIR="${ROOT}/repositories/ubuntu" + +CONGRESS_PUPPET_REPO=${CONGRESS_PUPPET_REPO:-'https://github.com/openstack/puppet-congress.git'} +CONGRESS_PUPPET_BRANCH=${CONGRESS_PUPPET_BRANCH:-'master'} +CONGRESS_PUPPET_DST_DIR="${MODULES_DIR}/congress" + +CONGRESS_REPO=${CONGRESS_REPO:-'https://github.com/openstack/congress.git'} +CONGRESS_BRANCH=${CONGRESS_BRANCH:-'stable/newton'} +CONGRESS_DST_DIR="${TMP_DIR}/congress" + +CONGRESS_CLI_REPO=${CONGRESS_CLI_REPO:-'https://github.com/openstack/python-congressclient.git'} +CONGRESS_CLI_BRANCH=${CONGRESS_CLI_BRANCH:-'stable/newton'} +CONGRESS_CLI_DST_DIR="${TMP_DIR}/python-congressclient" + +function git_download { + local git_repo=$1 + local git_branch=$2 + local dst_dir=$3 + + rm -rvf "$dst_dir" + git clone "${git_repo}" --single-branch -b "${git_branch}" "${dst_dir}" +} + + +# Remove temp directory +function clean { + rm -rf "${TMP_DIR}" +} + + +function check_fpm { + command -v fpm > /dev/null 2>&1 || { echo >&2 "ERROR: fpm ruby gem is not installed. Aborting."; exit 1; } + +} + +function build_deb { + pushd "${UBUNTU_REPO_DIR}" + + fpm --force -s python -t deb --python-install-bin /usr/bin --python-install-lib /usr/lib/python2.7/dist-packages "${CONGRESS_DST_DIR}/setup.py" + fpm --force -s python -t deb --python-install-lib /usr/lib/python2.7/dist-packages "${CONGRESS_CLI_DST_DIR}/setup.py" + + popd + +} +check_fpm + +clean + +git_download "${CONGRESS_PUPPET_REPO}" "${CONGRESS_PUPPET_BRANCH}" "${CONGRESS_PUPPET_DST_DIR}" + +git_download "${CONGRESS_REPO}" "${CONGRESS_BRANCH}" "${CONGRESS_DST_DIR}" + +git_download "${CONGRESS_CLI_REPO}" "${CONGRESS_CLI_BRANCH}" "${CONGRESS_CLI_DST_DIR}" + +build_deb + +clean + + diff --git a/repositories/centos/.gitkeep b/repositories/centos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/repositories/ubuntu/.gitkeep b/repositories/ubuntu/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tasks.yaml b/tasks.yaml new file mode 100644 index 0000000..3ffb6d0 --- /dev/null +++ b/tasks.yaml @@ -0,0 +1,29 @@ +# WARNING: `tasks.yaml` will be deprecated in further releases. +# Please, use `deployment_tasks.yaml` to describe tasks instead. + +# This file is left only as an example of the old tasks format what you could +# meet during plugins development and support. + +## This tasks will be applied on controller nodes, +## here you can also specify several roles, for example +## ['cinder', 'compute'] will be applied only on +## cinder and compute nodes +#- role: ['controller'] +# stage: post_deployment +# type: shell +# parameters: +# cmd: bash deploy.sh +# timeout: 42 +## Task is applied for all roles +#- role: '*' +# stage: pre_deployment +# type: shell +# parameters: +# cmd: echo all > /tmp/plugin.all +# timeout: 42 +## "reboot" task reboots the nodes and waits until they get back online +## - role: '*' +## stage: pre_deployment +## type: reboot +## parameters: +## timeout: 600 diff --git a/volumes.yaml b/volumes.yaml new file mode 100644 index 0000000..3306922 --- /dev/null +++ b/volumes.yaml @@ -0,0 +1,4 @@ +volumes_roles_mapping: + congress: + - {allocate_size: "min", id: "os"} +volumes: []