toquen 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/toquen/capistrano.rb +8 -4
- data/lib/toquen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e7f850c2fee7fddfffa545de77b361a2b26f5c1
|
4
|
+
data.tar.gz: 01e9291df348e40badcd3c5c933f45d6e92789a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c80fdfc46ea793ec4008a28e50718aa6b8a53f6d1be4dc724c1a90a8fd2938feae36454c4bac10a573b1aeea55a9e908d0e3f3fbc13c9afab2529822b4da0c
|
7
|
+
data.tar.gz: a8bb945cd54bb98e28f66cc3b258f5297636a847e16b10719161980d46f6549e4e9bf0b94ba4021073030e236041b187b09b9822569ed7fe238245b83ebcd57b
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ And then on the command line execute:
|
|
24
24
|
$ bundle
|
25
25
|
$ cap toquen_install
|
26
26
|
|
27
|
-
This will create a config directory with a file named *deploy.rb*. Edit this file, setting the location of your AWS key, AWS credentials, and chef cookbooks/data bags/roles.
|
27
|
+
This will create a config directory with a file named *deploy.rb*. Edit this file, setting the location of your AWS key, AWS credentials, and chef cookbooks/data bags/roles. If your servers are in a region (or regions) other than us-east-1, then you'll need to set the region as [described below](#additional-configuration).
|
28
28
|
|
29
29
|
Then, in AWS, create an [AWS instance tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) named "Roles" for each instance, using a space separated list of chef roles as the value. The "Name" tag must also be set or the instance will be ignored.
|
30
30
|
|
@@ -90,6 +90,12 @@ By default, instance information is only pulled out of the default region (us-ea
|
|
90
90
|
set :aws_regions, ['us-west-1', 'us-west-2']
|
91
91
|
```
|
92
92
|
|
93
|
+
You can also specify the location to upload the kitchen before running chef. By default, this is set to the ssh user's home directory.
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
set :chef_upload_location, "/tmp/toquen"
|
97
|
+
```
|
98
|
+
|
93
99
|
## View Instances
|
94
100
|
To see details about your aws instances you can use the **details** cap task.
|
95
101
|
|
data/lib/toquen/capistrano.rb
CHANGED
@@ -2,6 +2,8 @@ require 'capistrano/setup'
|
|
2
2
|
require 'capistrano/console'
|
3
3
|
require 'set'
|
4
4
|
|
5
|
+
set :chef_upload_location, -> { "/home/#{fetch(:ssh_options)[:user]}" }
|
6
|
+
|
5
7
|
desc "update local cache of servers and roles"
|
6
8
|
task :update_roles do
|
7
9
|
load Pathname.new fetch(:deploy_config_path, 'config/deploy.rb')
|
@@ -35,7 +37,7 @@ end
|
|
35
37
|
|
36
38
|
desc "Update cookbooks/data bags/roles on server"
|
37
39
|
task :update_kitchen do
|
38
|
-
kitchen = "
|
40
|
+
kitchen = "#{fetch(:chef_upload_location)}/kitchen"
|
39
41
|
lkitchen = "/tmp/toquen/kitchen"
|
40
42
|
user = fetch(:ssh_options)[:user]
|
41
43
|
key = fetch(:ssh_options)[:keys].first
|
@@ -62,7 +64,7 @@ task :update_kitchen do
|
|
62
64
|
on roles(:all), in: :parallel do |host|
|
63
65
|
run_locally do
|
64
66
|
info "Sending kitchen to #{host}..."
|
65
|
-
execute "rsync -avzk --delete -e 'ssh -i #{key}' #{lkitchen} #{user}@#{host}
|
67
|
+
execute "rsync -avzk --delete -e 'ssh -i #{key}' #{lkitchen} #{user}@#{host}:#{fetch(:chef_upload_location)}"
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
@@ -74,9 +76,11 @@ task :cook do
|
|
74
76
|
roles = host.properties.roles.reject { |r| r.to_s.start_with?('server-') or r == :all }
|
75
77
|
roles = roles.map { |r| "\"role[#{r}]\"" }.join(',')
|
76
78
|
info "Roles for #{host}: #{roles}"
|
77
|
-
tfile = "
|
79
|
+
tfile = "chef.json"
|
78
80
|
upload! StringIO.new("{ \"run_list\": [ #{roles} ] }"), tfile
|
79
|
-
|
81
|
+
within fetch(:chef_upload_location) do
|
82
|
+
execute "sudo chef-solo -c #{fetch(:chef_upload_location)}/kitchen/chef_config.rb -j #{tfile}"
|
83
|
+
end
|
80
84
|
end
|
81
85
|
end
|
82
86
|
before :cook, :update_kitchen
|
data/lib/toquen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toquen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Muller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|