-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_test.rb
55 lines (53 loc) · 1.34 KB
/
example_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'mcollective'
include MCollective::RPC
mc = rpcclient("computenode")
mc.identity_filter "pg-kvm-005.mgmt.pg.net.local"
domain = "pg.net.local"
mc.verbose = true
specs = [
{
:networks => [
:mgmt,
:prod
],
:hostname => 'dev-tfundsproxy-001-grichards',
:group => 'dev-tfundsproxy',
:qualified_hostnames => {
:prod => "dev-tfundsproxy-001-grichards.#{domain}",
:mgmt => "dev-tfundsproxy-001-grichards.mgmt.#{domain}"
},
:cnames => {
:prod => {
"c" => "dev-tfundsproxy-001-grichards.#{domain}"
}
},
:ram => '2097152',
:domain => "#{domain}",
:fabric => 'production'
},
{
:networks => [
:mgmt,
:prod
],
:hostname => 'dev-tfundsproxy-002-grichards',
:group => 'dev-tfundsproxy',
:qualified_hostnames => {
:prod => "dev-tfundsproxy-002-grichards.#{domain}",
:mgmt => "dev-tfundsproxy-002-grichards.mgmt.#{domain}"
},
:cnames => {
:prod => {
"a" => "dev-tfundsproxy-001-grichards.#{domain}",
"b" => "dev-tfundsproxy-001-grichards.#{domain}"
}
},
:ram => '2097152',
:domain => "#{domain}",
:fabric => 'production'
}
]
printrpc mc.allocate_ips(:specs => specs)
printrpc mc.add_cnames(:specs => specs)
printrpc mc.remove_cnames(:specs => specs)
printrpc mc.free_ips(:specs => specs)