GithubHelp home page GithubHelp logo

billthebest / ganeti_webmgr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from osuosl-cookbooks/ganeti_webmgr

0.0 1.0 0.0 812 KB

Chef Cookbook for the Ganeti Web Manager Application

License: Apache License 2.0

ganeti_webmgr's Introduction

ganeti_webmgr Cookbook

This cookbook is for easy deployment of ganeti_webmgr. In particular it is aimed at deployment to Vagrant, but the end goal is to have a general cookbook that allows you to deploy GWM easily in any environment.

Requirements

For testing you need the following gems:

  • test-kitchen
  • kitchen-vagrant

If you use berkshelf, you also will want to install the berkshelf gem as well.

To install dependencies run 'bundle install' in the root of the directory.

Attributes

ganeti_webmgr::default

Key Type Description Default
['ganeti_webmgr']['path'] String Full path to the location GWM gets cloned. Note: This is not where it is installed. /opt/ganeti_webmgr_src
['ganeti_webmgr']['user'] String User to change to when running commands nil
['ganeti_webmgr']['group'] String Group to change to when running commands nil
['ganeti_webmgr']['repository'] String Git repository to clone GWM from https://github.com/osuosl/ganeti_webmgr
['ganeti_webmgr']['revision'] String What branch to checkout GWM on develop
['ganeti_webmgr']['packages'] Array of strings List of packages to install before setting up GWM []
['ganeti_webmgr']['install_dir'] String Where to actually install GWM to. This is the location setup.sh will create GWM's virtualenv /opt/ganeti_webmgr
['ganeti_webmgr']['config_dir'] String Where gwm's config directory goes. This is the directory config.yml will be put into. /opt/ganeti_webmgr/config
['ganeti_webmgr']['debug'] Boolean Whether or not to set the Django debug mode on or off false
['ganeti_webmgr']['migrate'] Boolean Whether or not to run database migrations false
['ganeti_webmgr']['site_domain'] String This is the link used in some locations to link back to GWM. node['fqdn']
['ganeti_webmgr']['static_root'] String Absolute path to where you want staticfiles to be collected to /opt/ganeti_webmgr/collected_static
['ganeti_webmgr']['static_url'] String Url to find GWM's static files at. /static
['ganeti_webmgr']['database']['engine'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['database']['name'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['database']['user'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['database']['password'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['database']['host'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['database']['port'] String See https://docs.djangoproject.com/en/1.4/ref/settings/#databases nil
['ganeti_webmgr']['haystack_whoosh_path'] String Where to put the search index files /opt/ganeti_webmgr/whoosh_index
['ganeti_webmgr']['vnc_proxy'] String The host:port pair where to access the VNCAuthProxy node['fqdn']:8888
['ganeti_webmgr']['secret_key'] String The SECRET_KEY for GWM nil
['ganeti_webmgr']['web_mgr_api_key'] String The WEB_MGR_API_KEY for GWM nil

ganeti_webmgr::bootstrap_user

['ganeti_webmgr']['superusers'] List Takes a list of hashes containing the following keys: username, email and password []

ganeti_webmgr::hosts

['ganeti_webmgr']['hostsfile'] Hash A mapping of ips to hostnames to add to `/etc/hosts/` {}

ganeti_webmgr::apache

['ganeti_webmgr']['apache']['application_name'] String Name of vhost file. `.conf` is added to the end automatically. ganeti_webmgr
['ganeti_webmgr']['apache']['server_name'] String Servername for apache vhost node['hostname']
['ganeti_webmgr']['apache']['server_aliases'] List A list of server_alises for the apache vhost [node['fqdn']]
['ganeti_webmgr']['apache']['processes'] Int Number of WSGI processes to run for GWM. 4
['ganeti_webmgr']['apache']['Threads'] Int Number of threads for each WSGI process in GWM. 1

ganeti_webmgr::database

['ganeti_webmgr']['db_server']['user'] String User to login to the database server as when creating a database for GWM. nil
['ganeti_webmgr']['db_server']['password'] String Password to login to the database server as when creating a database for GWM. nil

Usage

ganeti_webmgr::default or ganeti_webmgr::mysql

Just include ganeti_webmgr in your node's run_list. If you want to have it deploy, install mysql server and bootstrap a database for you use ganeti_webmgr::mysql:

{
  "name":"my_node",
  "run_list": [
    "recipe[ganeti_webmgr]"
  ]
}

or

{
  "name":"my_node",
  "run_list": [
    "recipe[ganeti_webmgr::mysql]"
  ]
}

Only use the mysql recipe if you want mysql server installed. If you simply want to use GWM with a different mysql server, use the ganeti_webmgr::default recipe and set the appropriate attributes.

ganeti_webmgr::bootstrap_user

Just include ganeti_webmgr::bootstrap_user in addition to one of the previous recipes in run_list:

{
  "name":"my_node",
  "run_list": [
    "recipe[ganeti_webmgr::default]"
    "recipe[ganeti_webmgr::bootstrap_user]"
  ]
}

Then set the attribute node['ganeti_webmgr']['superusers'] to something like this:

[
  {
    "username": "foo",
    "password": "bar",
    "email": "[email protected]"
  },
  {
    "username": "admin",
    "password": "secret",
    "email": "[email protected]"
  }
]

ganeti_webmgr::hosts

This recipe is used to add hostname aliases in /etc/hosts. In the vagrant environment, it defaults to adding hostnames to be used with vagrant- ganeti.

Databags

The ganeti_webmgr cookbook supports loading passwords and secrets using either attributes or through chef's encrypted databags.

Currently the cookbook expects all secrets to be in a single databag called ganeti_webmgr, and in an item called passwords.

Here are the list of values according to their purpose if you wish to use databags:

  • db_password: This is used with the ganeti_webmgr::database recipe. This is what the recipe will set as the password for the user specified in node['ganeti_webmgr']['database']['user'] on the database being created.
  • db_server: This is a hash which should contain the key password and optionally user, which are the actual credentials needed to login to the database application (mysql/postgres) to add a user, and create a database for that user. Essentially, this contains the credentials for a db user with create database permissions.
  • secret_key and web_mgr_api_key: Each of these correspond directly to the settings in GWM's config.yml.
  • superusers: This should be a list of hashes containing the keys username, password, and email. Each item in the list will be added as a superuser to GWM.

Note: These databag values are only used if the attributes for them are not set

Here's an example databag in unencrypted form for the vagrant environment:

{
    "id": "passwords",
    "db_password": "vagrant",
    "db_server": {
        "password": "rootpass"
    },
    "secret_key": "eo6uuJeegah9vieHahnahriv5noivahT",
    "web_mgr_api_key": "quae5aethaehahCeiquaenahjaice3ei",
    "superusers": [
        {
            "username": "admin",
            "password": "password",
            "email": "[email protected]"
        }
    ]
}

License and Authors

Authors: Chance Zibolski [email protected]

ganeti_webmgr's People

Contributors

bramwelt avatar chancez avatar jordane avatar ramereth avatar tschuy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.