soloist 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock ADDED
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ soloist (0.0.2)
5
+ chef (= 0.9.12)
6
+ json (= 1.4.6)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ abstract (1.0.0)
12
+ bunny (0.6.0)
13
+ chef (0.9.12)
14
+ bunny (>= 0.6.0)
15
+ erubis
16
+ extlib
17
+ highline
18
+ json (>= 1.4.4, <= 1.4.6)
19
+ mixlib-authentication (>= 1.1.0)
20
+ mixlib-cli (>= 1.1.0)
21
+ mixlib-config (>= 1.1.2)
22
+ mixlib-log (>= 1.2.0)
23
+ moneta
24
+ ohai (>= 0.5.7)
25
+ rest-client (>= 1.0.4, < 1.7.0)
26
+ uuidtools
27
+ erubis (2.6.6)
28
+ abstract (>= 1.0.0)
29
+ extlib (0.9.15)
30
+ highline (1.6.1)
31
+ json (1.4.6)
32
+ mime-types (1.16)
33
+ mixlib-authentication (1.1.4)
34
+ mixlib-log
35
+ mixlib-cli (1.2.0)
36
+ mixlib-config (1.1.2)
37
+ mixlib-log (1.2.0)
38
+ moneta (0.6.0)
39
+ ohai (0.5.8)
40
+ extlib
41
+ json (>= 1.4.4, <= 1.4.6)
42
+ mixlib-cli
43
+ mixlib-config
44
+ mixlib-log
45
+ systemu
46
+ rest-client (1.6.1)
47
+ mime-types (>= 1.16)
48
+ systemu (1.2.0)
49
+ uuidtools (2.1.1)
50
+
51
+ PLATFORMS
52
+ ruby
53
+
54
+ DEPENDENCIES
55
+ chef (= 0.9.12)
56
+ json (= 1.4.6)
57
+ soloist!
data/README.markdown CHANGED
@@ -1,24 +1,67 @@
1
+ Soloist: Making chef-solo easier
2
+ ================================
3
+
4
+ # Why?
5
+ You just want to use chef solo, not worry about where your config files are, or what they should look like (too much). You might think that json is a data serialization format and not a config file format. You might think that having two config files that you have to pass to an executable every time you run it is two too many.
6
+
7
+ # How?
8
+ Soloist is a script packaged as a gem which when run recurses up the file tree looking for a soloistrc file. When it finds it, it uses it to determine 1) Where its cookbooks are and 2) What recipes to run. It generates the necessary config files for chef solo, and kicks it off.
9
+
10
+ # That's exactly what I've always wanted! How do I use it?
11
+ * (sudo) gem install soloist
12
+ * create a directory to store your cookbooks in, and get a cookbook:
13
+ sh -c 'mkdir -p chef/cookbooks/pivotal_workstation && cd chef/cookbooks/pivotal_workstation && curl -L http://github.com/mkocher/pivotal_workstation/tarball/master | gunzip | tar xvf - --strip=1'
14
+ * create your soloistrc file in the root of your project.
15
+
16
+ # What if I'm just setting up my own machine, and have many projects?
17
+ Just put your soloistrc file in your home directory, and point it to wherever you want to keep your cookbooks. Or just dedicate a git repo to it, and go into that directory before running soloist.
18
+
19
+ # How do I write a solistrc file?
20
+ It's a yaml file, currently with two lists to maintain:
21
+
22
+ The first, _Cookbook\_Paths_, should point (using an absolute or path relative to your soloistrc file) to the directory containing your cookbooks, such was pivotal_workstation.
23
+
24
+ The second, _Recipes_ should be a list of recipes you wish to run.
25
+
26
+ # Then What?
27
+ $> soloist
28
+
29
+
1
30
  Example soloistrc Files
2
31
  =======================
3
32
 
4
- My Laptop
33
+ directory layout:
34
+
35
+ /Users/mkocher/workspace/project/soloistrc <-Config File
36
+ /Users/mkocher/workspace/project/chef/
37
+ /Users/mkocher/workspace/project/chef/cookbooks/pivotal_workstation/
38
+
39
+
40
+ soloistrc
5
41
  ---------
6
- Cookbook_Paths:
7
- - /Users/pivotal/chef/
8
- Recipes:
9
- - pivotal_workstation::text_mate
10
- - pivotal_workstation::git
11
- - pivotal_workstation::git_config_global_defaults
12
- - pivotal_workstation::bash_profile-better_history
13
- - pivotal_workstation::bash_path_order
14
- - pivotal_workstation::bash_profile
15
- - pivotal_workstation::finder_display_full_path
16
- - pivotal_workstation::git_config_global_defaults
17
- - pivotal_workstation::inputrc
18
- - pivotal_workstation::osx_turn_on_locate
19
- - pivotal_workstation::textmate_set_defaults
20
- - pivotal_workstation::rvm
21
- - pivotal_workstation::mysql
22
- - pivotal_workstation::defaults_fast_key_repeat_rate
23
- - pivotal_workstation::ssh_copy_id
24
- - pivotal_workstation::ec2_api_tools
42
+ Cookbook_Paths:
43
+ - ./chef/cookbooks/
44
+ Recipes:
45
+ - pivotal_workstation::ack
46
+ - pivotal_workstation::bash_path_order
47
+ - pivotal_workstation::bash_profile
48
+ - pivotal_workstation::bash_profile-better_history
49
+ - pivotal_workstation::defaults_fast_key_repeat_rate
50
+ - pivotal_workstation::dock_preferences
51
+ - pivotal_workstation::ec2_api_tools
52
+ - pivotal_workstation::finder_display_full_path
53
+ - pivotal_workstation::git
54
+ - pivotal_workstation::git_config_global_defaults
55
+ - pivotal_workstation::git_scripts
56
+ - pivotal_workstation::google_chrome
57
+ - pivotal_workstation::inputrc
58
+ - pivotal_workstation::mysql
59
+ - pivotal_workstation::osx_turn_on_locate
60
+ - pivotal_workstation::rvm
61
+ - pivotal_workstation::safari_preferences
62
+ - pivotal_workstation::set_multitouch_preferences
63
+ - pivotal_workstation::text_mate
64
+ - pivotal_workstation::textmate_set_defaults
65
+ - pivotal_workstation::turn_on_ssh
66
+ - pivotal_workstation::user_owns_usr_local
67
+ - pivotal_workstation::workspace_directory
data/bin/soloist CHANGED
@@ -6,7 +6,7 @@ require 'yaml'
6
6
  require 'tempfile'
7
7
 
8
8
  def fileify(contents)
9
- file = Tempfile.new("sololist")
9
+ file = Tempfile.new("soloist")
10
10
  file << contents
11
11
  file.flush
12
12
  file
@@ -28,8 +28,8 @@ end
28
28
 
29
29
  log_level = ENV['LOG_LEVEL'] || "info"
30
30
 
31
- solistrc_contents, soloistrc_path = walk_up_and_find_file(["soloistrc"])
32
- soloistrc = YAML.load(solistrc_contents)
31
+ soloistrc_contents, soloistrc_path = walk_up_and_find_file(["soloistrc"])
32
+ soloistrc = YAML.load(soloistrc_contents)
33
33
 
34
34
  json_contents = {
35
35
  :recipes => soloistrc["Recipes"]
@@ -53,7 +53,12 @@ solo_rb_contents = "cookbook_path #{cookbook_paths.inspect}"
53
53
  solo_rb = fileify(solo_rb_contents)
54
54
  metadata_json = fileify(json_contents.to_json)
55
55
 
56
- command = "sudo bash -c 'RAILS_ENV=$RAILS_ENV chef-solo -j #{metadata_json.path} -c #{solo_rb.path} -l #{log_level}'"
56
+ env_vars = ["PATH=#{ENV['PATH']}"]
57
+ %w{BUNDLE_PATH GEM_HOME GEM_PATH RAILS_ENV}.each do |v|
58
+ env_vars << "#{v}=#{ENV[v]}" unless ENV[v].nil?
59
+ end
60
+
61
+ command = "sudo bash -c '#{env_vars.join(' ')} chef-solo -j #{metadata_json.path} -c #{solo_rb.path} -l #{log_level}'"
57
62
 
58
63
  puts "running chef: " + command
59
64
  system(command) || exit(1)
@@ -1,3 +1,3 @@
1
1
  module Soloist
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soloist
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew Kocher
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-16 00:00:00 -08:00
18
+ date: 2010-12-27 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -62,6 +62,7 @@ extra_rdoc_files: []
62
62
  files:
63
63
  - .gitignore
64
64
  - Gemfile
65
+ - Gemfile.lock
65
66
  - README.markdown
66
67
  - Rakefile
67
68
  - bin/soloist