gusteau 1.0.0.dev → 1.0.1.dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.travis.yml CHANGED
@@ -2,8 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 1.8.7
4
4
  - 1.9.3
5
- - rbx
6
- - jruby
7
5
  - 2.0.0
6
+ - rbx
8
7
  env:
9
8
  - COVERAGE=coveralls
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## 0.5.0
1
+ ## 1.0.1.dev / 2013-07-05
2
+ * Fix the project generator bug
3
+ * Make project generator output look nicer
4
+
5
+ ## 1.0.0.dev / 2013-07-04
6
+ * Use the unified `.gusteau.yml` configuration file for all nodes and environments
7
+ * Support more advanced configuration (multiple nodes per environment)
8
+ * Provide 100% test coverage
9
+ * Use omnibus installation if platform is unspecified
10
+ * Update the template to include a test-kitchen setup with serverspec tests
2
11
 
3
- * Use omibus installation if platform is unspecified
4
- * Use the unified `.gusteau.yml` configuration file for all nodes and environments
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Locomote Pty Ltd
1
+ Copyright (c) 2013 Locomote Pty Ltd and Authors.
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
4
 
data/README.md CHANGED
@@ -10,14 +10,20 @@ Gusteau
10
10
  Introduction
11
11
  ------------
12
12
 
13
- Gusteau is an easy to use configuration manager for Chef Solo and Vagrant. It provides an efficient interface to Chef Solo as well as some nice features:
13
+ Gusteau is an easy to use configuration manager for Chef Solo and Vagrant.
14
+ It aims to:
15
+
16
+ 1. Provide Chef Solo users with a more efficient workflow
17
+ 2. Encourage new users to try and to switch to Chef by avoiding the complexity of Chef Server.
14
18
 
15
- * Uses YAML for readable server configuration definitions
16
- * Uses a single SSH connection to stream compressed files and commands
17
- * Allows you to use normal Chef flags:
19
+ Some of the features include:
20
+
21
+ * YAML for readable infrastructure configuration
22
+ * Usage of a single SSH connection to stream compressed files and commands
23
+ * Support for normal Chef CLI flags:
18
24
  * `-W` or `--why-run` (dry run mode)
19
- * `-l` for setting a log level and `-F` for setting an output formatter
20
- * Is able to bootstrap CentOS, RHEL, Ubuntu and Gentoo systems with chef-solo.
25
+ * `-l` for setting a log level and `-F` for setting an output formatter
26
+ * Bootstrapping target systems with Chef-Omnibus or custom scripts.
21
27
 
22
28
  Gettings started
23
29
  ----------------
@@ -25,10 +31,18 @@ Gettings started
25
31
  Gusteau is a Ruby gem:
26
32
 
27
33
  ```
28
- gem install gusteau --pre
34
+ gem install gusteau
35
+ ```
36
+
37
+ The following command generates an example Chef-repo:
38
+
29
39
  ```
40
+ gusteau init project-name
41
+ ```
42
+
43
+ Make sure you read through `project-name/README.md` first.
30
44
 
31
- A typical Gusteau configuration looks like this:
45
+ A typical `.gusteau.yml` looks like this:
32
46
 
33
47
  ```
34
48
  environments:
@@ -52,26 +66,17 @@ environments:
52
66
  password: omgsecret
53
67
  ```
54
68
 
55
- Gusteau only needs a single node definition to run, but you'll need a few cookbooks to actually cook something :)
56
- The following command generates an example configuration to get you started:
57
-
58
- ```
59
- gusteau init project-name
60
- ```
61
-
62
- Next, `cd project-name` and see `.gusteau.yml`.
63
-
64
69
 
65
70
  Converging a server
66
71
  ----------
67
72
 
68
- The following command will run all roles and recipes from node's YAML file.
73
+ The following command will run the whole run_list on the node.
69
74
 
70
75
  ```
71
76
  gusteau converge development-playground
72
77
  ```
73
78
 
74
- Use the `--bootstrap` or `-b` flag to bootstrap chef-solo (for the first time run).
79
+ Use the `--bootstrap` or `-b` flag to bootstrap chef-solo (e.g. during the first run).
75
80
 
76
81
  Applying individual recipes
77
82
  -----------
@@ -99,18 +104,20 @@ gusteau ssh_config >> ~/.ssh/config
99
104
 
100
105
  Using with Vagrant
101
106
  ------------------
102
- Gusteau can save you from writing some Vagrantfile boilerplate code. It also enables you to move node-specific Vagrant configuration away from the Vagrantfile into node yml files.
107
+ Gusteau can save you from writing some Vagrantfile boilerplate code. It also enables you to move node-specific Vagrant configuration away from the Vagrantfile into node definitions.
103
108
 
104
109
  ```
105
110
  ...
106
- vagrant:
107
- IP: 192.168.100.20
108
- cpus: 1
109
- memory: 512
110
- box_url: 'https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box'
111
+ nodes:
112
+ www:
113
+ vagrant:
114
+ IP: 192.168.100.20
115
+ cpus: 1
116
+ memory: 512
117
+ box_url: 'https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box'
111
118
  ```
112
119
 
113
- The following bit will configure Vagrant for all Gusteau nodes which have `vagrant` section defined.
120
+ The following snippet configures Vagrant for all Gusteau nodes which have `vagrant` sections defined.
114
121
 
115
122
  ```
116
123
  Vagrant.configure('2') do |config|
@@ -124,7 +131,7 @@ end
124
131
 
125
132
  * The `prefix` option lets you prepend your VirtualBox VMs names, e.g. `loco-nodename`.
126
133
  * The `defaults` one lets you provide default values for `cpus`, `memory`, `box_url`.
127
- * If you'd like to use Vagrant's own automatic `chef_solo` provisioner, set `provision` to `true`.
134
+ * If you'd like to use Vagrant's own automatic `chef_solo` provisioner, set `provision` to `true`. *Not recommended* unless you really know what you are doing.
128
135
 
129
136
  Please note that the add-on only works with Vagrant ~> 1.2 and needs gusteau to be installed as a Vagrant plugin:
130
137
 
@@ -136,5 +143,5 @@ Notes
136
143
  -----
137
144
 
138
145
  * Feel free to contribute a [bootstrap script](https://github.com/locomote/gusteau/tree/master/bootstrap) for your platform.
139
- * Gusteau uploads `./cookbooks` and `./site-cookbooks` from the current working directory.
146
+
140
147
 
data/bin/gusteau CHANGED
@@ -20,7 +20,7 @@ class Gusteau::CLI < Optitron::CLI
20
20
 
21
21
  desc 'Apply a run_list'
22
22
  def apply(node_name, run_list)
23
- node(node_name).apply(params, run_list.split(","))
23
+ node(node_name).apply(run_list.split(","), params)
24
24
  end
25
25
 
26
26
  desc 'SSH into a node'
@@ -38,6 +38,11 @@ class Gusteau::CLI < Optitron::CLI
38
38
  Gusteau::Bureau.new(bureau_name).generate!
39
39
  end
40
40
 
41
+ desc 'Lists all known nodes'
42
+ def list
43
+ puts "Known nodes are:\n - #{nodes.keys.join("\n - ")}"
44
+ end
45
+
41
46
  private
42
47
 
43
48
  def node(node_name)
@@ -22,7 +22,7 @@ module Gusteau
22
22
  yaml_template '.gusteau.yml'
23
23
  text_template 'README.md'
24
24
  json_template "data_bags/users/#{@login}.json", "data_bags/users/user.json.erb"
25
- Dir.chdir(name) { system "bash ./init.sh ; rm ./init.sh" } if(init)
25
+ Dir.chdir(@name) { exec "bash ./init.sh #{@name} ; rm ./init.sh" } if(init)
26
26
  end
27
27
 
28
28
  private
data/lib/gusteau/node.rb CHANGED
@@ -17,7 +17,7 @@ module Gusteau
17
17
  server.chef.run opts, dna
18
18
  end
19
19
 
20
- def apply(opts = {}, run_list)
20
+ def apply(run_list, opts = {})
21
21
  server.chef.run opts, dna(run_list)
22
22
  end
23
23
 
@@ -1,3 +1,3 @@
1
1
  module Gusteau
2
- VERSION = "1.0.0.dev"
2
+ VERSION = "1.0.1.dev"
3
3
  end
@@ -44,7 +44,7 @@ describe Gusteau::Node do
44
44
  }
45
45
  }
46
46
  node.server.chef.expects(:run).with({}, dna)
47
- node.apply({}, [ "recipe[nagios]", "role[base]" ])
47
+ node.apply([ "recipe[nagios]", "role[base]" ], {})
48
48
  end
49
49
  end
50
50
 
@@ -67,4 +67,3 @@ To run the tests:
67
67
  bundle exec kitchen test
68
68
  ```
69
69
 
70
- *Happy cooking with Chef and Gusteau!*
data/template/init.sh CHANGED
@@ -1,13 +1,17 @@
1
- #!/bin/bash
1
+ #!/bin/bash -e
2
2
 
3
- echo "Installing gem dependencies"
3
+ info() { echo -e "\033[00;35m-----> $1\033[0m"; }
4
+ error() { echo -e "\033[00;31m$1\033[0m"; }
5
+ ok() { echo -e "\033[00;32m$1\033[0m"; }
6
+
7
+ info "Installing gem dependencies..."
4
8
  bundle
5
9
 
6
- echo "Downloading cookbooks"
10
+ info "Downloading cookbooks..."
7
11
  bundle exec berks install --path ./cookbooks
8
12
 
9
13
  if [ ! $(vagrant -v | cut -f3 -d ' ' | cut -f2 -d '.') = "2" ]; then
10
- echo "Sorry, 'gusteau init' only works with Vagrant 1.2.x"
14
+ error "Sorry, 'gusteau init' only works with Vagrant 1.2.x"
11
15
  exit 1
12
16
  fi
13
17
 
@@ -15,13 +19,20 @@ vagrant_boxes_dir="~/.vagrant.d/boxes"
15
19
  if [ -d "$vagrant_boxes_dir/opscode-ubuntu-13.04" ] &&
16
20
  [ ! -d "$vagrant_boxes_dir/example-box"]; then
17
21
 
18
- echo "Found the opscode-ubuntu-13.04 box, creating a copy"
22
+ info "Found the opscode-ubuntu-13.04 box, creating a copy"
19
23
  cp -R "$vagrant_boxes_dir/{opscode-ubuntu-13.04,example-box}"
20
24
  fi
21
25
 
22
- echo "Installing Vagrant plugins"
26
+ info "Installing Vagrant plugins..."
23
27
  vagrant plugin install vagrant-omnibus
24
28
  vagrant plugin install gusteau
25
29
 
26
- echo "Done!"
27
- echo "You can now run 'vagrant up' and then 'gusteau converge example-box'"
30
+ info "Done!\n"
31
+
32
+ ok "Happy cooking with\n"
33
+ ok " _/_ "
34
+ ok " _, , , ( / _ __, , ,"
35
+ ok "(_)_(_/_/_)_(__(/_(_/(_(_/_"
36
+ ok " /| "
37
+ ok "(/"
38
+ ok "\nYou can now 'cd $1/', 'vagrant up' and then 'gusteau converge example-box'"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gusteau
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.dev
4
+ version: 1.0.1.dev
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: