nuri 0.5.1

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.
Files changed (169) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +6 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG +146 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +28 -0
  7. data/README.md +64 -0
  8. data/Rakefile +15 -0
  9. data/VERSION +1 -0
  10. data/bin/delete_modules +11 -0
  11. data/bin/install_agent +18 -0
  12. data/bin/install_module +65 -0
  13. data/bin/nuri +519 -0
  14. data/bin/nuri.old +183 -0
  15. data/bin/push_model +16 -0
  16. data/examples/.gitignore +3 -0
  17. data/examples/bonfire.sfp +95 -0
  18. data/examples/bonfire/epcc.sfp +43 -0
  19. data/examples/bonfire/epcc0.sfp +49 -0
  20. data/examples/bonfire/epcc2.sfp +52 -0
  21. data/examples/bonfire/epcc2a.sfp +25 -0
  22. data/examples/bonfire/inria.sfp +72 -0
  23. data/examples/bonfire/inria0.sfp +49 -0
  24. data/examples/bonfire/inria2.sfp +71 -0
  25. data/examples/bonfire/inria2a.sfp +44 -0
  26. data/examples/bonfire/inria2b.sfp +54 -0
  27. data/examples/bonfire/inria2c.sfp +62 -0
  28. data/examples/bonfire/inria2d.sfp +71 -0
  29. data/examples/bonfire/inria2e.sfp +80 -0
  30. data/examples/bonfire/main.sfp +33 -0
  31. data/examples/bonfire/old/bonfire-1-1-1.sfp +76 -0
  32. data/examples/bonfire/old/bonfire-1-10-1.sfp +77 -0
  33. data/examples/bonfire/old/bonfire-1-2-1.sfp +58 -0
  34. data/examples/bonfire/old/bonfire-1-3-1.sfp +61 -0
  35. data/examples/bonfire/old/bonfire-1-4-1.sfp +64 -0
  36. data/examples/bonfire/old/bonfire-1-5-1.sfp +67 -0
  37. data/examples/bonfire/old/bonfire-1-6-1.sfp +82 -0
  38. data/examples/bonfire/old/bonfire-1-7-1.sfp +82 -0
  39. data/examples/bonfire/old/bonfire-1-8-1.sfp +79 -0
  40. data/examples/bonfire/old/bonfire-1-9-1.sfp +83 -0
  41. data/examples/bonfire/old/wp-test1a.sfp +38 -0
  42. data/examples/bonfire/old/wp-test1b.sfp +18 -0
  43. data/examples/bonfire/old/wp-test1c.sfp +7 -0
  44. data/examples/bonfire/old/wp-test2.sfp +47 -0
  45. data/examples/bonfire/old3/bonfire-epcc.sfp +57 -0
  46. data/examples/bonfire/old3/bonfire-inria.sfp +72 -0
  47. data/examples/bonfire/old3/bonfire-master.sfp +18 -0
  48. data/examples/bonfire/old3/bonfire.sfp +23 -0
  49. data/examples/bonfire/old3/bonfire2.sfp +49 -0
  50. data/examples/bonfire/old3/bonfire3.sfp +76 -0
  51. data/examples/bonfire/old3/bonfire4.sfp +78 -0
  52. data/examples/bonfire/old3/bonfire5.sfp +34 -0
  53. data/examples/bonfire/old3/bonfire5b.sfp +84 -0
  54. data/examples/bonfire/old3/hpvm6.sfp +22 -0
  55. data/examples/bonfire/old3/model.json +1 -0
  56. data/examples/bonfire/old3/test0.sfp +16 -0
  57. data/examples/bonfire/old3/test1.sfp +5 -0
  58. data/examples/bonfire/old3/test10.sfp +5 -0
  59. data/examples/bonfire/old3/test2.sfp +18 -0
  60. data/examples/bonfire/old3/test3.sfp +10 -0
  61. data/examples/bonfire/old3/test4.sfp +11 -0
  62. data/examples/bonfire/old3/test5.sfp +18 -0
  63. data/examples/bonfire/old3/test6.sfp +19 -0
  64. data/examples/bonfire/old3/test7.sfp +34 -0
  65. data/examples/bonfire/old3/test8.sfp +5 -0
  66. data/examples/bonfire/old3/test9.sfp +16 -0
  67. data/examples/bonfire/old3/wordpress-test-cluster.sfp +38 -0
  68. data/examples/bonfire/old3/wordpress-test.sfp +22 -0
  69. data/examples/bonfire/old3/wp-test-2.sfp +49 -0
  70. data/examples/bonfire/test.sfp +13 -0
  71. data/examples/generator.rb +66 -0
  72. data/examples/hadoop2.sfp +20 -0
  73. data/examples/hpcloud.sfp +18 -0
  74. data/examples/run.rb +17 -0
  75. data/examples/test.inc +0 -0
  76. data/examples/test.sfp +11 -0
  77. data/lib/naas/d3.js +5 -0
  78. data/lib/naas/d3.v3.min.js +5 -0
  79. data/lib/naas/index.css +0 -0
  80. data/lib/naas/index.html +18 -0
  81. data/lib/naas/index.js +18 -0
  82. data/lib/naas/jquery-1.10.2.min.js +6 -0
  83. data/lib/naas/jquery.js +6 -0
  84. data/lib/naas/naas.rb +160 -0
  85. data/lib/nuri.rb +62 -0
  86. data/lib/nuri/choreographer.rb +151 -0
  87. data/lib/nuri/constraint_helper.rb +9 -0
  88. data/lib/nuri/directory.rb +40 -0
  89. data/lib/nuri/master.rb +725 -0
  90. data/lib/nuri/net_helper.rb +65 -0
  91. data/lib/nuri/orchestrator.rb +224 -0
  92. data/lib/nuri/server.rb +212 -0
  93. data/modules/.gitignore +4 -0
  94. data/modules/apache/apache.rb +255 -0
  95. data/modules/apache/apache.rb.old +167 -0
  96. data/modules/apache/apache.sfp +146 -0
  97. data/modules/apache/apache.sfp.future +100 -0
  98. data/modules/apache/load_balancer +20 -0
  99. data/modules/apache/model.json +1 -0
  100. data/modules/apache/test.sfp +8 -0
  101. data/modules/aptpackage/aptpackage.rb +82 -0
  102. data/modules/aptpackage/aptpackage.sfp +5 -0
  103. data/modules/bonfire/.gitignore +2 -0
  104. data/modules/bonfire/README.md +12 -0
  105. data/modules/bonfire/bonfire.rb +60 -0
  106. data/modules/bonfire/bonfire.sfp +9 -0
  107. data/modules/bonfire/config.yml +4 -0
  108. data/modules/bonfire/helper.rb +149 -0
  109. data/modules/bonfire/stresstest.rb +144 -0
  110. data/modules/bonfire/test.sfp +8 -0
  111. data/modules/client/client.rb +22 -0
  112. data/modules/client/client.sfp +14 -0
  113. data/modules/cloud/cloud.rb +11 -0
  114. data/modules/cloud/cloud.sfp +26 -0
  115. data/modules/file/file.rb +91 -0
  116. data/modules/file/file.sfp +9 -0
  117. data/modules/hadoop1/core-site.xml +17 -0
  118. data/modules/hadoop1/hadoop-env.sh +55 -0
  119. data/modules/hadoop1/hadoop1.rb +384 -0
  120. data/modules/hadoop1/hadoop1.sfp +93 -0
  121. data/modules/hadoop1/hdfs-site.xml +16 -0
  122. data/modules/hadoop1/mapred-site.xml +17 -0
  123. data/modules/hadoop2/core-site.xml +31 -0
  124. data/modules/hadoop2/hadoop-env.sh +77 -0
  125. data/modules/hadoop2/hadoop2.rb +401 -0
  126. data/modules/hadoop2/hadoop2.sfp +114 -0
  127. data/modules/hadoop2/hdfs-site.xml +47 -0
  128. data/modules/hadoop2/mapred-site.xml +71 -0
  129. data/modules/hadoop2/ports +14 -0
  130. data/modules/hadoop2/yarn-env.sh +112 -0
  131. data/modules/hadoop2/yarn-site.xml +107 -0
  132. data/modules/hpcloud/.gitignore +2 -0
  133. data/modules/hpcloud/README.md +16 -0
  134. data/modules/hpcloud/config.yml +3 -0
  135. data/modules/hpcloud/example.sfp +18 -0
  136. data/modules/hpcloud/hpcloud.rb +241 -0
  137. data/modules/hpcloud/hpcloud.sfp +22 -0
  138. data/modules/hpcloud/test.sfp +5 -0
  139. data/modules/install_module +65 -0
  140. data/modules/machine/machine.rb +95 -0
  141. data/modules/machine/machine.sfp +9 -0
  142. data/modules/mockcloud/mockcloud.rb +20 -0
  143. data/modules/mockcloud/mockcloud.sfp +6 -0
  144. data/modules/mysql/mysql.rb +118 -0
  145. data/modules/mysql/mysql.sfp +38 -0
  146. data/modules/mysql/test.sfp +3 -0
  147. data/modules/node/node.rb +8 -0
  148. data/modules/node/node.sfp +7 -0
  149. data/modules/object/object.rb +7 -0
  150. data/modules/object/object.sfp +1 -0
  151. data/modules/os/os.rb +38 -0
  152. data/modules/os/os.sfp +11 -0
  153. data/modules/package/package.rb +26 -0
  154. data/modules/package/package.sfp +22 -0
  155. data/modules/package/test.sfp +6 -0
  156. data/modules/service/model.json +1 -0
  157. data/modules/service/service.rb +50 -0
  158. data/modules/service/service.sfp +46 -0
  159. data/modules/service/test.sfp +6 -0
  160. data/modules/tarpackage/tarpackage.rb +93 -0
  161. data/modules/tarpackage/tarpackage.sfp +5 -0
  162. data/modules/vm/vm.rb +8 -0
  163. data/modules/vm/vm.sfp +18 -0
  164. data/modules/wordpress/wordpress.rb +98 -0
  165. data/modules/wordpress/wordpress.sfp +34 -0
  166. data/modules/wordpresscluster/wordpresscluster.rb +150 -0
  167. data/modules/wordpresscluster/wordpresscluster.sfp +74 -0
  168. data/nuri.gemspec +26 -0
  169. metadata +281 -0
data/bin/nuri.old ADDED
@@ -0,0 +1,183 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ dir = File.expand_path(File.dirname(__FILE__)) + '/../lib'
4
+ require "#{dir}/nuri"
5
+
6
+ require 'coderay'
7
+ require 'logger'
8
+
9
+ version = File.read(File.dirname(__FILE__) + '/../VERSION').sub(/\n/, '')
10
+
11
+ opts = Trollop::options do
12
+ version "Nuri #{version} (c) 2013"
13
+ banner <<-EOS
14
+ Usage: nuri [options]
15
+ where [options] are:
16
+ EOS
17
+
18
+ opt :model_file, "Model of configuration file.", :default => '', :short => '-m'
19
+ opt :state, "Print the current state of the system in JSON based on given model file.", :short => '-s'
20
+ opt :plan, "Print the plan that could bring the system to the desired state as defined in model file.", :short => '-p'
21
+ opt :parallel, "Generate a parallel plan.", :short => '-l'
22
+ opt :bsig_deploy, "Generate and deploy Behavioural Signature model", :short => '-b'
23
+ opt :bsig_purge, "Purge Behavioural Signature model", :short => '-g'
24
+ opt :execute, "Execute a plan in given file. Note: model file should be specified.", :default => '', :short => '-x'
25
+ opt :apply, "Generate and execute a plan that could bring the system to the desired state.", :short => '-a'
26
+ opt :push_modules, "Automatically push an unavailable module to target agent.", :short => '-u'
27
+ opt :human, "Use human readable format.", :short => '-h'
28
+ opt :pretty, "Use pretty JSON format.", :short => '-r'
29
+ opt :silent, "Set off interactive mode.", :defaut => true, :short => '-n'
30
+ #opt :start, "Start master daemon.", :short => '-s'
31
+ #opt :stop, "Stop master daemon.", :short => '-t'
32
+ end
33
+
34
+ puts opts.inspect
35
+ def plan_to_human(plan)
36
+ return 'No solution plan.'.red if plan['workflow'].nil?
37
+ return 'The system is at the goal state.'.green if plan['workflow'].length <= 0
38
+
39
+ p = ''
40
+ actions = plan['workflow']
41
+ if plan['type'] == 'sequential'
42
+ p = 'Sequential Plan:'.yellow
43
+ actions.each_index { |i| p += "\n#{i+1}. #{actions[i]['name']} #{JSON.generate(actions[i]['parameters'])}" }
44
+ else
45
+ p = 'Partial-Order Plan:'.yellow
46
+ actions.each { |op| p += "\n#{op['id']+1}. #{op['name']} #{JSON.generate(op['parameters'])} (#{op['predecessors'].map{|i|i+1}}, #{op['successors'].map{|i|i+1}})" }
47
+ end
48
+ p
49
+ end
50
+
51
+ def verify_model(opts)
52
+ if opts[:model_file].length <= 0
53
+ puts "Model file is not specified! Use \"-h\" option for more details.".red
54
+ exit(false)
55
+ end
56
+ end
57
+
58
+ if opts[:state]
59
+ verify_model(opts)
60
+
61
+ master = Nuri::Master.new
62
+ master.set_model(opts)
63
+ state = master.get_state(opts)
64
+ state.accept(Sfp::Visitor::PrettyStateGenerator.new)
65
+ if opts[:human]
66
+ puts CodeRay.encode(JSON.pretty_generate(state), :json, :terminal)
67
+ else
68
+ puts (opts[:pretty] ? JSON.pretty_generate(state) : JSON.generate(state))
69
+ end
70
+
71
+ elsif opts[:plan]
72
+ verify_model(opts)
73
+
74
+ master = Nuri::Master.new
75
+ master.set_model(opts)
76
+ plan = master.get_plan(opts)
77
+ if !plan.is_a?(Hash) or plan['workflow'].nil?
78
+ puts "Plan: ".yellow + "\nno solution!".red
79
+ else
80
+ if opts[:human]
81
+ puts plan_to_human(plan)
82
+ else
83
+ puts (opts[:pretty] ? JSON.pretty_generate(plan) : JSON.generate(plan))
84
+ end
85
+
86
+ if not opts[:silent] and plan['workflow'].is_a?(Array) and plan['workflow'].length > 0
87
+ print "Execute the plan [y/N]? "
88
+ if STDIN.gets.chomp.upcase == 'Y'
89
+ puts 'Executing the plan:'.yellow
90
+ opts[:plan] = plan
91
+ puts (master.execute_plan(opts) ? "Execution success!".green : "Execution failed!".red)
92
+ end
93
+ end
94
+ end
95
+
96
+ elsif opts[:execute].length > 0
97
+ verify_model(opts)
98
+
99
+ master = Nuri::Master.new
100
+ master.set_model(opts)
101
+ puts (master.execute_plan(opts) ? "Execution success!".green : "Execution failed!".red)
102
+
103
+ elsif opts[:apply]
104
+ verify_model(opts)
105
+
106
+ master = Nuri::Master.new
107
+ master.set_model(opts)
108
+ plan = master.get_plan(opts)
109
+ if not plan.is_a?(Hash)
110
+ puts "No solution!".red
111
+ else
112
+ if opts[:human]
113
+ puts plan_to_human(plan)
114
+ else
115
+ puts (opts[:pretty] ? JSON.pretty_generate(plan) : JSON.generate(plan))
116
+ end
117
+
118
+ if plan['workflow'].is_a?(Array) and plan['workflow'].length > 0
119
+ puts 'Executing the plan...'.yellow
120
+ opts[:plan] = plan
121
+ puts (master.execute_plan(opts) ? "Execution success!".green : "Execution failed!".red)
122
+ end
123
+ end
124
+
125
+ elsif opts[:bsig_deploy]
126
+ verify_model(opts)
127
+ opts[:parallel] = true
128
+
129
+ master = Nuri::Master.new
130
+ master.set_model(opts)
131
+ bsig = master.get_bsig(opts)
132
+
133
+ if not bsig.is_a?(Hash)
134
+ puts "\nNo solution!".red
135
+ elsif bsig.length > 0
136
+ empty_local_bsig = bsig.select { |name,local_bsig| local_bsig['operators'].length <= 0 }
137
+
138
+ if empty_local_bsig.length == bsig.length
139
+ puts "The goal state has been achieved!".green
140
+
141
+ else
142
+ # print the BSig model
143
+ if opts[:human]
144
+ puts CodeRay.encode(JSON.pretty_generate(bsig), :json, :terminal)
145
+ else
146
+ puts (opts[:pretty] ? JSON.pretty_generate(bsig) : JSON.generate(bsig))
147
+ end
148
+
149
+ if not opts[:silent]
150
+ print "Deploy the BSig model [y/N]? "
151
+ if STDIN.gets.chomp.upcase == 'Y'
152
+ puts 'Deploying the BSig model:'.yellow
153
+ opts[:bsig] = bsig
154
+ puts (master.deploy_bsig(opts) ? "Deployment success!".green : "Deployment failed!".red)
155
+ end
156
+ end
157
+
158
+ end
159
+ end
160
+
161
+ elsif opts[:bsig_purge]
162
+ verify_model(opts)
163
+
164
+ puts "Purging Behavioural Signature model...".yellow
165
+ master = Nuri::Master.new
166
+ master.set_model(opts)
167
+ if master.purge_bsig(opts)
168
+ puts "Purging Behavioural Signature model [OK]".green
169
+ else
170
+ puts "Purging Behavioural Signature model [Failed]".red
171
+ end
172
+
173
+ =begin
174
+ elsif opts[:start]
175
+ puts "Not implemented yet!".red
176
+
177
+ elsif opts[:stop]
178
+ puts "Not implemented yet!".red
179
+ =end
180
+
181
+ else
182
+ Trollop::help
183
+ end
data/bin/push_model ADDED
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ if [[ "$1" == "" ]] || [[ "$2" == "" ]]; then
4
+ echo "Usage: $ push_model <address> <model-file>"
5
+ exit 0
6
+ fi
7
+
8
+ MODEL_FILE="/tmp/model.json"
9
+
10
+ sfp $2 > $MODEL_FILE
11
+
12
+ curl -i -X PUT $1:1314/model -F model=@"$MODEL_FILE"
13
+
14
+ if [[ -f "$MODEL_FILE" ]]; then
15
+ rm -f $MODEL_FILE
16
+ fi
@@ -0,0 +1,3 @@
1
+ *cell*
2
+ *.log
3
+ *.log.*
@@ -0,0 +1,95 @@
1
+ include "../modules/node/node.sfp"
2
+ include "../modules/vm/vm.sfp"
3
+ include "../modules/apache/apache.sfp"
4
+ include "../modules/mysql/mysql.sfp"
5
+ include "../modules/wordpresscluster/wordpresscluster.sfp"
6
+ include "../modules/bonfire/bonfire.sfp"
7
+
8
+ proxy isa Node {
9
+ sfpAddress is "localhost"
10
+ epcc isa Bonfire {
11
+ experiment is "autocloud"
12
+ location is "uk-epcc"
13
+ image_name is "BonFIRE Debian Squeeze 10G v5"
14
+ wan_name is "BonFIRE WAN"
15
+ }
16
+ }
17
+
18
+ vmlb isa VM {
19
+ created = true
20
+ apache isa Apache {
21
+ running is true
22
+ is_load_balancer is true
23
+ lb_members is (vmapp1,vmapp2,vmapp3,vmapp4,vmapp5)
24
+ }
25
+ in_cloud is proxy.epcc
26
+ }
27
+ vmapp1 extends vmlb {
28
+ wp_web isa WordpressWeb {
29
+ installed is true
30
+ http is vmapp1.apache
31
+ database is vmdb.wp_db
32
+ }
33
+ }
34
+ vmapp2 extends vmlb {
35
+ wp_web isa WordpressWeb {
36
+ installed is true
37
+ http is vmapp2.apache
38
+ database is vmdb.wp_db
39
+ }
40
+ }
41
+ vmapp3 extends vmlb {
42
+ wp_web isa WordpressWeb {
43
+ installed is true
44
+ http is vmapp3.apache
45
+ database is vmdb.wp_db
46
+ }
47
+ }
48
+ vmapp4 extends vmlb {
49
+ wp_web isa WordpressWeb {
50
+ installed is true
51
+ http is vmapp4.apache
52
+ database is vmdb.wp_db
53
+ }
54
+ }
55
+ vmapp5 extends vmlb {
56
+ wp_web isa WordpressWeb {
57
+ installed is true
58
+ http is vmapp5.apache
59
+ database is vmdb.wp_db
60
+ }
61
+ }
62
+ vmdb isa VM {
63
+ created = true
64
+ mysql isa Mysql {
65
+ running is true
66
+ }
67
+ wp_db isa WordpressDB {
68
+ installed is true
69
+ mysql is vmdb.mysql
70
+ }
71
+ in_cloud is proxy.epcc
72
+ }
73
+
74
+ global {
75
+ if vmlb.apache.running = true then {
76
+ vmapp1.apache.running = true
77
+ vmapp2.apache.running = true
78
+ vmapp3.apache.running = true
79
+ vmapp4.apache.running = true
80
+ vmapp5.apache.running = true
81
+ }
82
+ if vmapp1.apache.running = true then vmdb.mysql.running = true
83
+ if vmapp2.apache.running = true then vmdb.mysql.running = true
84
+ if vmapp3.apache.running = true then vmdb.mysql.running = true
85
+ if vmapp4.apache.running = true then vmdb.mysql.running = true
86
+ if vmapp5.apache.running = true then vmdb.mysql.running = true
87
+ }
88
+
89
+ /*
90
+ vmlb isa VM {
91
+ created is false
92
+ }
93
+ vmapp1 extends vmlb
94
+ vmdb extends vmlb
95
+ */
@@ -0,0 +1,43 @@
1
+ include "../modules/vm/vm.sfp"
2
+ include "../modules/apache/apache.sfp"
3
+ include "../modules/mysql/mysql.sfp"
4
+ include "../modules/wordpresscluster/wordpresscluster.sfp"
5
+
6
+ vm1 isa VM {
7
+ created = true
8
+ apache isa Apache {
9
+ running is true
10
+ is_load_balancer is true
11
+ }
12
+ in_cloud is proxy.epcc
13
+ }
14
+ vm2 isa VM {
15
+ created = true
16
+ apache isa Apache {
17
+ running is true
18
+ }
19
+ wp_web isa WordpressWeb {
20
+ installed is true
21
+ http is vm2.apache
22
+ database is vm10.wp_db
23
+ }
24
+ in_cloud is proxy.epcc
25
+ }
26
+ vm10 isa VM {
27
+ created = true
28
+ mysql isa Mysql {
29
+ running is true
30
+ }
31
+ wp_db isa WordpressDB {
32
+ installed is true
33
+ mysql is vm10.mysql
34
+ }
35
+ in_cloud is proxy.epcc
36
+ }
37
+
38
+ global {
39
+ if vm1.apache.running = true then {
40
+ vm2.apache.running = true
41
+ }
42
+ if vm2.apache.running = true then vm10.mysql.running = true
43
+ }
@@ -0,0 +1,49 @@
1
+ include "../modules/vm/vm.sfp"
2
+ include "../modules/apache/apache.sfp"
3
+ include "../modules/mysql/mysql.sfp"
4
+ include "../modules/wordpresscluster/wordpresscluster.sfp"
5
+
6
+ vm1 isa VM {
7
+ created = false
8
+ }
9
+ vm2 isa VM {
10
+ created = false
11
+ }
12
+ /*vm3 extends vm2
13
+ vm4 extends vm2
14
+ vm5 extends vm2
15
+ vm6 extends vm2
16
+ vm7 extends vm2
17
+ vm8 extends vm2
18
+ vm9 extends vm2
19
+ vm11 extends vm2
20
+ vm12 extends vm2*/
21
+ vm10 isa VM {
22
+ created = false
23
+ }
24
+
25
+ global {
26
+ if vm1.apache.running = true then {
27
+ vm2.apache.running = true
28
+ /*vm3.apache.running = true
29
+ vm4.apache.running = true
30
+ vm5.apache.running = true
31
+ vm6.apache.running = true
32
+ vm7.apache.running = true
33
+ vm8.apache.running = true
34
+ vm9.apache.running = true
35
+ vm11.apache.running = true
36
+ vm12.apache.running = true*/
37
+ }
38
+
39
+ if vm2.apache.running = true then vm10.mysql.running = true
40
+ /*if vm3.apache.running = true then vm10.mysql.running = true
41
+ if vm4.apache.running = true then vm10.mysql.running = true
42
+ if vm5.apache.running = true then vm10.mysql.running = true
43
+ if vm6.apache.running = true then vm10.mysql.running = true
44
+ if vm7.apache.running = true then vm10.mysql.running = true
45
+ if vm8.apache.running = true then vm10.mysql.running = true
46
+ if vm9.apache.running = true then vm10.mysql.running = true
47
+ if vm11.apache.running = true then vm10.mysql.running = true
48
+ if vm12.apache.running = true then vm10.mysql.running = true*/
49
+ }
@@ -0,0 +1,52 @@
1
+ include "../modules/vm/vm.sfp"
2
+ include "../modules/apache/apache.sfp"
3
+ include "../modules/mysql/mysql.sfp"
4
+ include "../modules/wordpresscluster/wordpresscluster.sfp"
5
+
6
+ vm1 isa VM {
7
+ created = false
8
+ apache isa Apache
9
+ }
10
+ vm2 isa VM {
11
+ created = false
12
+ apache isa Apache
13
+ }
14
+ /*vm3 extends vm2
15
+ vm4 extends vm2
16
+ vm5 extends vm2
17
+ vm6 extends vm2
18
+ vm7 extends vm2
19
+ vm8 extends vm2
20
+ vm9 extends vm2
21
+ vm11 extends vm2
22
+ vm12 extends vm2*/
23
+ vm10 isa VM {
24
+ created = false
25
+ mysql isa Mysql
26
+ }
27
+
28
+ global {
29
+ if vm1.apache.running = true then {
30
+ vm2.apache.running = true
31
+ /*vm3.apache.running = true
32
+ vm4.apache.running = true
33
+ vm5.apache.running = true
34
+ vm6.apache.running = true
35
+ vm7.apache.running = true
36
+ vm8.apache.running = true
37
+ vm9.apache.running = true
38
+ vm11.apache.running = true
39
+ vm12.apache.running = true*/
40
+ }
41
+
42
+ if vm2.apache.running = true then vm10.mysql.running = true
43
+ /*if vm3.apache.running = true then vm10.mysql.running = true
44
+ if vm4.apache.running = true then vm10.mysql.running = true
45
+ if vm5.apache.running = true then vm10.mysql.running = true
46
+ if vm6.apache.running = true then vm10.mysql.running = true
47
+ if vm7.apache.running = true then vm10.mysql.running = true
48
+ if vm8.apache.running = true then vm10.mysql.running = true
49
+ if vm9.apache.running = true then vm10.mysql.running = true
50
+ if vm11.apache.running = true then vm10.mysql.running = true
51
+ if vm12.apache.running = true then vm10.mysql.running = true*/
52
+ }