Skip to content

yohoushi/chef-yohoushi

Repository files navigation

Yohoushi Cookbook

Chef cookbook for Yohoushi.

Create a database and a database user on MySQL for yohoushi, and install yohoushi.

Middleware Requirements

Yohoushi requires followings, but this cookbook does not install them. Please install them by other recipes or manually.

  • Ruby (>=2.0.0)
  • MySQL or Sqlite3 (>=3.6.16)
  • GrowthForecast (>=0.62)

Usage

Install Yohoushi on localhost

Assume (You can configure at attributes/default.rb)

  • Your username is vagrant and yohoushi will be installed to /home/vagrant/yohoushi
  • Ruby is already installed on /home/vagrant/.rbenv/versions/2.1.0/bin/ruby with rbenv
  • Mysql is already working on localhost:3306 with empty root password

Then, install yohoushi by

git clone https://github.com/yohoushi/chef-yohoushi ~/chef-yohoushi
cd ~/chef-yohoushi
bundle install
bundle exec knife solo cook localhost

and start yohoushi as

cd ~/yohoushi
rbenv local 2.1.0
bin/yohoushi

See Yohoushi manual page for further details.

Install Yohoushi to a remote host

Assume (You can configure at attributes/default.rb)

  • Your username at remote host is vagrant and yohoushi will be installed to /home/vagrant/yohoushi
  • Ruby is already installed on /home/vagrant/.rbenv/versions/2.1.0/bin/ruby with rbenv
  • Mysql is already working on port 3306 with empty root password

Then, install by

HOSTNAME="YOUR_REMOTE_HOSTNAME"
git clone https://github.com/yohoushi/chef-yohoushi ~/chef-yohoushi
cd ~/chef-yohoushi
bundle install
# bundle exec berks install --path cookbooks
cp nodes/localhost.json nodes/$HOSTNAME.json
bundle exec knife solo prepare $HOSTNAME
bundle exec knife solo cook $HOSTNAME

and start yohoushi as

ssh $HOSTNAME
ssh> cd ~/yohoushi
ssh> rbenv local 2.1.0
ssh> bin/yohoushi

See Yohoushi manual page for further details.

Use as a community cookbook

Use Berkshelf, and append below to your Berksfile

cookbook 'yohoushi', git: 'https://github.com/yohoushi/chef-yohoushi'

To run yohoushi recipe; add a run_list to your node.json

"run_list": [
  "yohoushi"
]

Attributes

chef_yohoushi::default

Key Type Description Default
yohoushi/app/owner String user name to own files vagrant
yohoushi/app/group String group name to own files vagrant
yohoushi/app/path String where the application is deployed to /home/vagrant/yohoushi
yohoushi/ruby/ruby_path String path to ruby command (is required >= 2.0.0) /home/vagrant/.rbenv/versions/2.1.0/bin/ruby
yohoushi/ruby/gem_path String path to gem command /home/vagrant/.rbenv/versions/2.1.0/bin/gem
yohoushi/database/name String Database name yohoushi
yohoushi/database/root_password String MySQL root user's password. This is required to create yohoushi database nil (This param is required!)
yohoushi/database/username String MySQL username to run yohoushi yohoushi
yohoushi/database/password String MySQL user's password to run yohoushi yohoushi
yohoushi/database/host String hostname of MySQL server localhost
yohoushi/database/port Integer port number of MySQL server 3306

ToDo

  • Enable to install ruby, mysql, and GrowthForecast if users set integration option

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

License: MIT Authors: Nobuhiro Nikushi, Naotoshi Seo

About

Chef Cookbook for Yohoushi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages