• Stars
    star
    1,189
  • Rank 39,340 (Top 0.8 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The easiest, most common sense configuration management tool... because you just use fucking shell scripts.

Fucking Shell Scripts

The easiest, most common sense server configuration management tool...because you just use fucking shell scripts.

Completely confused by Chef? Blowing your brains out over Ansible? Lost control of your Puppets? Wanna just use fucking shell scripts to configure a server? Read on!

Activity

While this project served a very specific purpose, ongoing development has stopped. Pull requests will be accepted, but it is currently not being actively developed.

Features

  • Wraps up the fog gem, so it can be used on any cloud service, including AWS, rackspace, etc.
  • We've intentionally designed this tool to be insanely easy to use

Step 0: Install the gem

gem install fucking_shell_scripts

Step 1: Create a project directory

mkdir config_management

Folder structure:

  • /servers (required) - yaml server definitions (see example below)

  • /scripts (required) - the shell scripts that will configure your servers (see example below)

  • /files (optional) - files to be transferred to servers (nginx.conf, ssh keys, database.yml, etc.)

An example folder structure:

./config_management
β”œβ”€β”€ files
β”‚   β”œβ”€β”€ keys
β”‚   β”‚   └── deploy_key
β”‚   └── rails_config
β”‚       └── database.yml
β”œβ”€β”€ scripts
β”‚   β”œβ”€β”€ apt.sh
β”‚   β”œβ”€β”€ deploy_key.sh
β”‚   β”œβ”€β”€ git.sh
β”‚   β”œβ”€β”€ redis.sh
β”‚   β”œβ”€β”€ ruby2.sh
β”‚   β”œβ”€β”€ rubygems.sh
β”‚   β”œβ”€β”€ search_service_code.sh
β”‚   └── search_service_env.sh
└── servers
    β”œβ”€β”€ defaults.yml
    └── search-server.yml

Step 2: Create a server definition file

The server definition file defines how to build a type of server. Server definitions override settings in defaults.yml.

# servers/search-server.yml
##################################################
# This file defines how to build our search server
##################################################

name: search-server
size: c1.xlarge
availability_zone: us-east-1d
image: ami-90374bf9
key_name: pd-app-server
private_key_path: /Users/yourname/.ssh/pd-app-server
security_groups: search-service  # override the security_groups defined in defaults.yml

############################################
# Files necessary to build the search server
############################################

files:
  - files/keys/deploy_key

###########################################
# Scripts needed to build the search server
###########################################

scripts:
  - scripts/apt.sh
  - scripts/search_service_env.sh
  - scripts/git.sh
  - scripts/ruby2.sh
  - scripts/rubygems.sh
  - scripts/redis.sh
  - scripts/deploy_key.sh

servers/defaults.ymlhas the same structure and keys a server definition file, except, you cannot define scripts or files.

# servers/defaults.yml
################################
# This file defines our defaults
################################

security_groups: simple-group
size: c1.medium
image: ami-e76ac58e
availability_zone: us-east-1d
key_name: global-key
cloud:
  provider: AWS
  aws_access_key_id: <%= ENV["AWS_ACCESS_KEY"] %>
  aws_secret_access_key: <%= ENV["AWS_SECRET_ACCESS_KEY"] %>
  region: us-east-1

Cloud options

Anything passed in the 'cloud' key will be directly passed to Fog::Compute.new. See the fog website for more info.

FSS will consider any values that look like "ENV[VAR_NAME]" to be environment variables, and will attempt to look up that environment variable. If FSS does not find that variable, an exception will be raised.

Step 3: Add shell scripts that configure the server

Seriously...just write shell scripts.

Want to install Ruby 2? Here's an example:

#!/bin/sh
#
# scripts/ruby2.sh
#
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure --prefix=/usr/local
make
sudo make install
rm -rf /tmp/ruby*

Step 4: Build/configure your server

fss search-server

This command does 2 things:

  1. Builds the new server
  2. Runs the scripts configuration

To build only:

fss --build search-server

To configure only:

fss --instance-id i-9ad6d7af --configure search-server

Note: --instance-id is required when using the --configure option

Step 5: Remove your chef repo and all its contents.

rm -rf ~/old_config_management/chef

HOLY SHIT! THAT WAS EASY.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

More Repositories

1

sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
Ruby
2,645
star
2

so_meta

A gem to simply manage meta content (title, description, canonical url, etc.) from within a Rails application
Ruby
62
star
3

rails_templates

Ruby
22
star
4

icloud

Authenticate to iCloud and provide information about recent backups
Ruby
12
star
5

bootstrap-tooltip-rails

A Ruby Gem that integrates the code necessary to easily use Twitter's Bootstrap Tooltip library within your application.
Ruby
10
star
6

sinatra-modular-template

Sinatra template to serve as an organized template for a modular Sinatra application.
Ruby
9
star
7

TomDoc-Sublime

TomDoc package for Sublime Text 2
8
star
8

fucking_shell_scripts_skeleton

A skeleton app for the fucking_shell_scripts gem.
Shell
7
star
9

dotfiles

Shell
7
star
10

angular-coffeescript

A bootstrap app for Angular using Coffeescript.
CoffeeScript
6
star
11

brandonhilkert.github.io

HTML
5
star
12

mongo-restore-s3

Ruby
5
star
13

mega_lotto

A Ruby gem to generate lottery drawings.
Ruby
4
star
14

sales_safari

A tracker for Amy Hoy's "Sales Safari"
Ruby
3
star
15

fuckingshellscripts.org

JavaScript
3
star
16

sublime-ruby-key-commands

Serves as an easy-to-read list of Ruby-related Sublime Text 2 key commands.
3
star
17

sublime-snippets

Custom snippets for Sublime Text 2
2
star
18

jquery.formstyle

Formstyle is a jQuery plugin that helps stylize form elements
JavaScript
2
star
19

Rock

Rock, Paper, Scissors done in Sinatra with Bootstrap
Ruby
2
star
20

brandonhilkert.com

The code used for the personal website brandonhilkert.com
Ruby
2
star
21

passwordless

Passwordless is a Rails 4 / Ruby 2.0 webapp that features a password-less log on system.
Ruby
2
star
22

monsoon

Monsoon is a MongoDB backup tool that allows you to take backups and store them in Amazon S3.
Ruby
2
star
23

sinatra-classic-template

A basic Sinatra classic application template with ERB, jQuery, and a layout.
Ruby
2
star
24

ironman

An Ironman training schedule that's mobile friendly
JavaScript
1
star
25

engtagger

Ruby
1
star
26

five

Ruby
1
star
27

test_turbolinks_behavior

Ruby
1
star
28

links

A simple link saver application.
JavaScript
1
star
29

egg_carton

Egg Carton is a series of Ruby number helpers to help with reporting conversions and click-throughs.
1
star
30

list

List application to experiment with Postgres, Test Unit, and Backbone
Ruby
1
star
31

mongo_metrics

Mongo Metrics is query tracker for Rails
Ruby
1
star
32

five-api

API layer for Five application
Ruby
1
star
33

iamlightning

The repository for http://iamlightning.com
Ruby
1
star
34

grocery-old

Grocery is a Sinatra-based grocery list that uses Redis as a backed and allows you to collaborate with another person by sharing the List URL.
Ruby
1
star