from-scratch 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Berksfile.lock +11 -0
  4. data/chefignore +1 -0
  5. data/cookbooks/apt/CHANGELOG.md +248 -0
  6. data/cookbooks/apt/README.md +294 -0
  7. data/cookbooks/apt/attributes/default.rb +51 -0
  8. data/cookbooks/apt/files/default/15update-stamp +1 -0
  9. data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
  10. data/cookbooks/apt/libraries/helpers.rb +61 -0
  11. data/cookbooks/apt/libraries/matchers.rb +17 -0
  12. data/cookbooks/apt/libraries/network.rb +31 -0
  13. data/cookbooks/apt/metadata.json +1 -0
  14. data/cookbooks/apt/providers/preference.rb +84 -0
  15. data/cookbooks/apt/providers/repository.rb +246 -0
  16. data/cookbooks/apt/recipes/cacher-client.rb +83 -0
  17. data/cookbooks/apt/recipes/cacher-ng.rb +43 -0
  18. data/cookbooks/apt/recipes/default.rb +112 -0
  19. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  20. data/cookbooks/apt/resources/preference.rb +37 -0
  21. data/cookbooks/apt/resources/repository.rb +60 -0
  22. data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +173 -0
  23. data/cookbooks/apt/templates/default/01proxy.erb +9 -0
  24. data/cookbooks/apt/templates/default/10recommends.erb +3 -0
  25. data/cookbooks/apt/templates/default/20auto-upgrades.erb +2 -0
  26. data/cookbooks/apt/templates/default/50unattended-upgrades.erb +68 -0
  27. data/cookbooks/apt/templates/default/acng.conf.erb +275 -0
  28. data/cookbooks/apt/templates/default/unattended-upgrades.seed.erb +1 -0
  29. data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +269 -0
  30. data/cookbooks/build-essential/CHANGELOG.md +136 -0
  31. data/cookbooks/build-essential/README.md +108 -0
  32. data/cookbooks/build-essential/attributes/default.rb +20 -0
  33. data/cookbooks/build-essential/libraries/matchers.rb +5 -0
  34. data/cookbooks/build-essential/libraries/timing.rb +124 -0
  35. data/cookbooks/build-essential/libraries/xcode_command_line_tools.rb +210 -0
  36. data/cookbooks/build-essential/metadata.json +1 -0
  37. data/cookbooks/build-essential/recipes/_debian.rb +28 -0
  38. data/cookbooks/build-essential/recipes/_fedora.rb +32 -0
  39. data/cookbooks/build-essential/recipes/_freebsd.rb +24 -0
  40. data/cookbooks/build-essential/recipes/_mac_os_x.rb +22 -0
  41. data/cookbooks/build-essential/recipes/_omnios.rb +33 -0
  42. data/cookbooks/build-essential/recipes/_rhel.rb +36 -0
  43. data/cookbooks/build-essential/recipes/_smartos.rb +27 -0
  44. data/cookbooks/build-essential/recipes/_solaris2.rb +48 -0
  45. data/cookbooks/build-essential/recipes/_suse.rb +29 -0
  46. data/cookbooks/build-essential/recipes/default.rb +29 -0
  47. data/cookbooks/chef-sugar/CHANGELOG.md +159 -0
  48. data/cookbooks/chef-sugar/README.md +464 -0
  49. data/cookbooks/chef-sugar/metadata.json +1 -0
  50. data/cookbooks/chef-sugar/recipes/default.rb +34 -0
  51. data/cookbooks/openssl/CHANGELOG.md +30 -0
  52. data/cookbooks/openssl/README.md +115 -0
  53. data/cookbooks/openssl/attributes/default.rb +21 -0
  54. data/cookbooks/openssl/libraries/secure_password.rb +37 -0
  55. data/cookbooks/openssl/metadata.json +31 -0
  56. data/cookbooks/openssl/providers/x509.rb +94 -0
  57. data/cookbooks/openssl/recipes/default.rb +18 -0
  58. data/cookbooks/openssl/recipes/upgrade.rb +39 -0
  59. data/cookbooks/openssl/resources/x509.rb +16 -0
  60. data/cookbooks/postgresql/CHANGELOG.md +220 -0
  61. data/cookbooks/postgresql/README.md +464 -0
  62. data/cookbooks/postgresql/attributes/default.rb +549 -0
  63. data/cookbooks/postgresql/files/default/tests/minitest/apt_pgdg_postgresql_test.rb +39 -0
  64. data/cookbooks/postgresql/files/default/tests/minitest/default_test.rb +27 -0
  65. data/cookbooks/postgresql/files/default/tests/minitest/ruby_test.rb +28 -0
  66. data/cookbooks/postgresql/files/default/tests/minitest/server_test.rb +43 -0
  67. data/cookbooks/postgresql/files/default/tests/minitest/support/helpers.rb +29 -0
  68. data/cookbooks/postgresql/libraries/default.rb +377 -0
  69. data/cookbooks/postgresql/metadata.json +56 -0
  70. data/cookbooks/postgresql/recipes/apt_pgdg_postgresql.rb +18 -0
  71. data/cookbooks/postgresql/recipes/client.rb +32 -0
  72. data/cookbooks/postgresql/recipes/config_initdb.rb +148 -0
  73. data/cookbooks/postgresql/recipes/config_pgtune.rb +284 -0
  74. data/cookbooks/postgresql/recipes/contrib.rb +44 -0
  75. data/cookbooks/postgresql/recipes/default.rb +18 -0
  76. data/cookbooks/postgresql/recipes/ruby.rb +117 -0
  77. data/cookbooks/postgresql/recipes/server.rb +89 -0
  78. data/cookbooks/postgresql/recipes/server_conf.rb +34 -0
  79. data/cookbooks/postgresql/recipes/server_debian.rb +38 -0
  80. data/cookbooks/postgresql/recipes/server_redhat.rb +100 -0
  81. data/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb +45 -0
  82. data/cookbooks/postgresql/templates/default/pg_hba.conf.erb +35 -0
  83. data/cookbooks/postgresql/templates/default/pgsql.sysconfig.erb +4 -0
  84. data/cookbooks/postgresql/templates/default/postgresql.conf.erb +21 -0
  85. data/cookbooks/scratchify/.chef/knife.rb +2 -5
  86. data/cookbooks/scratchify/Berksfile +2 -1
  87. data/cookbooks/scratchify/Berksfile.lock +11 -0
  88. data/cookbooks/scratchify/README.md +34 -17
  89. data/cookbooks/scratchify/bin/scratchify +1 -1
  90. data/cookbooks/scratchify/chefignore +1 -0
  91. data/cookbooks/scratchify/from-scratch.gemspec +2 -5
  92. data/cookbooks/scratchify/lib/from-scratch.rb +25 -0
  93. data/cookbooks/scratchify/lib/{from/scratch → from-scratch}/version.rb +1 -1
  94. data/cookbooks/scratchify/metadata.json +2 -1
  95. data/cookbooks/scratchify/templates/node.json.erb +34 -0
  96. data/cookbooks/scratchify/templates/user.json.erb +6 -0
  97. data/lib/from-scratch.rb +2 -2
  98. data/lib/from-scratch/version.rb +1 -1
  99. data/templates/node.json.erb +6 -3
  100. metadata +85 -10
  101. data/cookbooks/scratchify/bin/console +0 -14
  102. data/cookbooks/scratchify/bin/setup +0 -7
  103. data/cookbooks/scratchify/data_bags/users/deploy.json +0 -6
  104. data/cookbooks/scratchify/environments/.gitkeep +0 -0
  105. data/cookbooks/scratchify/lib/from/scratch.rb +0 -31
  106. data/cookbooks/scratchify/lib/from/scratch/interviewer.rb +0 -35
  107. data/cookbooks/scratchify/nodes/normfood.ru.json +0 -75
  108. data/cookbooks/scratchify/roles/.gitkeep +0 -0
@@ -0,0 +1,45 @@
1
+ #
2
+ # Cookbook Name:: postgresql
3
+ # Recipe::yum_pgdg_postgresql
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ #######
19
+ # Load the pgdgrepo_rpm_info method from libraries/default.rb
20
+ ::Chef::Recipe.send(:include, Opscode::PostgresqlHelpers)
21
+
22
+ ######################################
23
+ # Install the "PostgreSQL RPM Building Project - Yum Repository" through
24
+ # the repo_rpm_url determined with pgdgrepo_rpm_info method from
25
+ # libraries/default.rb. The /etc/yum.repos.d/pgdg-*.repo
26
+ # will provide postgresql9X packages, but you may need to exclude
27
+ # postgresql packages from the repository of the distro in order to use
28
+ # PGDG repository properly. Conflicts will arise if postgresql9X does
29
+ # appear in your distro's repo and you want a more recent patch level.
30
+
31
+ repo_rpm_url, repo_rpm_filename, repo_rpm_package = pgdgrepo_rpm_info
32
+
33
+ # Download the PGDG repository RPM as a local file
34
+ remote_file "#{Chef::Config[:file_cache_path]}/#{repo_rpm_filename}" do
35
+ source repo_rpm_url
36
+ mode "0644"
37
+ end
38
+
39
+ # Install the PGDG repository RPM from the local file
40
+ # E.g., /etc/yum.repos.d/pgdg-91-centos.repo
41
+ package repo_rpm_package do
42
+ provider Chef::Provider::Package::Rpm
43
+ source "#{Chef::Config[:file_cache_path]}/#{repo_rpm_filename}"
44
+ action :install
45
+ end
@@ -0,0 +1,35 @@
1
+ # This file was automatically generated and dropped off by Chef!
2
+
3
+ # PostgreSQL Client Authentication Configuration File
4
+ # ===================================================
5
+ #
6
+ # Refer to the "Client Authentication" section in the PostgreSQL
7
+ # documentation for a complete description of this file.
8
+
9
+ <% if node['postgresql']['version'].to_f < 9.1 -%>
10
+ # TYPE DATABASE USER CIDR-ADDRESS METHOD
11
+ <% elsif node['postgresql']['version'].to_f >= 9.1 -%>
12
+ # TYPE DATABASE USER ADDRESS METHOD
13
+ <% end -%>
14
+
15
+ ###########
16
+ # Other authentication configurations taken from chef node defaults:
17
+ ###########
18
+ <% node['postgresql']['pg_hba'].each do |auth| -%>
19
+
20
+ <% if auth[:comment] %>
21
+ <%= auth[:comment] %>
22
+ <% end %>
23
+ <% if auth[:addr] %>
24
+ <%= auth[:type].ljust(7) %> <%= auth[:db].ljust(15) %> <%= auth[:user].ljust(15) %> <%= auth[:addr].ljust(23) %> <%= auth[:method] %>
25
+ <% else %>
26
+ <%= auth[:type].ljust(7) %> <%= auth[:db].ljust(15) %> <%= auth[:user].ljust(15) %> <%= auth[:method] %>
27
+ <% end %>
28
+ <% end %>
29
+
30
+ # "local" is for Unix domain socket connections only
31
+ <% if node['postgresql']['version'].to_f < 9.1 -%>
32
+ local all all ident
33
+ <% elsif node['postgresql']['version'].to_f >= 9.1 -%>
34
+ local all all peer
35
+ <% end -%>
@@ -0,0 +1,4 @@
1
+ PGDATA=<%= node['postgresql']['dir'] %>
2
+ <% if node['postgresql']['config'].attribute?("port") -%>
3
+ PGPORT=<%= node['postgresql']['config']['port'] %>
4
+ <% end -%>
@@ -0,0 +1,21 @@
1
+ # PostgreSQL configuration file
2
+ # This file was automatically generated and dropped off by chef!
3
+ # Please refer to the PostgreSQL documentation for details on
4
+ # configuration settings.
5
+
6
+ <% node['postgresql']['config'].sort.each do |key, value| %>
7
+ <% next if value.nil? -%>
8
+ <% next if node['postgresql']['version'].to_f < 9.2 && /ssl_.*._file/.match(key) -%>
9
+ <%= key %> = <%=
10
+ case value
11
+ when String
12
+ "'#{value}'"
13
+ when TrueClass
14
+ 'on'
15
+ when FalseClass
16
+ 'off'
17
+ else
18
+ value
19
+ end
20
+ %>
21
+ <% end %>
@@ -1,9 +1,6 @@
1
1
  cookbook_path "cookbooks"
2
- node_path "nodes"
3
- role_path "roles"
4
- environment_path "environments"
5
- data_bag_path "data_bags"
6
- #encrypted_data_bag_secret "data_bag_key"
2
+ node_path "tmp/nodes"
3
+ data_bag_path "tmp/data_bags"
7
4
 
8
5
  knife[:berkshelf_path] = "cookbooks"
9
6
  Chef::Config[:ssl_verify_mode] = :verify_peer if defined? ::Chef
@@ -7,7 +7,8 @@ metadata
7
7
 
8
8
  cookbook 'user'
9
9
  cookbook 'rvm', github: 'fnichol/chef-rvm'
10
- # cookbook 'apt'
10
+ cookbook 'postgresql'
11
+
11
12
  # cookbook 'dpkg_packages', git: "https://gitlab.acid.cl/acidlabs/chef-dpkg-packages.git"
12
13
  # cookbook 'nginx', git: "https://gitlab.acid.cl/acidlabs/chef-nginx.git"
13
14
  # cookbook 'postgresql', git: "https://github.com/phlipper/chef-postgresql.git"
@@ -1,4 +1,5 @@
1
1
  DEPENDENCIES
2
+ postgresql
2
3
  rvm
3
4
  git: git://github.com/fnichol/chef-rvm.git
4
5
  revision: 08ec265f277e112a5a2e4b201bd32ddfe1bb968c
@@ -8,12 +9,22 @@ DEPENDENCIES
8
9
  user
9
10
 
10
11
  GRAPH
12
+ apt (2.9.2)
13
+ build-essential (2.2.4)
14
+ chef-sugar (3.1.1)
11
15
  chef_gem (0.1.0)
12
16
  java (1.35.0)
17
+ openssl (4.0.0)
18
+ chef-sugar (>= 0.0.0)
19
+ postgresql (3.4.20)
20
+ apt (>= 1.9.0)
21
+ build-essential (>= 0.0.0)
22
+ openssl (~> 4.0.0)
13
23
  rvm (0.10.1)
14
24
  chef_gem (>= 0.0.0)
15
25
  java (>= 0.0.0)
16
26
  scratchify (0.1.0)
27
+ postgresql (>= 0.0.0)
17
28
  rvm (>= 0.0.0)
18
29
  user (>= 0.0.0)
19
30
  user (0.4.2)
@@ -1,39 +1,56 @@
1
1
  # FromScratch
2
2
 
3
- I'm sick and tired of thousands of articles "How to setup Rails app". Here is your last command to do that.
3
+ I'm sick and tired of thousands of articles "How to setup Rails app server". Here is your last command to do that.
4
4
 
5
- ## Installation
5
+ No configs, no questions. Just ~~one ring to rule them all~~ one command to get fully functional server with best security practices ready for first `cap production deploy`.
6
6
 
7
- Gemfile:
7
+ ## Usage
8
+
9
+ $ gem install from-scratch
10
+ $ scratchify your_app_name your.host.com
11
+
12
+ And everything is done. Then add following to your `config/deploy.rb` or `config/deploy/production.rb` for Capistrano:
8
13
 
9
14
  ```ruby
10
- gem 'from-scratch', group: :development
15
+ server 'your.host.com', user: 'deploy', roles: %w(app db web)
16
+ set :deploy_to, "/home/deploy/your_app_name"
11
17
  ```
12
18
 
13
- Then
19
+ ## Supports
14
20
 
15
- $ bundle
21
+ OS:
16
22
 
17
- ## Usage
23
+ - APT-based Linux (Ubuntu, Debian)
24
+ - YUM-based Linux (RedHat, CentOS)
18
25
 
19
- $ bundle exec scratchify
26
+ ## It's a kind of magic!
20
27
 
21
- ## Supports
28
+ Not actully. Just preconfigured [Chef](https://www.chef.io/). Here are the things done with the command:
22
29
 
23
- ![Ubuntu](http://design.ubuntu.com/wp-content/uploads/ubuntu-logo32.png)
24
- ![RVM](https://rvm.io/images/logo.png)
25
- ![MySQL](https://www.mysql.com/common/logos/logo-mysql-170x115.png)
30
+ - Install system-wide RVM with latest MRI (2.2.3)
31
+ - Install PostgreSQL, create database with user, pg_tune a little
32
+ - Add _deploy_ non-admin user to system specially for your app, upload your SSH pub key to it
33
+ - Install nginx and replace it's default site config with one prepared for rails app
34
+ - Generate app folder inside _deploy_'s home and generate `database.yml` and `secrets.yml`
26
35
 
27
- ## Development
36
+ ## Things you need to know
28
37
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+ Nginx config is set up to connect to unix socket placed at `/home/deploy/your_app_name/shared/tmp/sockets/application.sock`. Change it manually or config your favorite app server (Puma, Unicorn, Thin etc) to place it's socket there.
30
39
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+ You can just `ssh deploy@your.host.com` because your SSH pub key is already there.
32
41
 
33
- ## Contributing
42
+ Both `postgres` and `your_app_name` DB users get (different) randomly generated passwords. You can see app-user password inside `config/database.yml`, but `postgres` password is not saved anywhere. If you need admin access to your PostgreSQL, then you should SSH as root and:
43
+
44
+ # su - postgres
45
+ $ psql
46
+
47
+ ## Development
48
+
49
+ TODO
34
50
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/from-scratch.
51
+ ## Contributing
36
52
 
53
+ TODO
37
54
 
38
55
  ## License
39
56
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "from/scratch"
4
+ require "from-scratch"
5
5
 
6
6
  FromScratch.run!
@@ -94,6 +94,7 @@ Vagrantfile
94
94
  .travis.yml
95
95
 
96
96
  # Gem files #
97
+ #############
97
98
  Gemfile
98
99
  Gemfile.lock
99
100
  Rakefile
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'from/scratch/version'
4
+ require 'from-scratch/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "from-scratch"
@@ -20,12 +20,9 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.10"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "rspec"
23
+ spec.add_development_dependency 'rspec', "~> 3.3.0"
24
24
  spec.add_development_dependency 'pry'
25
25
 
26
- spec.add_dependency 'sshkit', '>= 1.7.1'
27
- spec.add_dependency 'colorize'
28
- spec.add_dependency 'activesupport', '>= 3.2.1'
29
26
  spec.add_dependency 'knife-solo'
30
27
  spec.add_dependency 'knife-solo_data_bag'
31
28
  spec.add_dependency 'chef'
@@ -0,0 +1,25 @@
1
+ require 'securerandom'
2
+ require 'erb'
3
+ require 'fileutils'
4
+
5
+ module FromScratch
6
+ def self.run!
7
+ app_name, host = ARGV
8
+ ssh_pub_key = `cat ~/.ssh/id_rsa.pub`.strip
9
+ postgresql_admin_password = `echo -n '#{SecureRandom.hex(64)}''postgres' | openssl md5 | sed -e 's/.* /md5/'`.strip
10
+
11
+ { node: ['nodes', host], user: ['data_bags/users', 'deploy'] }.each do |from, to|
12
+ FileUtils.mkdir_p File.expand_path("../../tmp/#{to[0]}", __FILE__)
13
+ File.open(File.expand_path("../../tmp/#{to.join('/')}.json", __FILE__), 'w') do |f|
14
+ f.write ERB.new(File.open(File.expand_path("../../templates/#{from}.json.erb", __FILE__)).read).result(binding)
15
+ end
16
+ end
17
+
18
+ Dir.chdir(File.expand_path('../..', __FILE__)) do
19
+ system "knife solo bootstrap root@#{host}"
20
+ system "knife solo clean root@#{host}"
21
+ end
22
+
23
+ FileUtils.rm_rf [File.expand_path('../../tmp', __FILE__)]
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module FromScratch
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "user": ">= 0.0.0",
14
- "rvm": ">= 0.0.0"
14
+ "rvm": ">= 0.0.0",
15
+ "postgresql": ">= 0.0.0"
15
16
  },
16
17
  "recommendations": {
17
18
  },
@@ -0,0 +1,34 @@
1
+ {
2
+ "run_list": [
3
+ "recipe[rvm::system]",
4
+ "recipe[postgresql::server]",
5
+ "recipe[postgresql::config_pgtune]",
6
+ "recipe[user::data_bag]",
7
+ "recipe[scratchify]"
8
+ ],
9
+
10
+ "users": ["deploy"],
11
+
12
+ "rvm": {
13
+ "default_ruby": "2.2.3",
14
+ "rubies": ["2.2.3"],
15
+ "install_rubies": true,
16
+ "gpg": {}
17
+ },
18
+
19
+ "postgresql": {
20
+ "version": "9.4",
21
+ "enable_pgdg_yum": true,
22
+ "enable_pgdg_apt": true,
23
+ "password": {
24
+ "postgres": "<%= postgresql_admin_password %>"
25
+ },
26
+ "config_pgtune": {
27
+ "db_type": "web"
28
+ }
29
+ },
30
+
31
+ "automatic": {
32
+ "ipaddress": "<%= host %>"
33
+ }
34
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "id": "deploy",
3
+ "name": "deploy",
4
+ "groups": ["deploy"],
5
+ "ssh_keys": ["<%= ssh_pub_key %>"]
6
+ }
@@ -6,7 +6,7 @@ module FromScratch
6
6
  def self.run!
7
7
  app_name, host = ARGV
8
8
  ssh_pub_key = `cat ~/.ssh/id_rsa.pub`.strip
9
- postgresql_admin_password = `echo -n '#{SecureRandom.hex(64)}''postgres' | openssl md5 | sed -e 's/.* /md5/'`
9
+ postgresql_admin_password = `echo -n '#{SecureRandom.hex(64)}''postgres' | openssl md5 | sed -e 's/.* /md5/'`.strip
10
10
 
11
11
  { node: ['nodes', host], user: ['data_bags/users', 'deploy'] }.each do |from, to|
12
12
  FileUtils.mkdir_p File.expand_path("../../tmp/#{to[0]}", __FILE__)
@@ -15,7 +15,7 @@ module FromScratch
15
15
  end
16
16
  end
17
17
 
18
- Dir.chdir(File.expand_path('..', __FILE__)) do
18
+ Dir.chdir(File.expand_path('../..', __FILE__)) do
19
19
  system "knife solo bootstrap root@#{host}"
20
20
  system "knife solo clean root@#{host}"
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module FromScratch
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "run_list": [
3
3
  "recipe[rvm::system]",
4
- "recipe[posgresql::server]",
5
- "recipe[posgresql::config_pgtune]",
4
+ "recipe[postgresql::server]",
5
+ "recipe[postgresql::config_pgtune]",
6
6
  "recipe[user::data_bag]",
7
7
  "recipe[scratchify]"
8
8
  ],
@@ -10,7 +10,10 @@
10
10
  "users": ["deploy"],
11
11
 
12
12
  "rvm": {
13
- "default_ruby": "2.2.3"
13
+ "default_ruby": "2.2.3",
14
+ "rubies": ["2.2.3"],
15
+ "install_rubies": true,
16
+ "gpg": {}
14
17
  },
15
18
 
16
19
  "postgresql": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: from-scratch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Shaydurov
@@ -143,6 +143,52 @@ files:
143
143
  - Thorfile
144
144
  - bin/scratchify
145
145
  - chefignore
146
+ - cookbooks/apt/CHANGELOG.md
147
+ - cookbooks/apt/README.md
148
+ - cookbooks/apt/attributes/default.rb
149
+ - cookbooks/apt/files/default/15update-stamp
150
+ - cookbooks/apt/files/default/apt-proxy-v2.conf
151
+ - cookbooks/apt/libraries/helpers.rb
152
+ - cookbooks/apt/libraries/matchers.rb
153
+ - cookbooks/apt/libraries/network.rb
154
+ - cookbooks/apt/metadata.json
155
+ - cookbooks/apt/providers/preference.rb
156
+ - cookbooks/apt/providers/repository.rb
157
+ - cookbooks/apt/recipes/cacher-client.rb
158
+ - cookbooks/apt/recipes/cacher-ng.rb
159
+ - cookbooks/apt/recipes/default.rb
160
+ - cookbooks/apt/recipes/unattended-upgrades.rb
161
+ - cookbooks/apt/resources/preference.rb
162
+ - cookbooks/apt/resources/repository.rb
163
+ - cookbooks/apt/templates/debian-6.0/acng.conf.erb
164
+ - cookbooks/apt/templates/default/01proxy.erb
165
+ - cookbooks/apt/templates/default/10recommends.erb
166
+ - cookbooks/apt/templates/default/20auto-upgrades.erb
167
+ - cookbooks/apt/templates/default/50unattended-upgrades.erb
168
+ - cookbooks/apt/templates/default/acng.conf.erb
169
+ - cookbooks/apt/templates/default/unattended-upgrades.seed.erb
170
+ - cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb
171
+ - cookbooks/build-essential/CHANGELOG.md
172
+ - cookbooks/build-essential/README.md
173
+ - cookbooks/build-essential/attributes/default.rb
174
+ - cookbooks/build-essential/libraries/matchers.rb
175
+ - cookbooks/build-essential/libraries/timing.rb
176
+ - cookbooks/build-essential/libraries/xcode_command_line_tools.rb
177
+ - cookbooks/build-essential/metadata.json
178
+ - cookbooks/build-essential/recipes/_debian.rb
179
+ - cookbooks/build-essential/recipes/_fedora.rb
180
+ - cookbooks/build-essential/recipes/_freebsd.rb
181
+ - cookbooks/build-essential/recipes/_mac_os_x.rb
182
+ - cookbooks/build-essential/recipes/_omnios.rb
183
+ - cookbooks/build-essential/recipes/_rhel.rb
184
+ - cookbooks/build-essential/recipes/_smartos.rb
185
+ - cookbooks/build-essential/recipes/_solaris2.rb
186
+ - cookbooks/build-essential/recipes/_suse.rb
187
+ - cookbooks/build-essential/recipes/default.rb
188
+ - cookbooks/chef-sugar/CHANGELOG.md
189
+ - cookbooks/chef-sugar/README.md
190
+ - cookbooks/chef-sugar/metadata.json
191
+ - cookbooks/chef-sugar/recipes/default.rb
146
192
  - cookbooks/chef_gem/CHANGELOG.md
147
193
  - cookbooks/chef_gem/README.md
148
194
  - cookbooks/chef_gem/libraries/chef_gem.rb
@@ -185,6 +231,40 @@ files:
185
231
  - cookbooks/java/resources/ark.rb
186
232
  - cookbooks/java/templates/default/ibm_jdk.installer.properties.erb
187
233
  - cookbooks/java/templates/default/oracle.jinfo.erb
234
+ - cookbooks/openssl/CHANGELOG.md
235
+ - cookbooks/openssl/README.md
236
+ - cookbooks/openssl/attributes/default.rb
237
+ - cookbooks/openssl/libraries/secure_password.rb
238
+ - cookbooks/openssl/metadata.json
239
+ - cookbooks/openssl/providers/x509.rb
240
+ - cookbooks/openssl/recipes/default.rb
241
+ - cookbooks/openssl/recipes/upgrade.rb
242
+ - cookbooks/openssl/resources/x509.rb
243
+ - cookbooks/postgresql/CHANGELOG.md
244
+ - cookbooks/postgresql/README.md
245
+ - cookbooks/postgresql/attributes/default.rb
246
+ - cookbooks/postgresql/files/default/tests/minitest/apt_pgdg_postgresql_test.rb
247
+ - cookbooks/postgresql/files/default/tests/minitest/default_test.rb
248
+ - cookbooks/postgresql/files/default/tests/minitest/ruby_test.rb
249
+ - cookbooks/postgresql/files/default/tests/minitest/server_test.rb
250
+ - cookbooks/postgresql/files/default/tests/minitest/support/helpers.rb
251
+ - cookbooks/postgresql/libraries/default.rb
252
+ - cookbooks/postgresql/metadata.json
253
+ - cookbooks/postgresql/recipes/apt_pgdg_postgresql.rb
254
+ - cookbooks/postgresql/recipes/client.rb
255
+ - cookbooks/postgresql/recipes/config_initdb.rb
256
+ - cookbooks/postgresql/recipes/config_pgtune.rb
257
+ - cookbooks/postgresql/recipes/contrib.rb
258
+ - cookbooks/postgresql/recipes/default.rb
259
+ - cookbooks/postgresql/recipes/ruby.rb
260
+ - cookbooks/postgresql/recipes/server.rb
261
+ - cookbooks/postgresql/recipes/server_conf.rb
262
+ - cookbooks/postgresql/recipes/server_debian.rb
263
+ - cookbooks/postgresql/recipes/server_redhat.rb
264
+ - cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb
265
+ - cookbooks/postgresql/templates/default/pg_hba.conf.erb
266
+ - cookbooks/postgresql/templates/default/pgsql.sysconfig.erb
267
+ - cookbooks/postgresql/templates/default/postgresql.conf.erb
188
268
  - cookbooks/rvm/.foodcritic
189
269
  - cookbooks/rvm/.gitignore
190
270
  - cookbooks/rvm/.kitchen.yml
@@ -263,22 +343,17 @@ files:
263
343
  - cookbooks/scratchify/LICENSE.txt
264
344
  - cookbooks/scratchify/README.md
265
345
  - cookbooks/scratchify/Thorfile
266
- - cookbooks/scratchify/bin/console
267
346
  - cookbooks/scratchify/bin/scratchify
268
- - cookbooks/scratchify/bin/setup
269
347
  - cookbooks/scratchify/chefignore
270
- - cookbooks/scratchify/data_bags/users/deploy.json
271
- - cookbooks/scratchify/environments/.gitkeep
272
348
  - cookbooks/scratchify/from-scratch.gemspec
273
- - cookbooks/scratchify/lib/from/scratch.rb
274
- - cookbooks/scratchify/lib/from/scratch/interviewer.rb
275
- - cookbooks/scratchify/lib/from/scratch/version.rb
349
+ - cookbooks/scratchify/lib/from-scratch.rb
350
+ - cookbooks/scratchify/lib/from-scratch/version.rb
276
351
  - cookbooks/scratchify/metadata.json
277
- - cookbooks/scratchify/nodes/normfood.ru.json
278
352
  - cookbooks/scratchify/recipes/default.rb
279
- - cookbooks/scratchify/roles/.gitkeep
280
353
  - cookbooks/scratchify/spec/from/scratch_spec.rb
281
354
  - cookbooks/scratchify/spec/spec_helper.rb
355
+ - cookbooks/scratchify/templates/node.json.erb
356
+ - cookbooks/scratchify/templates/user.json.erb
282
357
  - cookbooks/user/.gitignore
283
358
  - cookbooks/user/.kitchen.yml
284
359
  - cookbooks/user/.travis.yml