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.
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.
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']['superusers'] | List | Takes a list of hashes containing the following keys: username, email and password | [] |
['ganeti_webmgr']['hostsfile'] | Hash | A mapping of ips to hostnames to add to `/etc/hosts/` | {} |
['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']['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 |
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.
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]"
}
]
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.
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 theganeti_webmgr::database
recipe. This is what the recipe will set as the password for the user specified innode['ganeti_webmgr']['database']['user']
on the database being created.db_server
: This is a hash which should contain the keypassword
and optionallyuser
, 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
andweb_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 keysusername
,password
, andemail
. 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]"
}
]
}
Authors: Chance Zibolski [email protected]