jzimmek-ec2 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ec2.gemspec +1 -1
- data/lib/ec2_init.rb +0 -54
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/ec2.gemspec
CHANGED
data/lib/ec2_init.rb
CHANGED
@@ -14,58 +14,4 @@ def ec2(name="default", &block)
|
|
14
14
|
ec2.freeze_attributes
|
15
15
|
ec2.validate
|
16
16
|
ec2
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
cloud = ec2 do
|
22
|
-
|
23
|
-
ssh_key_file "/Users/jzimmek/ec2-stuff/id-jzimmek-eu-west-1"
|
24
|
-
|
25
|
-
keypair "jzimmek"
|
26
|
-
region "eu-west-1"
|
27
|
-
security_group "default"
|
28
|
-
availability_zone "eu-west-1a"
|
29
|
-
|
30
|
-
group "app" do
|
31
|
-
|
32
|
-
ami "ami-0db89079"
|
33
|
-
|
34
|
-
instance "app01" do
|
35
|
-
end
|
36
|
-
|
37
|
-
instance "app02" do
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
#
|
44
|
-
# cloud.dump
|
45
|
-
#
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
mgr = Ec2::Manager.new(cloud)
|
50
|
-
|
51
|
-
mgr.sync do |binding|
|
52
|
-
|
53
|
-
if binding.valid?
|
54
|
-
|
55
|
-
binding.ensure_configured('host') do |ssh|
|
56
|
-
ssh.exec!("echo \"#{binding.hostname}\" > /etc/hostname")
|
57
|
-
ssh.exec!("echo \"#{binding.public_ip} #{binding.hostname}\" >> /etc/hosts")
|
58
|
-
ssh.exec!("hostname #{binding.hostname}")
|
59
|
-
end
|
60
|
-
|
61
|
-
binding.ensure_configured('nagios-config') do |ssh|
|
62
|
-
exec("janw.php #{binding.instance.hostname} ")
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
else
|
68
|
-
binding.terminate!
|
69
|
-
end
|
70
|
-
|
71
17
|
end
|