What is it ?
Here are capistrano extensions to be used with master-chef
How to use it
- Add
master-capto your Gemfile - Load
master-capin your Capfile:require 'master-cap' - Choose a topology driver and load it
**
on :load, :load_topology_directory** Create a subdirectory namedtopology, and add your toplogy YAML files into - Enjoy :)
Topology file
Example of a topology file: integ.yml
:topology:
:app:
:hostname: my_app_server.mydomain.net
:type: linux_chef
:roles:
- app_server
:db:
:hostname: db_server.mydomain.net
:type: linux_chef
:roles:
- db_server
:redis:
:hostname: redise.mydomain.net
:type: linux_chef
:roles:
- redis_server
:cap_override:
:my_specific_cap_param: 'toto'
:default_role_list:
- baseCapistrano commands
Node selection
cap integ showcap app-integ showcap integ_db_server show
SSH command
-
cap integ check: try to connect on each nodes with ssh -
cap integ ssh_cmd -s cmd=uname: execunamecommand on each nodes
Master-chef binding
Configuration
If you use only master-chef (no custom repo with Chef recipes), you have nothing to do.
If you use a custom repo, please add following lines before requiring master-cap
set :git_repos_manager_class, 'SimpleGitReposManager'
set :git_repos, [
{
:url => "http://github.com/octo-technology/master-chef.git",
:ref => "aa597911b6d394dff27338c825aa966105cb6607",
},
{
:url => "git@github.com:xxxx/yyyy.git",
:local_path => "../yyyy",
}
]Note:
-
:refis used to lock master-chef version -
:local_pathis used to runchef:local
Cap commands
-
cap integ chef: run chef on all servers -
cap app-integ chef:local: run chef on app server, using local recipes. Usefull for debugging. -
cap app-integ chef:generate_local_json: generate thelocal.jsonfile using current topology. -
cap app-integ chef:stack: output last chef stack trace -
cap integ chef:stack: purge all master-chef git repos caches
License
Copyright 2012 Bertrand Paquet
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.