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 +1 -2
- data/CHANGELOG.md +10 -3
- data/LICENSE.md +1 -1
- data/README.md +35 -28
- data/bin/gusteau +6 -1
- data/lib/gusteau/bureau.rb +1 -1
- data/lib/gusteau/node.rb +1 -1
- data/lib/gusteau/version.rb +1 -1
- data/spec/lib/gusteau/node_spec.rb +1 -1
- data/template/README.md.erb +0 -1
- data/template/init.sh +19 -8
- metadata +1 -1
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
## 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
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.
|
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
|
-
|
16
|
-
|
17
|
-
*
|
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
|
20
|
-
*
|
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
|
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
|
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
|
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 (
|
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
|
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
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
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
|
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
|
-
|
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(
|
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)
|
data/lib/gusteau/bureau.rb
CHANGED
@@ -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) {
|
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
data/lib/gusteau/version.rb
CHANGED
data/template/README.md.erb
CHANGED
data/template/init.sh
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
-
#!/bin/bash
|
1
|
+
#!/bin/bash -e
|
2
2
|
|
3
|
-
echo "
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
26
|
+
info "Installing Vagrant plugins..."
|
23
27
|
vagrant plugin install vagrant-omnibus
|
24
28
|
vagrant plugin install gusteau
|
25
29
|
|
26
|
-
|
27
|
-
|
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'"
|