Skip to content

7x7labs/ops-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ops Tools

This repo contains rake tasks to automate some of our DevOps needs. It makes use of [Fog] fog github and Chef chef to create and configureservers in the cloud.

Openstack compatability is broken at this time.

create up ec2 web servers

  • installs chef clients on the web servers
  • installs and configures rbenv, nginx, git, etc
  • delpoys a sinatra web app
  • launches and configures load balancer
  • configures dns for the app

creates ec2 xmpp servers

  • installs chef clients on the xmpp servers
  • installs and configures git, java, tigase

Clone the repo and install gems

cd ~ 
git clone [email protected]:splap/fogdemo.git
cd fogdemo 
bundle install

Set up Chef

Create a free hosted chef account at [OpsCode] chef signup and save your private key as fogdemo.pem and set permissions

chmod og-r ~/.ssh/fogdemo/fogdemo.pem

Install knife and create a Chef Client for our new hosted chef account.

cd ~/fogdemo/chef
sudo gem install chef --no-ri --no-rdoc

knife client create fogclient -a -f "~/ssh/fogdemo/validator.pem"

# see the new client
knife client list

Fetch cookbook declarations from OpsCode

cd ~/fogdemo/chef
librarian-chef install --clean --verbose

Upload roles and cookbooks to hosted chef server

rake push_chef_updates

Spin up a webserver

Fog creates a server, and bootstraps chef. chef installs rbenv, git, nginx, logrotate, etc. It then pulls a sinatra app, installs required gems, and starts up puma.

rake create_web

Configure DNS and load balancing

Connect to or create a load balancer and tell it which web instance to use

rake lb

Configure DNS. Points an alias A record at the load balancer

rake dns

Update all webservers. This will apply chef configuration changes and update the sinatra app. This would not work in a zero downtime deploy strategy without more effort.

rake update_web

Care and feeding

Get an overview of the app's cloud deployment (default rake task)

rake

Stop and destroy a web server

rake destroy_server['server_id']

Stop and abandon all existing servers

rake destroy_all

XMPP

Upload xmpp role on the hosted chef server

knife role from file roles/xmppserver.rb

Create a new xmpp server - installs chef client and runs xmpp role, installing java, tigase, derby db, etc.

rake create_xmpp

Update all xmpp servers

rake update_xmpp

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published