Commit e22139d

mo khan <mo@mokhan.ca>
2015-11-11 18:54:38
slim down the rails recipes.
1 parent cd49335
attributes/default.rb
@@ -1,15 +1,61 @@
-default['user']['username'] = 'rails'
-default['capistrano']['root_path'] = '/var/www/app'
-default['capistrano']['username'] = node['user']['username']
-default['capistrano']['env'] = {
+if node.platform_family == "rhel"
+  default['stronglifters']['packages'] = %w{
+    autoconf
+    automake
+    bison
+    bzip2
+    ca-certificates
+    gcc-c++
+    git
+    libffi-devel
+    libtool
+    libxml2
+    libxml2-devel
+    libxslt
+    libxslt-devel
+    make
+    openssl-devel
+    patch
+    readline
+    readline-devel
+    zlib
+    zlib-devel
+  }
+else
+  default['stronglifters']['packages'] = %w{
+    build-essential
+    curl
+    git-core
+    libcurl4-openssl-dev
+    libffi-dev
+    libreadline-dev
+    libssl-dev
+    libxml2-dev
+    libxslt1-dev
+    libyaml-dev
+    python-software-properties
+    zlib1g-dev
+  }
+end
+
+default['stronglifters']['application_name'] = "app"
+default['stronglifters']['aws']['profiles']['default']['region'] = 'us-east-1'
+default['stronglifters']['aws']['profiles']['default']['aws_access_key_id'] = 'secret'
+default['stronglifters']['aws']['profiles']['default']['aws_secret_access_key'] = 'secret'
+default['stronglifters']['root_path'] = "/var/www/#{node['stronglifters']['application_name']}"
+default['stronglifters']['current_path'] = "#{node['stronglifters']['root_path']}/current"
+default['stronglifters']['nginx']['blacklisted_ips'] = []
+default['stronglifters']['nginx']['domain'] = 'www.example.com'
+default['stronglifters']['ruby_version'] = '2.2.3'
+default['stronglifters']['username'] = 'rails'
+
+default['stronglifters']['env'] = {
   asset_host: '',
+  rails_env: 'production',
   secret_token: ''
 }
-default['nginx']['domain'] = 'www.example.com'
-default['nginx']['current_path'] = "#{node['capistrano']['root_path']}/current"
-default['nginx']['shared_path'] = "#{node['capistrano']['root_path']}/shared"
-default['nginx']['socket_file'] = "#{node['capistrano']['root_path']}/shared/tmp/sockets/puma.sock"
-default['nginx']['ssl']['key'] = <<-DATA
+
+default['stronglifters']['nginx']['ssl']['key'] = <<-SELFSIGNED
 -----BEGIN RSA PRIVATE KEY-----
 MIICWwIBAAKBgQCbfQuXVpccfpOmBHGfkZVfgfOZpMLGX3XmxFrer20aGM6vG9JR
 75QmD28bnDnQPaLGMzCmsg6nhi0Lz+c+u9DdCKRVgZbCK5MJo7FsVRLR9vEdhGkT
@@ -25,8 +71,8 @@ AZ0Y1dz0bSiO0BIjjAwSKe8Nz+xPiSn/xjf/g0ufmCazi9SDZwQ5TyJjjfxDJ/7p
 KhQWzwbGnN2FUW9r2QJADT7SMkMHb9bOgUJnLehLQY0sONrfAMJ7NieJk24PyX83
 bBV1YGbhWentkyZBkgcvYqVlxGTPvIao1x69xSJhOw==
 -----END RSA PRIVATE KEY-----
-DATA
-default['nginx']['ssl']['crt'] = <<-DATA
+SELFSIGNED
+default['stronglifters']['nginx']['ssl']['crt'] = <<-SELFSIGNED
 -----BEGIN CERTIFICATE-----
 MIIDYzCCAsygAwIBAgIJAKQbJHHxbt63MA0GCSqGSIb3DQEBBQUAMH8xCzAJBgNV
 BAYTAkNBMRAwDgYDVQQIEwdBbGJlcnRhMRAwDgYDVQQHEwdDYWxnYXJ5MRYwFAYD
@@ -48,16 +94,4 @@ wF+ITsPDm1nWbGZ8h8tVc6VYdHPyAX95X9/F9h1u2z8E36A5CQ9aTaS6aU1KnNTh
 Mthn8jGpgIJeFo2Jphx/QjEVUrLQdPg3pN00uJOTa8Sk4OEWSiqw5P9w0tj0Wicz
 60evIdcHAQ==
 -----END CERTIFICATE-----
-DATA
-default['unicorn']['username'] = node['user']['username']
-default['unicorn']['current_path'] = "#{node['capistrano']['root_path']}/current"
-default['unicorn']['rails_env'] = node.chef_environment
-default['puma']['username'] = node['user']['username']
-default['puma']['current_path'] = "#{node['capistrano']['root_path']}/current"
-default['puma']['rails_env'] = node.chef_environment
-#default['rbenv']['ruby_version'] = '2.2.2'
-default['rbenv']['rubies'] = [ "2.2.2" ]
-default['aws']['username'] = node['user']['username']
-default['aws']['profiles']['default']['region'] = 'us-east-1'
-default['aws']['profiles']['default']['aws_access_key_id'] = 'secret'
-default['aws']['profiles']['default']['aws_secret_access_key'] = 'secret'
+SELFSIGNED
files/default/blacklist.conf
@@ -1,2 +0,0 @@
-deny 46.118.159.178;
-deny 134.249.77.209;
files/rbenv.sh
@@ -0,0 +1,3 @@
+export RBENV_ROOT="/usr/local/rbenv"
+export PATH="$RBENV_ROOT/bin:$PATH"
+eval "$(rbenv init -)"
libraries/platform.rb
@@ -0,0 +1,7 @@
+class Chef
+  class Recipe
+    def redhat?
+      node.platform_family == 'rhel'
+    end
+  end
+end
libraries/rbenv.rb
@@ -0,0 +1,11 @@
+class Chef
+  class Recipe
+    def rbenv(command)
+      stronglifters_rbenv(command)
+    end
+
+    def gem(command)
+      stronglifters_gem(command)
+    end
+  end
+end
providers/gem.rb
@@ -0,0 +1,10 @@
+use_inline_resources
+
+action :install do
+  bash "gem_#{new_resource.name}" do
+    code <<-BASH
+source /etc/profile.d/rbenv.sh
+gem install #{new_resource.name} --no-ri --no-rdoc
+BASH
+  end
+end
providers/rbenv.rb
@@ -0,0 +1,10 @@
+use_inline_resources
+
+action :run do
+  bash "rbenv_#{new_resource.command}" do
+    code <<-BASH
+source /etc/profile.d/rbenv.sh
+rbenv #{new_resource.command}
+BASH
+  end
+end
recipes/aws.rb
@@ -1,28 +1,22 @@
-configuration = node['aws']
+package 'python-pip'
+execute 'pip install awscli'
 
-package 'python-pip' do
-  action :install
-end
-
-execute 'install awscli' do
-  command 'pip install awscli'
-  action :run
-end
-
-directory "/home/#{configuration["username"]}/.aws/" do
-  owner configuration['username']
-  group configuration['username']
+username = node['stronglifters']['username']
+directory "/home/#{username}/.aws/" do
+  owner username
+  group username
   mode "0755"
   recursive true
   action :create
 end
 
-template "/home/#{configuration["username"]}/.aws/config" do
+configuration = node['stronglifters']['aws']
+template "/home/#{username}/.aws/config" do
   source "aws/config.erb"
   variables(configuration)
 end
 
-template "/home/#{configuration["username"]}/.aws/credentials" do
+template "/home/#{username}/.aws/credentials" do
   source "aws/credentials.erb"
   variables(configuration)
 end
recipes/capistrano.rb
@@ -1,55 +0,0 @@
-include_recipe "stronglifters::user"
-
-configuration = node['capistrano']
-root_path = configuration['root_path']
-shared_path = File.join(root_path, "shared")
-
-directories = [
-  root_path,
-  shared_path,
-  "#{shared_path}/backups",
-  "#{shared_path}/bundle",
-  "#{shared_path}/config",
-  "#{shared_path}/log",
-  "#{shared_path}/tmp/sockets",
-  "#{shared_path}/tmp/pids",
-  "#{shared_path}/tmp/cache",
-  "#{root_path}/releases",
-]
-
-directories.each do |dir_name|
-  directory dir_name do
-    owner configuration['username']
-    group configuration['username']
-    mode "0755"
-    recursive true
-    action :create
-  end
-end
-
-template "#{shared_path}/.env.#{node.chef_environment}" do
-  source "env.erb"
-  owner configuration['username']
-  group configuration['username']
-  mode "0600"
-  variables(configuration)
-end
-
-execute "chown-rails" do
-  command "chown -R rails:rails #{root_path}"
-  user "root"
-  action :run
-  not_if "stat -c %U #{root_path} | grep root"
-end
-
-template "#{shared_path}/config/database.yml" do
-  source "database.yml.erb"
-  mode "0664"
-  variables({
-    rails_env: node.chef_environment,
-    database: node['postgres']["database"],
-    username: node['postgres']['username'],
-    password: node['postgres']["password"],
-    host: node['postgres']['host'],
-  })
-end
recipes/default.rb
@@ -1,32 +1,10 @@
-include_recipe "apt"
-include_recipe "build-essential"
-include_recipe "stronglifters::user"
-include_recipe "stronglifters::aws"
+if redhat?
+  execute "yum update -y"
+else
+  execute "apt-get update -y"
+end
 
-package [
-  "curl",
-  "libcurl3", "libcurl3-gnutls", "libcurl4-openssl-dev",
-  "git-core",
-  "python-software-properties",
-  "build-essential",
-  "tklib",
-  "zlib1g-dev",
-  "libssl-dev",
-  "libxml2",
-  "libxml2-dev",
-  "libxslt1-dev",
-  "gawk",
-  "libreadline6-dev",
-  "libyaml-dev",
-  "libsqlite3-dev",
-  "autoconf",
-  "libgdbm-dev",
-  "libncurses5-dev",
-  "automake",
-  "libtool",
-  "bison",
-  "pkg-config",
-  "libffi-dev",
-  "vim",
-  "unzip",
-]
+package node['stronglifters']['packages']
+
+include_recipe "runit"
+include_recipe "stronglifters::ruby"
recipes/nginx.rb
@@ -1,23 +1,21 @@
-include_recipe "apt"
-apt_repository "nginx-stable" do
-  uri "http://ppa.launchpad.net/nginx/stable/ubuntu"
-  distribution node['lsb']['codename']
-  components ["main"]
-  keyserver "keyserver.ubuntu.com"
-  key "C300EE8C"
+if redhat?
+  execute "yum upgrade -y ca-certificates"
+  package "epel-release"
 end
 
-package 'nginx' do
-  action :install
+package "nginx"
+package "logrotate"
+user "nginx"
+
+configuration = node['stronglifters']['nginx']
+
+template "/etc/nginx/nginx.conf" do
+  variables(configuration)
+  notifies :restart, 'service[nginx]'
 end
-package 'logrotate'
 
-configuration = node['nginx']
 directory "/etc/nginx/ssl" do
-  owner "root"
-  group "root"
   mode "0644"
-  action :create
 end
 
 template "/etc/nginx/ssl/#{configuration['domain']}.crt" do
@@ -34,36 +32,15 @@ template "/etc/nginx/ssl/#{configuration['domain']}.key" do
   notifies :restart, "service[nginx]"
 end
 
-cookbook_file "/etc/nginx/conf.d/blacklist.conf" do
-  source "blacklist.conf"
-  mode "0644"
-end
-
-template "/etc/nginx/sites-available/#{configuration['domain']}" do
-  source "nginx_unix.erb"
-  mode "0644"
-  variables(configuration)
-  notifies :restart, "service[nginx]"
-end
-
-link "/etc/nginx/sites-enabled/#{configuration['domain']}" do
-  to "/etc/nginx/sites-available/#{configuration['domain']}"
-end
-
-file "/etc/nginx/sites-enabled/default" do
-  action :delete
-end
-
 directory '/var/log/nginx' do
   mode '0755'
-  action :create
+end
+
+service "nginx" do
+  action [:enable, :start]
 end
 
 template "/etc/logrotate.d/nginx" do
   source "nginx_logrotate.erb"
   mode "0644"
 end
-
-service "nginx" do
-  action [:enable, :start]
-end
recipes/nodejs.rb
@@ -1,13 +0,0 @@
-include_recipe "apt"
-
-apt_repository "node" do
-  uri "http://ppa.launchpad.net/chris-lea/node.js/ubuntu"
-  distribution node['lsb']['codename']
-  components ["main"]
-  keyserver "keyserver.ubuntu.com"
-  key "C7917B12"
-end
-
-package "nodejs" do
-  action :upgrade
-end
recipes/postgres.rb
@@ -1,4 +1,3 @@
-include_recipe "stronglifters::rbenv"
 include_recipe "postgresql::server"
 include_recipe "postgresql::contrib"
 include_recipe "database::postgresql"
recipes/puma.rb
@@ -1,29 +0,0 @@
-configuration = node['puma']
-
-template "/etc/init.d/puma" do
-  source "puma.erb"
-  owner configuration['username']
-  group configuration['username']
-  mode "0744"
-  variables(configuration)
-end
-
-template "/usr/local/bin/run-puma" do
-  source "run-puma.erb"
-  owner configuration['username']
-  group configuration['username']
-  mode "0744"
-  variables(configuration)
-end
-
-template "/etc/puma.conf" do
-  source "puma.conf.erb"
-  owner configuration['username']
-  group configuration['username']
-  mode "0744"
-  variables(configuration)
-end
-
-service "puma" do
-  action [:enable, :start]
-end if File.exists?("#{configuration['current_path']}/Gemfile")
recipes/rails.rb
@@ -1,25 +1,60 @@
-include_recipe "stronglifters::rbenv"
-include_recipe "stronglifters::capistrano"
+include_recipe "stronglifters::user"
+include_recipe "stronglifters::aws"
 include_recipe "stronglifters::nginx"
-include_recipe "stronglifters::puma"
-include_recipe "stronglifters::nodejs"
-
-[
-  'imagemagick',
-  'libmagickwand-dev',
-  'memcached',
-  'logrotate',
-  'sqlite3',
-].each do |item|
-  package item do
-    action :install
-  end
-end
 
-shared_path = "#{node['capistrano']['root_path']}/shared"
+root_path = node['stronglifters']['root_path']
+shared_path = File.join(root_path, 'shared')
+current_path = File.join(root_path, 'current')
 
 template "/etc/logrotate.d/rails" do
   source "rails_logrotate.erb"
   mode "0644"
   variables({ shared_path: shared_path })
 end
+
+directories = [
+  root_path,
+  shared_path,
+  "#{shared_path}/config",
+  "#{shared_path}/log",
+  "#{shared_path}/tmp/sockets",
+  "#{shared_path}/tmp/pids",
+  "#{shared_path}/tmp/cache",
+  "#{root_path}/releases",
+]
+
+directories.each do |dir_name|
+  directory dir_name do
+    mode "0755"
+    recursive true
+    action :create
+  end
+end
+
+username = node['stronglifters']['username']
+execute "chown -R #{username}:#{username} #{root_path}" do
+  not_if "stat -c %U #{root_path} | grep root"
+end
+
+template "#{shared_path}/config/database.yml" do
+  source "database.yml.erb"
+  mode "0664"
+  variables({
+    rails_env: node.chef_environment,
+    database: node['postgres']["database"],
+    username: node['postgres']['username'],
+    password: node['postgres']["password"],
+    host: node['postgres']['host'],
+  })
+end
+
+gem "foreman"
+
+startup = File.exists?("#{current_path}/Gemfile")
+runit_service "foreman" do
+  action [:enable, :start]
+  default_logger true
+  env node['stronglifters']['env']
+  log true
+  retries 3
+end if startup
recipes/rbenv.rb
@@ -1,5 +0,0 @@
-include_recipe "ruby_build::default"
-include_recipe "ruby_rbenv::system"
-
-configuration = node['rbenv']
-rbenv_global configuration['rubies'].first
recipes/ruby.rb
@@ -0,0 +1,18 @@
+git "/usr/local/rbenv" do
+  repository "https://github.com/sstephenson/rbenv.git"
+end
+
+cookbook_file "/etc/profile.d/rbenv.sh"
+directory "/usr/local/rbenv/plugins"
+
+git "/usr/local/rbenv/plugins/ruby-build" do
+  repository "https://github.com/sstephenson/ruby-build.git"
+end
+
+ruby_version = node["stronglifters"]["ruby_version"]
+stronglifters_rbenv "install #{ruby_version}" do
+  not_if { ::File.exist?("/usr/local/rbenv/versions/#{ruby_version}") }
+end
+rbenv "global #{ruby_version}"
+
+gem "bundler"
recipes/unicorn.rb
@@ -1,13 +0,0 @@
-configuration = node['unicorn']
-
-template "/etc/init.d/unicorn" do
-  source "unicorn.erb"
-  owner configuration[:username]
-  group configuration[:username]
-  mode "0744"
-  variables(configuration)
-end
-
-service "unicorn" do
-  action [:enable, :start]
-end if File.exists?("#{configuration[:current_path]}/Gemfile")
recipes/user.rb
@@ -1,8 +1,6 @@
-configuration = node['user']
-
-user configuration['username'] do
+user node['stronglifters']['username'] do
   supports manage_home: true
   comment "rails user"
-  home "/home/#{configuration['username']}"
+  home "/home/#{node['stronglifters']['username']}"
   shell "/bin/bash"
 end
resources/gem.rb
@@ -0,0 +1,4 @@
+actions :install
+default_action :install
+
+attribute :name, name_attribute: true
resources/rbenv.rb
@@ -0,0 +1,4 @@
+actions :run
+default_action :run
+
+attribute :command, name_attribute: true
spec/nodejs_spec.rb
@@ -1,11 +0,0 @@
-describe "stronglifters::nodejs" do
-  let(:chef_run) do
-    ChefSpec::SoloRunner.new do |node|
-      node.set["lsb"]["codename"] = "trusty"
-    end.converge(described_recipe)
-  end
-
-  it "upgrades nodejs" do
-    expect(chef_run).to upgrade_package("nodejs")
-  end
-end
spec/postgres_spec.rb
@@ -6,7 +6,6 @@ describe "stronglifters::postgres" do
       node.set["postgres"]["username"] = database_user
       node.set["postgresql"]["password"]['postgres'] = database_password
       node.set["postgresql"]["config"] = {}
-      node.set["rbenv"]["install_pkgs"] = []
     end.converge(described_recipe)
   end
 
spec/puma_spec.rb
@@ -1,37 +0,0 @@
-describe "stronglifters::puma" do
-  subject do
-    ChefSpec::SoloRunner.new do |node|
-      node.set['puma'] = configuration
-    end.converge(described_recipe)
-  end
-
-  let(:username) { FFaker::Internet.user_name }
-  let(:configuration) do
-    {
-      username: username,
-      current_path: '/tmp',
-    }
-  end
-
-  it 'creates the puma init.d script' do
-    expect(subject).to create_template("/etc/init.d/puma")
-      .with_source("puma.erb")
-      .with_owner(username)
-      .with_group(username)
-      .with_mode("0744")
-  end
-
-  context "when the app is deployed" do
-    before :each do
-      FileUtils.touch('/tmp/Gemfile')
-    end
-
-    after :each do
-      FileUtils.rm('/tmp/Gemfile')
-    end
-
-    it 'starts the puma service' do
-      expect(subject).to start_service("puma")
-    end
-  end
-end
spec/capistrano_spec.rb → spec/rails_spec.rb
@@ -1,8 +1,8 @@
-describe "stronglifters::capistrano" do
+describe "stronglifters::rails" do
   subject do
     ChefSpec::SoloRunner.new do |node|
-      node.set["capistrano"]["root_path"] = root_path
-      node.set["capistrano"]["username"] = username
+      node.set["stronglifters"]["root_path"] = root_path
+      node.set["stronglifters"]["username"] = username
       node.set["postgres"]["database"] = "app"
       node.set["postgres"]["username"] = username
       node.set["postgres"]["password"] = "password"
@@ -19,22 +19,14 @@ describe "stronglifters::capistrano" do
 
   it "creates the root directory for the application" do
     expect(subject).to create_directory(root_path)
-      .with_owner(username)
-      .with_group(username)
-      .with_mode("0755")
   end
 
   it "creates the shared directory for the application" do
     expect(subject).to create_directory("#{root_path}/shared")
-      .with_owner(username)
-      .with_group(username)
-      .with_mode("0755")
   end
 
   it "creates all the shared folders" do
     directories = [
-      "#{shared_path}/backups",
-      "#{shared_path}/bundle",
       "#{shared_path}/config",
       "#{shared_path}/log",
       "#{shared_path}/tmp/sockets",
@@ -44,16 +36,6 @@ describe "stronglifters::capistrano" do
     ]
     directories.each do |directory|
       expect(subject).to create_directory(directory)
-        .with_owner(username)
-        .with_group(username)
-        .with_mode("0755")
-    end
-  end
-
-  it "lays down the .env template" do
-    expect(subject).to create_template("#{shared_path}/.env._default")
-      .with_owner(username)
-      .with_group(username)
-      .with_mode("0600")
+   end
   end
 end
spec/rbenv_spec.rb
@@ -1,18 +0,0 @@
-describe "stronglifters::rbenv" do
-  subject do
-    ChefSpec::SoloRunner.new do |node|
-    end.converge(described_recipe)
-  end
-
-  xit 'installs rbenv' do
-    expect(subject).to sync_git("/usr/local/rbenv")
-  end
-
-  xit 'creates the rbenv plugins directory' do
-    expect(subject).to create_directory('/usr/local/rbenv/plugins')
-  end
-
-  xit 'installs ruby-build' do
-    expect(subject).to sync_git("/usr/local/rbenv/plugins/ruby-build")
-  end
-end
spec/unicorn_spec.rb
@@ -1,37 +0,0 @@
-describe "stronglifters::unicorn" do
-  subject do
-    ChefSpec::SoloRunner.new do |node|
-      node.set['unicorn'] = configuration
-    end.converge(described_recipe)
-  end
-
-  let(:username) { FFaker::Internet.user_name }
-  let(:configuration) do
-    {
-      username: username,
-      current_path: '/tmp',
-    }
-  end
-
-  it 'creates the unicorn init.d script' do
-    expect(subject).to create_template("/etc/init.d/unicorn")
-      .with_source("unicorn.erb")
-      .with_owner(username)
-      .with_group(username)
-      .with_mode("0744")
-  end
-
-  context "when the app is deployed" do
-    before :each do
-      FileUtils.touch('/tmp/Gemfile')
-    end
-
-    after :each do
-      FileUtils.rm('/tmp/Gemfile')
-    end
-
-    it 'starts the unicorn service' do
-      expect(subject).to start_service("unicorn")
-    end
-  end
-end
templates/default/aws/config.erb → templates/aws/config.erb
File renamed without changes
templates/default/aws/credentials.erb → templates/aws/credentials.erb
File renamed without changes
templates/default/bashrc.erb
@@ -1,96 +0,0 @@
-if [ -d /usr/local/rbenv ]; then
-  export PATH="/usr/local/rbenv/bin:$PATH"
-  eval "$(rbenv init -)"
-fi
-
-# If not running interactively, don't do anything
-[ -z "$PS1" ] && return
-
-HISTCONTROL=ignoreboth
-shopt -s histappend
-HISTSIZE=1000
-HISTFILESIZE=2000
-shopt -s checkwinsize
-
-# make less more friendly for non-text input files, see lesspipe(1)
-[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
-
-# set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
-    debian_chroot=$(cat /etc/debian_chroot)
-fi
-
-# set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
-    xterm-color) color_prompt=yes;;
-esac
-
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
-#force_color_prompt=yes
-
-if [ -n "$force_color_prompt" ]; then
-    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
-	# We have color support; assume it's compliant with Ecma-48
-	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
-	# a case would tend to support setf rather than setaf.)
-	color_prompt=yes
-    else
-	color_prompt=
-    fi
-fi
-
-if [ "$color_prompt" = yes ]; then
-    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
-else
-    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
-fi
-unset color_prompt force_color_prompt
-
-# If this is an xterm set the title to user@host:dir
-case "$TERM" in
-xterm*|rxvt*)
-    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
-    ;;
-*)
-    ;;
-esac
-
-# enable color support of ls and also add handy aliases
-if [ -x /usr/bin/dircolors ]; then
-    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
-    alias ls='ls --color=auto'
-    #alias dir='dir --color=auto'
-    #alias vdir='vdir --color=auto'
-
-    alias grep='grep --color=auto'
-    alias fgrep='fgrep --color=auto'
-    alias egrep='egrep --color=auto'
-fi
-
-# some more ls aliases
-alias ll='ls -alF'
-alias la='ls -A'
-alias l='ls -CF'
-
-# Add an "alert" alias for long running commands.  Use like so:
-#   sleep 10; alert
-alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
-
-# Alias definitions.
-# You may want to put all your additions into a separate file like
-# ~/.bash_aliases, instead of adding them here directly.
-# See /usr/share/doc/bash-doc/examples in the bash-doc package.
-
-if [ -f ~/.bash_aliases ]; then
-    . ~/.bash_aliases
-fi
-
-# enable programmable completion features (you don't need to enable
-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
-# sources /etc/bash.bashrc).
-if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
-    . /etc/bash_completion
-fi
-set -o vi
templates/default/env.erb
@@ -1,3 +0,0 @@
-<% @env.each do |key, value| %>
-<%= key.to_s.upcase %>=<%= value %>
-<% end %>
templates/default/nginx_unix.erb
@@ -1,69 +0,0 @@
-upstream backend {
-  server unix:<%= @socket_file %> fail_timeout=0;
-}
-
-client_max_body_size 4G;
-
-server {
-  listen 80 deferred;
-  server_name <%= @domain %>;
-  rewrite        ^ https://$server_name$request_uri? permanent;
-}
-
-server {
-  listen 443 default_server ssl;
-  server_name  <%= @domain %>;
-  root         <%= @current_path %>/public;
-  ssl_certificate             /etc/nginx/ssl/<%= @domain %>.crt;
-  ssl_certificate_key         /etc/nginx/ssl/<%= @domain %>.key;
-
-  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
-  ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
-  ssl_prefer_server_ciphers on;
-  ssl_session_cache shared:SSL:10m;
-  #ssl_stapling on;
-  #ssl_stapling_verify on;
-  #resolver 8.8.8.8 8.8.4.4 valid=300s;
-  #resolver_timeout 5s;
-
-  error_log /var/log/nginx/<%= @domain %>.error.log;
-  access_log /var/log/nginx/<%= @domain %>.access.log;
-
-  # enable HTST
-  add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
-
-  # disable loading in an iframe
-  add_header X-Frame-Options "DENY";
-
-  if ($http_user_agent ~* (wget|easouspider|ahrefsbot|httrack|htmlparser|libwww) ) {
-    return 403;
-  }
-
-  # Deny access based on the Referer header.
-  if ($http_referer ~* (babes|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|webcam|zippo|casino|replica) ) {
-    return 444;
-  }
-
-  if ($host = '<%= @domain.gsub(/www/, '') %>' ) {
-    rewrite  ^/(.*)$  https://<%= @domain %>/$1  permanent;
-  }
-
-  try_files $uri/index.html $uri @application;
-  location ^~ /assets/ {
-    gzip_static on;
-    expires max;
-    add_header Cache-Control public;
-  }
-
-  location @application {
-    proxy_set_header X_FORWARDED_PROTO https;
-    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-    proxy_set_header HOST $http_host;
-    proxy_set_header X-Url-Scheme $scheme;
-    proxy_redirect off;
-    proxy_pass http://backend;
-  }
-
-  error_page 500 502 503 504 /500.html;
-  keepalive_timeout 10;
-}
templates/default/puma.conf.erb
@@ -1,1 +0,0 @@
-<%= @current_path %>,<%= @username %>,<%= @current_path %>/config/puma_production.rb,<%= @current_path %>/log/puma.log
templates/default/puma.erb
@@ -1,349 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides:          puma 
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Example initscript
-# Description:       This file should be used to construct scripts to be
-#                    placed in /etc/init.d.
-#                    https://github.com/puma/puma/tree/master/tools/jungle/init.d
-### END INIT INFO
-
-# Author: Darío Javier Cravero <dario@exordo.com>
-#
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/usr/local/bin:/usr/local/sbin/:/sbin:/usr/sbin:/bin:/usr/bin
-DESC="Puma rack web server"
-NAME=puma
-DAEMON=$NAME
-SCRIPTNAME=/etc/init.d/$NAME
-CONFIG=/etc/puma.conf
-JUNGLE=`cat $CONFIG`
-RUNPUMA=/usr/local/bin/run-puma
-PUMACTL=/usr/local/rbenv/shims/pumactl
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-#
-# Function that starts the jungle 
-#
-do_start() {
-  log_daemon_msg "=> Running the jungle..."
-  for i in $JUNGLE; do
-    dir=`echo $i | cut -d , -f 1`
-    user=`echo $i | cut -d , -f 2`
-    config_file=`echo $i | cut -d , -f 3`
-    if [ "$config_file" = "" ]; then
-      config_file="$dir/config/puma.rb"
-    fi
-    log_file=`echo $i | cut -d , -f 4`
-    if [ "$log_file" = "" ]; then
-      log_file="$dir/log/puma.log"
-    fi
-    environment=`echo $i | cut -d , -f 5`
-    do_start_one $dir $user $config_file $log_file $environment
-  done
-}
-
-do_start_one() {
-  PIDFILE=$1/tmp/pids/puma.pid
-  if [ -e $PIDFILE ]; then
-    PID=`cat $PIDFILE`
-    # If the puma isn't running, run it, otherwise restart it.
-    if [ "`ps -A -o pid= | grep -c $PID`" -eq 0 ]; then
-      do_start_one_do $1 $2 $3 $4 $5
-    else
-      do_restart_one $1
-    fi
-  else
-    do_start_one_do $1 $2 $3 $4 $5
-  fi
-}
-
-do_start_one_do() {
-  log_daemon_msg "--> Woke up puma $1"
-  log_daemon_msg "user $2"
-  log_daemon_msg "log to $4"
-
-  if [ ! -z "$5" ]; then
-    for e in $(echo "$5" | tr ';' '\n'); do
-        log_daemon_msg "environment $e"
-        v=${e%%\=*} ;  eval "$e" ; export $v
-    done
-  fi
-
-  start-stop-daemon --verbose --start --chdir $1 --chuid $2 --background --exec $RUNPUMA -- $1 $3 $4
-}
-
-#
-# Function that stops the jungle
-#
-do_stop() {
-  log_daemon_msg "=> Putting all the beasts to bed..."
-  for i in $JUNGLE; do
-    dir=`echo $i | cut -d , -f 1`
-    do_stop_one $dir
-  done
-}
-#
-# Function that stops the daemon/service
-#
-do_stop_one() {
-  log_daemon_msg "--> Stopping $1"
-  PIDFILE=$1/tmp/pids/puma.pid
-  STATEFILE=$1/tmp/pids/puma.state
-  if [ -e $PIDFILE ]; then
-    PID=`cat $PIDFILE`
-    if [ "`ps -A -o pid= | grep -c $PID`" -eq 0 ]; then
-      log_daemon_msg "---> Puma $1 isn't running."
-    else
-      log_daemon_msg "---> About to kill PID `cat $PIDFILE`"
-      $PUMACTL --state $STATEFILE stop
-      # Many daemons don't delete their pidfiles when they exit.
-      rm -f $PIDFILE $STATEFILE
-    fi
-  else
-    log_daemon_msg "---> No puma here..."
-  fi
-  return 0
-}
-
-#
-# Function that restarts the jungle 
-#
-do_restart() {
-  for i in $JUNGLE; do
-    dir=`echo $i | cut -d , -f 1`
-    do_restart_one $dir
-  done
-}
-
-#
-# Function that sends a SIGUSR2 to the daemon/service
-#
-do_restart_one() {
-  PIDFILE=$1/tmp/pids/puma.pid
-  i=`grep $1 $CONFIG`
-  dir=`echo $i | cut -d , -f 1`
-  
-  if [ -e $PIDFILE ]; then
-    log_daemon_msg "--> About to restart puma $1"
-    $PUMACTL --state $dir/tmp/pids/puma.state restart
-    # kill -s USR2 `cat $PIDFILE`
-    # TODO Check if process exist
-  else
-    log_daemon_msg "--> Your puma was never playing... Let's get it out there first" 
-    user=`echo $i | cut -d , -f 2`
-    config_file=`echo $i | cut -d , -f 3`
-    if [ "$config_file" = "" ]; then
-      config_file="$dir/config/puma.rb"
-    fi
-    log_file=`echo $i | cut -d , -f 4`
-    if [ "$log_file" = "" ]; then
-      log_file="$dir/log/puma.log"
-    fi
-    environment=`echo $i | cut -d , -f 5`
-    do_start_one $dir $user $config_file $log_file $environment
-  fi
-	return 0
-}
-
-#
-# Function that statuss the jungle 
-#
-do_status() {
-  for i in $JUNGLE; do
-    dir=`echo $i | cut -d , -f 1`
-    do_status_one $dir
-  done
-}
-
-#
-# Function that sends a SIGUSR2 to the daemon/service
-#
-do_status_one() {
-  PIDFILE=$1/tmp/pids/puma.pid
-  i=`grep $1 $CONFIG`
-  dir=`echo $i | cut -d , -f 1`
-  
-  if [ -e $PIDFILE ]; then
-    log_daemon_msg "--> About to status puma $1"
-    $PUMACTL --state $dir/tmp/pids/puma.state stats
-    # kill -s USR2 `cat $PIDFILE`
-    # TODO Check if process exist
-  else
-    log_daemon_msg "--> $1 isn't there :(..." 
-  fi
-	return 0
-}
-
-do_add() {
-  str=""
-  # App's directory
-  if [ -d "$1" ]; then
-    if [ "`grep -c "^$1" $CONFIG`" -eq 0 ]; then
-      str=$1
-    else
-      echo "The app is already being managed. Remove it if you want to update its config."
-      exit 1 
-    fi
-  else
-    echo "The directory $1 doesn't exist."
-    exit 1
-  fi
-  # User to run it as
-  if [ "`grep -c "^$2:" /etc/passwd`" -eq 0 ]; then
-    echo "The user $2 doesn't exist."
-    exit 1
-  else
-    str="$str,$2"
-  fi
-  # Config file
-  if [ "$3" != "" ]; then
-    if [ -e $3 ]; then
-      str="$str,$3"
-    else
-      echo "The config file $3 doesn't exist."
-      exit 1
-    fi
-  fi
-  # Log file
-  if [ "$4" != "" ]; then
-    str="$str,$4"
-  fi
-
-  # Environment variables
-  if [ "$5" != "" ]; then
-    str="$str,$5"
-  fi
-
-  # Add it to the jungle 
-  echo $str >> $CONFIG
-  log_daemon_msg "Added a Puma to the jungle: $str. You still have to start it though."
-}
-
-do_remove() {
-  if [ "`grep -c "^$1" $CONFIG`" -eq 0 ]; then
-    echo "There's no app $1 to remove."
-  else
-    # Stop it first.
-    do_stop_one $1
-    # Remove it from the config.
-    sed -i "\\:^$1:d" $CONFIG
-    log_daemon_msg "Removed a Puma from the jungle: $1."
-  fi
-}
-
-case "$1" in
-  start)
-    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-    if [ "$#" -eq 1 ]; then
-      do_start
-    else
-      i=`grep $2 $CONFIG`
-      dir=`echo $i | cut -d , -f 1`
-      user=`echo $i | cut -d , -f 2`
-      config_file=`echo $i | cut -d , -f 3`
-      if [ "$config_file" = "" ]; then
-        config_file="$dir/config/puma.rb"
-      fi
-      log_file=`echo $i | cut -d , -f 4`
-      if [ "$log_file" = "" ]; then
-        log_file="$dir/log/puma.log"
-      fi
-      do_start_one $dir $user $config_file $log_file
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  stop)
-    [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-    if [ "$#" -eq 1 ]; then
-      do_stop
-    else
-      i=`grep $2 $CONFIG`
-      dir=`echo $i | cut -d , -f 1`
-      do_stop_one $dir
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  status)
-    # TODO Implement.
-    log_daemon_msg "Status $DESC" "$NAME"
-    if [ "$#" -eq 1 ]; then
-      do_status
-    else
-      i=`grep $2 $CONFIG`
-      dir=`echo $i | cut -d , -f 1`
-      do_status_one $dir
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  restart)
-    log_daemon_msg "Restarting $DESC" "$NAME"
-    if [ "$#" -eq 1 ]; then
-      do_restart
-    else
-      i=`grep $2 $CONFIG`
-      dir=`echo $i | cut -d , -f 1`
-      do_restart_one $dir
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  add)
-    if [ "$#" -lt 3 ]; then
-      echo "Please, specifiy the app's directory and the user that will run it at least."
-      echo "  Usage: $SCRIPTNAME add /path/to/app user /path/to/app/config/puma.rb /path/to/app/config/log/puma.log"
-      echo "    config and log are optionals."
-      exit 1
-    else
-      do_add $2 $3 $4 $5
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  remove)
-    if [ "$#" -lt 2 ]; then
-      echo "Please, specifiy the app's directory to remove."
-      exit 1
-    else
-      do_remove $2
-    fi
-    case "$?" in
-      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-    esac
-  ;;
-  *)
-    echo "Usage:" >&2
-    echo "  Run the jungle: $SCRIPTNAME {start|stop|status|restart}" >&2
-    echo "  Add a Puma: $SCRIPTNAME add /path/to/app user /path/to/app/config/puma.rb /path/to/app/config/log/puma.log"
-    echo "    config and log are optionals."
-    echo "  Remove a Puma: $SCRIPTNAME remove /path/to/app"
-    echo "  On a Puma: $SCRIPTNAME {start|stop|status|restart} PUMA-NAME" >&2
-    exit 3
-  ;;
-esac
-:
templates/default/run-puma.erb
@@ -1,3 +0,0 @@
-#!/bin/bash
-app=$1; config=$2; log=$3;
-cd $app && exec /usr/local/rbenv/shims/bundle exec puma -C $config 2>&1 >> $log
templates/default/unicorn.erb
@@ -1,95 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          unicorn
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start unicorn at boot time
-# Description:       Run input app server
-### END INIT INFO
-set -e
-# Example init script, this can be used with nginx, too,
-# since nginx and unicorn accept the same signals
-
-# Feel free to change any of the following variables for your app:
-TIMEOUT=${TIMEOUT-60}
-APP_ROOT=<%= @current_path %>
-PID=$APP_ROOT/tmp/pids/unicorn.pid
-ENVIRONMENT=<%= @rails_env %>
-CMD="cd $APP_ROOT; bin/unicorn -E $ENVIRONMENT -D -c $APP_ROOT/config/unicorn.rb"
-action="$1"
-set -u
-
-old_pid="$PID.oldbin"
-
-cd $APP_ROOT || exit 1
-
-sig () {
-  test -s "$PID" && kill -$1 `cat $PID`
-}
-
-oldsig () {
-  test -s $old_pid && kill -$1 `cat $old_pid`
-}
-
-workersig () {
-  workerpid="$APP_ROOT/tmp/pids/unicorn.$2.pid"
-  test -s "$workerpid" && kill -$1 `cat $workerpid`
-}
-
-case $action in
-status )
-  sig 0 && echo >&2 "unicorn is running." && exit 0
-  echo >&2 "unicorn is not running." && exit 1 
-  ;;
-start)
-  sig 0 && echo >&2 "Already running" && exit 0
-  eval "$CMD"
-  ;;
-stop)
-  sig QUIT && exit 0
-  echo >&2 "Not running"
-  ;;
-force-stop)
-  sig TERM && exit 0
-  echo >&2 "Not running"
-  ;;
-restart|reload)
-  sig HUP && echo reloaded OK && exit 0
-  echo >&2 "Couldn't reload, starting '$CMD' instead"
-  eval "$CMD"
-  ;;
-upgrade)
-  if sig USR2 && sleep 20 && sig 0 && oldsig QUIT
-  then
-    n=$TIMEOUT
-    while test -s $old_pid && test $n -ge 0
-    do
-      printf '.' && sleep 1 && n=$(( $n - 1 ))
-    done
-    echo
-
-    if test $n -lt 0 && test -s $old_pid
-    then
-      echo >&2 "$old_pid still exists after $TIMEOUT seconds"
-      exit 1
-    fi
-    exit 0
-  fi
-  echo >&2 "Couldn't upgrade, starting '$CMD' instead"
-  eval "$CMD"
-  ;;
-kill_worker)
-  workersig QUIT $2 && exit 0
-  echo >&2 "Worker not running"
-  ;;
-
-reopen-logs)
-  sig USR1
-  ;;
-*)
-  echo >&2 "Usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>"
-  exit 1
-  ;;
-esac
templates/default/database.yml.erb → templates/database.yml.erb
File renamed without changes
templates/nginx.conf.erb
@@ -0,0 +1,89 @@
+user nginx;
+worker_processes auto;
+error_log /var/log/nginx/error.log;
+pid /var/run/nginx.pid;
+
+events {
+  worker_connections 1024;
+}
+
+http {
+  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                    '$status $body_bytes_sent "$http_referer" '
+                    '"$http_user_agent" "$http_x_forwarded_for"';
+
+  access_log  /var/log/nginx/access.log  main;
+
+  sendfile            on;
+  tcp_nopush          on;
+  tcp_nodelay         on;
+  keepalive_timeout   65;
+  types_hash_max_size 2048;
+
+  include             /etc/nginx/mime.types;
+  default_type        application/octet-stream;
+
+  client_max_body_size 4G;
+  <% @blacklisted_ips.each do |ip| %>
+  deny <%= ip %>;
+  <% end %>
+
+  upstream backend {
+    server 127.0.0.1:9292 fail_timeout=0;
+  }
+
+  server {
+    listen 80 deferred;
+    server_name <%= @domain %>;
+    rewrite        ^ https://$server_name$request_uri? permanent;
+  }
+  server {
+    listen 443 default_server ssl;
+    server_name  <%= @domain %>;
+    root         <%= node['stronglifters']['current_path'] %>/public;
+    ssl_certificate             /etc/nginx/ssl/<%= @domain %>.crt;
+    ssl_certificate_key         /etc/nginx/ssl/<%= @domain %>.key;
+
+    ssl_session_timeout 5m;
+    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+    ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
+    ssl_prefer_server_ciphers on;
+    ssl_session_cache shared:SSL:10m;
+    #ssl_stapling on;
+    #ssl_stapling_verify on;
+    #resolver 8.8.8.8 8.8.4.4 valid=300s;
+    #resolver_timeout 5s;
+
+    error_log /var/log/nginx/<%= @domain %>.error.log;
+    access_log /var/log/nginx/<%= @domain %>.access.log;
+
+    # enable HTST
+    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
+
+    # disable loading in an iframe
+    add_header X-Frame-Options "DENY";
+
+    if ($host = '<%= @domain.gsub(/www/, '') %>' ) {
+      rewrite  ^/(.*)$  https://<%= @domain %>/$1  permanent;
+    }
+
+    try_files $uri/index.html $uri @application;
+    location ^~ /assets/ {
+      gzip_static on;
+      expires max;
+      add_header Cache-Control public;
+    }
+
+    location @application {
+      proxy_set_header X_FORWARDED_PROTO https;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      proxy_set_header HOST $http_host;
+      proxy_set_header X-Url-Scheme $scheme;
+      proxy_redirect off;
+      proxy_pass http://backend;
+    }
+
+    error_page 500 502 503 504 /500.html;
+    keepalive_timeout 10;
+  }
+}
templates/default/nginx_logrotate.erb → templates/nginx_logrotate.erb
File renamed without changes
templates/default/rails_logrotate.erb → templates/rails_logrotate.erb
File renamed without changes
templates/default/ssl.crt.erb → templates/ssl.crt.erb
File renamed without changes
templates/default/ssl.key.erb → templates/ssl.key.erb
File renamed without changes
templates/sv-foreman-run.erb
@@ -0,0 +1,6 @@
+#!/bin/sh
+exec 2>&1
+source /etc/profile.d/rbenv.sh
+envdir=$(pwd)/env
+cd <%= node['stronglifters']['foreman']['current_path'] %>
+exec chpst -e $envdir /usr/local/rbenv/shims/foreman start
test/integration/default/serverspec/default_spec.rb
@@ -0,0 +1,13 @@
+require "serverspec"
+
+set :backend, :exec
+
+describe "default" do
+  it 'installs the default version of ruby' do
+    expect(command("/usr/local/rbenv/shims/ruby -v").stdout).to match(/2\.2\.3/)
+  end
+
+  it 'installs bundler' do
+    expect(file("/usr/local/rbenv/shims/bundle")).to be_file
+  end
+end
test/web/serverspec/default_spec.rb → test/integration/web/serverspec/default_spec.rb
@@ -8,4 +8,8 @@ describe "web" do
     expect(port(80)).to be_listening
     expect(port(443)).to be_listening
   end
+
+ it 'installs foreman' do
+    expect(file("/usr/local/rbenv/shims/foreman")).to be_file
+  end
 end
.kitchen.yml
@@ -13,45 +13,14 @@ suites:
   - name: default
     run_list:
       - recipe[stronglifters::default]
-      - recipe[stronglifters::capistrano]
-      - recipe[stronglifters::delayed_job]
-      - recipe[stronglifters::nginx]
-      - recipe[stronglifters::unicorn]
-      - recipe[stronglifters::nodejs]
-      - recipe[stronglifters::rbenv]
-      - recipe[stronglifters::postgres]
-    attributes:
-      postgres:
-        database: "mydb"
-        host: "localhost"
-        username: "rails"
-      postgresql:
-        password:
-          postgres: 'password'
-      rbenv:
-        ruby_version: '2.2.2'
   - name: web
     run_list:
       - recipe[stronglifters::default]
       - recipe[stronglifters::rails]
     attributes:
-      rbenv:
-        ruby_version: '2.2.2'
-      user:
-        username: 'rails'
-      aws:
-        username: 'rails'
-      capistrano:
-        root_path: '/var/www/app'
-        username: 'rails'
-        env:
-          app_api_key: 'api-key'
-          app_secret_key: 'secret-key'
-      nginx:
-        domain: 'www.example.com'
-      puma:
-        username: 'rails'
-        current_path: '/var/www/app/current'
+      env:
+        app_api_key: 'api-key'
+        app_secret_key: 'secret-key'
       postgres:
         database: "mydb"
         username: "rails"
Berksfile.lock
@@ -4,27 +4,8 @@ DEPENDENCIES
     metadata: true
 
 GRAPH
-  apt (2.9.2)
-  build-essential (2.2.4)
-  chef-sugar (3.1.1)
-  database (4.0.9)
-    postgresql (>= 1.0.0)
-  java (1.36.0)
-    apt (>= 0.0.0)
-  openssl (4.4.0)
-    chef-sugar (>= 3.1.1)
-  postgresql (3.4.21)
-    apt (>= 1.9.0)
-    build-essential (>= 0.0.0)
-    openssl (~> 4.0)
-  ruby_build (0.8.0)
-  ruby_rbenv (1.0.1)
-    java (> 1.4.0)
-    ruby_build (>= 0.0.0)
+  packagecloud (0.1.0)
+  runit (1.7.4)
+    packagecloud (>= 0.0.0)
   stronglifters (0.1.0)
-    apt (>= 0.0.0)
-    build-essential (>= 0.0.0)
-    database (>= 0.0.0)
-    postgresql (>= 0.0.0)
-    ruby_build (>= 0.0.0)
-    ruby_rbenv (>= 0.0.0)
+    runit (>= 0.0.0)
metadata.rb
@@ -4,11 +4,8 @@ maintainer_email 'mo@mokhan.ca'
 license          'All rights reserved'
 description      'Installs/Configures stronglifters'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          '0.1.0'
+version          '0.2.0'
 
-depends "apt"
-depends "build-essential"
-depends "database"
-depends "postgresql"
-depends "ruby_build"
-depends "ruby_rbenv"
+#depends "database"
+#depends "postgresql"
+depends "runit"