Permalink
Browse files

Merge branch 'release/5.2rc2'

  • Loading branch information...
masonkatz committed Jan 9, 2019
2 parents d190f1f + f2fa5d4 commit fbe111aa1982c2c360689d6b0ceb3800726d4790
Showing with 7,464 additions and 4,751 deletions.
  1. +1 −0 common/graph/frontend.xml
  2. +26 −0 common/nodes/database-migration.xml
  3. +83 −170 common/nodes/database-schema.xml
  4. +55 −52 common/src/foundation/python-packages/LICENSE.txt
  5. +2 −1 common/src/foundation/python-packages/packages.json
  6. +1 −1 common/src/foundation/python-packages/versions.json
  7. +22 −3 common/src/stack/build/build/bin/pip2src
  8. +3 −6 common/src/stack/build/build/etc/Rules-redhat.mk
  9. +3 −6 common/src/stack/build/build/etc/Rules-sles.mk
  10. +3 −3 common/src/stack/build/build/etc/copy.mk
  11. +47 −20 common/src/stack/build/build/src/pallet/bin/get3rdparty.py
  12. +8 −9 common/src/stack/build/build/src/pallet/bin/manifest-check.py
  13. +6 −7 common/src/stack/build/build/src/pallet/etc/CCRolls.mk
  14. +2 −2 common/src/stack/build/build/src/pallet/etc/Rolls.mk
  15. +61 −73 common/src/stack/command/stack.py
  16. +117 −90 common/src/stack/command/stack/commands/__init__.py
  17. +25 −49 common/src/stack/command/stack/commands/add/appliance/firewall/__init__.py
  18. +14 −44 common/src/stack/command/stack/commands/add/appliance/route/__init__.py
  19. 0 ...-install/.placeholder → common/src/stack/command/stack/commands/add/appliance/storage/__init__.py
  20. +70 −0 common/src/stack/command/stack/commands/add/appliance/storage/controller/__init__.py
  21. +33 −48 common/src/stack/command/stack/commands/add/environment/firewall/__init__.py
  22. +11 −61 common/src/stack/command/stack/commands/add/environment/route/__init__.py
  23. 0 ...nstall/.placeholder → common/src/stack/command/stack/commands/add/environment/storage/__init__.py
  24. +70 −0 common/src/stack/command/stack/commands/add/environment/storage/controller/__init__.py
  25. +177 −150 common/src/stack/command/stack/commands/add/firewall/__init__.py
  26. +27 −48 common/src/stack/command/stack/commands/add/host/firewall/__init__.py
  27. +17 −110 common/src/stack/command/stack/commands/add/host/route/__init__.py
  28. 0 common/src/stack/command/stack/commands/add/host/storage/__init__.py
  29. +70 −0 common/src/stack/command/stack/commands/add/host/storage/controller/__init__.py
  30. +21 −45 common/src/stack/command/stack/commands/add/os/firewall/__init__.py
  31. +14 −57 common/src/stack/command/stack/commands/add/os/route/__init__.py
  32. 0 common/src/stack/command/stack/commands/add/os/storage/__init__.py
  33. +70 −0 common/src/stack/command/stack/commands/add/os/storage/controller/__init__.py
  34. +87 −34 common/src/stack/command/stack/commands/add/route/__init__.py
  35. +150 −165 common/src/stack/command/stack/commands/add/storage/controller/__init__.py
  36. +43 −62 common/src/stack/command/stack/commands/add/storage/partition/__init__.py
  37. +1 −1 common/src/stack/command/stack/commands/dump/__init__.py
  38. +6 −17 common/src/stack/command/stack/commands/list/appliance/firewall/__init__.py
  39. +2 −19 common/src/stack/command/stack/commands/list/appliance/route/__init__.py
  40. 0 common/src/stack/command/stack/commands/list/appliance/storage/__init__.py
  41. +22 −0 common/src/stack/command/stack/commands/list/appliance/storage/controller/__init__.py
  42. +68 −46 common/src/stack/command/stack/commands/list/attr/__init__.py
  43. +1 −1 common/src/stack/command/stack/commands/list/environment/firewall/__init__.py
  44. +2 −21 common/src/stack/command/stack/commands/list/environment/route/__init__.py
  45. 0 common/src/stack/command/stack/commands/list/environment/storage/__init__.py
  46. +21 −0 common/src/stack/command/stack/commands/list/environment/storage/controller/__init__.py
  47. +112 −40 common/src/stack/command/stack/commands/list/firewall/__init__.py
  48. +0 −301 common/src/stack/command/stack/commands/list/firewall/plugin_default.py
  49. +87 −0 common/src/stack/command/stack/commands/list/firewall/plugin_intrinsic.py
  50. +2 −3 common/src/stack/command/stack/commands/list/host/firewall/__init__.py
  51. +3 −21 common/src/stack/command/stack/commands/list/host/route/__init__.py
  52. 0 common/src/stack/command/stack/commands/list/host/storage/__init__.py
  53. +22 −0 common/src/stack/command/stack/commands/list/host/storage/controller/__init__.py
  54. +8 −1 common/src/stack/command/stack/commands/list/node/xml/__init__.py
  55. +6 −17 common/src/stack/command/stack/commands/list/os/firewall/__init__.py
  56. +7 −39 common/src/stack/command/stack/commands/list/os/route/__init__.py
  57. 0 common/src/stack/command/stack/commands/list/os/storage/__init__.py
  58. +22 −0 common/src/stack/command/stack/commands/list/os/storage/controller/__init__.py
  59. +107 −15 common/src/stack/command/stack/commands/list/route/__init__.py
  60. +108 −131 common/src/stack/command/stack/commands/list/storage/controller/__init__.py
  61. +17 −19 common/src/stack/command/stack/commands/list/storage/partition/__init__.py
  62. +1 −1 common/src/stack/command/stack/commands/load/json/plugin_appliance.py
  63. +1 −1 common/src/stack/command/stack/commands/load/json/plugin_host.py
  64. +1 −1 common/src/stack/command/stack/commands/load/json/plugin_os.py
  65. +15 −28 common/src/stack/command/stack/commands/load/storage/controller/__init__.py
  66. +99 −119 common/src/stack/command/stack/commands/load/storage/controller/imp_load_default.py
  67. +57 −68 common/src/stack/command/stack/commands/load/storage/controller/plugin_load_default.py
  68. +3 −24 common/src/stack/command/stack/commands/remove/appliance/firewall/__init__.py
  69. +0 −33 common/src/stack/command/stack/commands/remove/appliance/plugin_firewall.py
  70. +0 −41 common/src/stack/command/stack/commands/remove/appliance/plugin_route.py
  71. +3 −10 common/src/stack/command/stack/commands/remove/appliance/route/__init__.py
  72. 0 common/src/stack/command/stack/commands/remove/appliance/storage/__init__.py
  73. +40 −0 common/src/stack/command/stack/commands/remove/appliance/storage/controller/__init__.py
  74. +3 −24 common/src/stack/command/stack/commands/remove/environment/firewall/__init__.py
  75. +0 −18 common/src/stack/command/stack/commands/remove/environment/plugin_firewall.py
  76. +0 −18 common/src/stack/command/stack/commands/remove/environment/plugin_route.py
  77. +3 −11 common/src/stack/command/stack/commands/remove/environment/route/__init__.py
  78. 0 common/src/stack/command/stack/commands/remove/environment/storage/__init__.py
  79. +40 −0 common/src/stack/command/stack/commands/remove/environment/storage/controller/__init__.py
  80. +31 −15 common/src/stack/command/stack/commands/remove/firewall/__init__.py
  81. +3 −25 common/src/stack/command/stack/commands/remove/host/firewall/__init__.py
  82. +0 −26 common/src/stack/command/stack/commands/remove/host/plugin_firewall.py
  83. +0 −23 common/src/stack/command/stack/commands/remove/host/plugin_route.py
  84. +4 −23 common/src/stack/command/stack/commands/remove/host/route/__init__.py
  85. 0 common/src/stack/command/stack/commands/remove/host/storage/__init__.py
  86. +40 −0 common/src/stack/command/stack/commands/remove/host/storage/controller/__init__.py
  87. +3 −19 common/src/stack/command/stack/commands/remove/os/firewall/__init__.py
  88. +0 −30 common/src/stack/command/stack/commands/remove/os/plugin_firewall.py
  89. +0 −22 common/src/stack/command/stack/commands/remove/os/plugin_route.py
  90. +3 −8 common/src/stack/command/stack/commands/remove/os/route/__init__.py
  91. 0 common/src/stack/command/stack/commands/remove/os/storage/__init__.py
  92. +40 −0 common/src/stack/command/stack/commands/remove/os/storage/controller/__init__.py
  93. +56 −6 common/src/stack/command/stack/commands/remove/route/__init__.py
  94. +92 −104 common/src/stack/command/stack/commands/remove/storage/controller/__init__.py
  95. +22 −16 common/src/stack/command/stack/commands/remove/storage/partition/__init__.py
  96. +10 −28 common/src/stack/command/stack/commands/report/host/firewall/__init__.py
  97. +20 −27 common/src/stack/command/stack/commands/report/host/route/imp_redhat.py
  98. +18 −40 common/src/stack/command/stack/commands/report/host/route/imp_sles.py
  99. +3 −40 common/src/stack/command/stack/commands/report/host/storage/controller/__init__.py
  100. +52 −33 common/src/stack/command/stack/commands/set/attr/__init__.py
  101. +5 −12 common/src/stack/command/stack/commands/set/attr/doc/__init__.py
  102. +8 −0 common/src/stack/command/stack/commands/verify/__init__.py
  103. +95 −0 common/src/stack/command/stack/commands/verify/xml/__init__.py
  104. +2 −1 common/src/stack/pylib/stack/cond.py
  105. +8 −5 common/src/stack/pylib/stack/expectmore.py
  106. +3 −3 common/src/stack/pylib/stack/profile.py
  107. +15 −0 common/src/stack/switch/command/sync/switch/ib/imp_m7800.py
  108. +283 −66 common/src/stack/switch/pylib/switch/m7800.py
  109. +7 −0 common/src/stack/switch/pylib/switch/mellanoknok/__init__.py
  110. +4 −4 redhat/nodes/firewall-server.xml
  111. +4 −4 sles/nodes/firewall-server.xml
  112. +2 −2 test-framework/Makefile
  113. +2 −6 test-framework/README.md
  114. +1 −1 test-framework/Vagrantfile
  115. +1 −1 test-framework/provisioning/roles/barnacle/tasks/main.yml
  116. +12 −22 test-framework/requirements.txt
  117. +9 −64 test-framework/run-tests.sh
  118. +0 −1 test-framework/test-suites/integration/test-files/add/add_environment_route_output.json
  119. +92 −0 test-framework/test-suites/integration/test-files/list/host_firewall_backend_intrinsic.json
  120. +122 −0 test-framework/test-suites/integration/test-files/list/host_firewall_frontend_intrinsic_no_dns.json
  121. +137 −0 ...-framework/test-suites/integration/test-files/list/host_firewall_frontend_intrinsic_with_dns.json
  122. +182 −0 test-framework/test-suites/integration/test-files/list/host_firewall_scope_overriding.json
  123. +74 −0 test-framework/test-suites/integration/test-files/list/host_route_scope_resolving.json
  124. +32 −0 test-framework/test-suites/integration/test-files/list/host_storage_controller_scope_resolving.json
  125. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_appliance_scope.csv
  126. +3 −0 test-framework/test-suites/integration/test-files/load/storage_controller_duplicate_slot.csv
  127. +4 −0 test-framework/test-suites/integration/test-files/load/storage_controller_global_scope.csv
  128. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_host_scope.csv
  129. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_invalid_array_id.csv
  130. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_invalid_name.csv
  131. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_invalid_slot.csv
  132. +3 −0 test-framework/test-suites/integration/test-files/load/storage_controller_mismatch_raid.csv
  133. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_missing_array_id.csv
  134. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_missing_headers.csv
  135. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_missing_name.csv
  136. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_missing_raid.csv
  137. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_missing_slot.csv
  138. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_negative_array_id.csv
  139. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_negative_slot.csv
  140. +2 −0 test-framework/test-suites/integration/test-files/load/storage_controller_slot_raid_invalid.csv
  141. +4 −4 test-framework/test-suites/integration/test-files/report/host_firewall_nat_rules.txt
  142. +10 −0 test-framework/test-suites/integration/test-files/report/host_route_scope_resolving_redhat.txt
  143. +10 −0 test-framework/test-suites/integration/test-files/report/host_route_scope_resolving_sles.txt
  144. +1 −0 test-framework/test-suites/integration/test-files/report/host_storage_controller_scope_resolving.txt
  145. +10 −0 test-framework/test-suites/integration/test-files/verify/xml/cart-verifyxmltest.xml
  146. +122 −0 test-framework/test-suites/integration/test-files/verify/xml/pallet-verifyxmltest.xml
  147. +2 −1 test-framework/test-suites/integration/tests/add/test_add_appliance.py
  148. +28 −72 test-framework/test-suites/integration/tests/add/test_add_appliance_firewall.py
  149. +83 −34 test-framework/test-suites/integration/tests/add/test_add_appliance_route.py
  150. +42 −0 test-framework/test-suites/integration/tests/add/test_add_appliance_storage_controller.py
  151. +259 −7 test-framework/test-suites/integration/tests/add/test_add_environment_firewall.py
  152. +109 −7 test-framework/test-suites/integration/tests/add/test_add_environment_route.py
  153. +42 −0 test-framework/test-suites/integration/tests/add/test_add_environment_storage_controller.py
  154. +94 −115 test-framework/test-suites/integration/tests/add/test_add_firewall.py
  155. +7 −6 test-framework/test-suites/integration/tests/add/test_add_host_alias.py
  156. +28 −77 test-framework/test-suites/integration/tests/add/test_add_host_firewall.py
  157. +215 −14 test-framework/test-suites/integration/tests/add/test_add_host_route.py
  158. +44 −0 test-framework/test-suites/integration/tests/add/test_add_host_storage_controller.py
  159. +29 −87 test-framework/test-suites/integration/tests/add/test_add_os_firewall.py
  160. +112 −15 test-framework/test-suites/integration/tests/add/test_add_os_route.py
  161. +42 −0 test-framework/test-suites/integration/tests/add/test_add_os_storage_controller.py
  162. +124 −12 test-framework/test-suites/integration/tests/add/test_add_route.py
  163. +278 −16 test-framework/test-suites/integration/tests/add/test_add_storage_controller.py
  164. +2 −1 test-framework/test-suites/integration/tests/add/test_add_switch.py
  165. +5 −5 test-framework/test-suites/integration/tests/add/test_add_switch_partition.py
  166. +5 −5 test-framework/test-suites/integration/tests/add/test_add_switch_partition_member.py
  167. +1 −1 test-framework/test-suites/integration/tests/conftest.py
  168. +2 −1 test-framework/test-suites/integration/tests/dump/test_dump_appliance.py
  169. +1 −1 test-framework/test-suites/integration/tests/dump/test_dump_global.py
  170. +1 −1 test-framework/test-suites/integration/tests/dump/test_dump_host.py
  171. +2 −2 test-framework/test-suites/integration/tests/dump/test_dump_os.py
  172. +104 −0 test-framework/test-suites/integration/tests/list/test_list_host_firewall.py
  173. +67 −0 test-framework/test-suites/integration/tests/list/test_list_host_route.py
  174. +46 −0 test-framework/test-suites/integration/tests/list/test_list_host_storage_controller.py
  175. +3 −3 test-framework/test-suites/integration/tests/list/test_list_switch_partition.py
  176. +3 −3 test-framework/test-suites/integration/tests/list/test_list_switch_partition_member.py
  177. +1 −1 test-framework/test-suites/integration/tests/load/json/test_load_json_host.py
  178. +213 −0 test-framework/test-suites/integration/tests/load/test_load_storage_controller.py
  179. +6 −6 test-framework/test-suites/integration/tests/remove/test_remove_appliance_firewall.py
  180. +24 −24 test-framework/test-suites/integration/tests/remove/test_remove_appliance_route.py
  181. +42 −0 test-framework/test-suites/integration/tests/remove/test_remove_appliance_storage_controller.py
  182. +4 −4 test-framework/test-suites/integration/tests/remove/test_remove_environment_firewall.py
  183. +150 −10 test-framework/test-suites/integration/tests/remove/test_remove_environment_route.py
  184. +44 −0 test-framework/test-suites/integration/tests/remove/test_remove_environment_storage_controller.py
  185. +2 −2 test-framework/test-suites/integration/tests/remove/test_remove_firewall.py
  186. +4 −4 test-framework/test-suites/integration/tests/remove/test_remove_host_firewall.py
  187. +111 −35 test-framework/test-suites/integration/tests/remove/test_remove_host_route.py
  188. +52 −0 test-framework/test-suites/integration/tests/remove/test_remove_host_storage_controller.py
  189. +4 −4 test-framework/test-suites/integration/tests/remove/test_remove_os_firewall.py
  190. +42 −0 test-framework/test-suites/integration/tests/remove/test_remove_os_storage_controller.py
  191. +39 −6 test-framework/test-suites/integration/tests/remove/test_remove_route.py
  192. +155 −0 test-framework/test-suites/integration/tests/remove/test_remove_storage_controller.py
  193. +7 −7 test-framework/test-suites/integration/tests/remove/test_remove_switch_partition.py
  194. +8 −8 test-framework/test-suites/integration/tests/remove/test_remove_switch_partition_member.py
  195. +1 −1 test-framework/test-suites/integration/tests/report/test_report_host_firewall.py
  196. +75 −0 test-framework/test-suites/integration/tests/report/test_report_host_route.py
  197. +55 −0 test-framework/test-suites/integration/tests/report/test_report_host_storage_controller.py
  198. +8 −8 test-framework/test-suites/integration/tests/set/test_set_switch_partition.py
  199. +8 −8 test-framework/test-suites/integration/tests/set/test_set_switch_partition_member.py
  200. +28 −0 test-framework/test-suites/integration/tests/verify/test_verify_xml.py
  201. +0 −119 test-framework/test-suites/system/01-barnacle-install/set-up.sh
  202. +0 −109 test-framework/test-suites/system/04-partitioning-install/Vagrantfile
  203. +0 −35 test-framework/test-suites/system/04-partitioning-install/provisioning/barnacled-frontend.yml
  204. +0 −3 test-framework/test-suites/system/04-partitioning-install/provisioning/roles/barnacle/meta/main.yml
  205. +0 −23 test-framework/test-suites/system/04-partitioning-install/provisioning/roles/barnacle/tasks/main.yml
  206. +0 −61 ...-framework/test-suites/system/04-partitioning-install/provisioning/roles/os-pallet/tasks/main.yml
  207. +0 −32 ...ramework/test-suites/system/04-partitioning-install/provisioning/roles/os-pallet/tasks/sles11.yml
  208. +0 −8 ...stem/04-partitioning-install/provisioning/roles/vagrant-cart/files/vagrant/graph/cart-vagrant.xml
  209. +0 −39 ...partitioning-install/provisioning/roles/vagrant-cart/files/vagrant/nodes/cart-vagrant-backend.xml
  210. +0 −12 ...amework/test-suites/system/04-partitioning-install/provisioning/roles/vagrant-cart/tasks/main.yml
  211. +0 −30 test-framework/test-suites/system/04-partitioning-install/provisioning/roles/zypper/tasks/main.yml
  212. +0 −16 test-framework/test-suites/system/04-partitioning-install/run-tests.sh
  213. +0 −127 test-framework/test-suites/system/04-partitioning-install/set-up.sh
  214. +0 −17 test-framework/test-suites/system/04-partitioning-install/tear-down.sh
  215. +0 −394 test-framework/test-suites/system/04-partitioning-install/tests/test_frontend.py
  216. +2 −2 test-framework/test-suites/system/{01-barnacle-install → }/run-tests.sh
  217. +11 −0 test-framework/test-suites/system/set-up.d/stacki-redhat7.sh
  218. +38 −0 test-framework/test-suites/system/set-up.d/stacki-sles11.sh
  219. +11 −0 test-framework/test-suites/system/set-up.d/stacki-sles12.sh
  220. +103 −0 test-framework/test-suites/system/set-up.sh
  221. 0 test-framework/test-suites/system/{01-barnacle-install → }/tear-down.sh
  222. +22 −0 test-framework/test-suites/system/test-files/create-sles11sp3-box.sh
  223. 0 ...mework/test-suites/system/{01-barnacle-install → }/test-files/default_appliance_attrs_output.json
  224. +27 −22 test-framework/test-suites/system/{01-barnacle-install → }/tests/test_frontend.py
  225. +2 −1 test-framework/test-suites/unit/set-up.sh
  226. +8 −0 test-framework/test-suites/unit/test-files/switch/m7800_install_image_console.txt
  227. +8 −0 test-framework/test-suites/unit/test-files/switch/m7800_parse_partitions_input.txt
  228. +11 −0 test-framework/test-suites/unit/test-files/switch/m7800_parse_partitions_input_new_format.txt
  229. +1 −0 test-framework/test-suites/unit/test-files/switch/m7800_parse_partitions_output.json
  230. +10 −0 ...amework/test-suites/unit/test-files/switch/m7800_parse_partitions_with_member_named_all_input.txt
  231. +11 −0 ...t-suites/unit/test-files/switch/m7800_parse_partitions_with_member_named_all_input_new_format.txt
  232. +1 −0 ...ework/test-suites/unit/test-files/switch/m7800_parse_partitions_with_member_named_all_output.json
  233. +39 −0 test-framework/test-suites/unit/test-files/switch/m7800_show_images_console.txt
  234. +376 −0 test-framework/test-suites/unit/tests/switch/pylib/test_switch_pylib_m7800.py
  235. +1 −1 version.mk
@@ -30,6 +30,7 @@
<to>database-data-init</to>
<to>&os;-bootaction</to>
<to>database-data</to>
<to>database-migration</to>
<to>foundation-python-server</to>
<to>dns-server</to>
<to>mq-server</to>
@@ -0,0 +1,26 @@
<stack:stack>

<stack:copyright>
Copyright (c) 2018 Teradata
All rights reserved. Stacki(r) v5.x stacki.com
https://github.com/Teradata/stacki/blob/master/LICENSE.txt
</stack:copyright>

<stack:script stack:stage="install-post">

# get the mysql root password
root_pw=$(awk -F "=" '/^password/ {print $2}' /root/.my.cnf | tr -d [:space:])

<stack:file stack:name="/root/.yoyo.ini" stack:perms="0400"
stack:owner="root:root" stack:vars="expanded">
[DEFAULT]
migration_table = _yoyo_migration
batch_mode = off
verbosity = 0
database = mysql://root:${root_pw}@/cluster?unix_socket=/var/run/mysql/mysql.sock

</stack:file>

</stack:script>

</stack:stack>
@@ -15,7 +15,7 @@

<stack:script stack:stage="install-post">

<stack:file stack:name="/tmp/tables.sql">
<stack:file stack:name="/tmp/cluster.sql">
<!-- Access -->

DROP TABLE IF EXISTS access;
@@ -34,7 +34,7 @@ DROP TABLE IF EXISTS aliases;
CREATE TABLE aliases (
ID int(11) NOT NULL auto_increment,
Name varchar(32) NOT NULL,
Network int(11) NOT NULL references networks,
Network int(11) NOT NULL references networks,
PRIMARY KEY (ID),
INDEX (Name)
);
@@ -219,58 +219,6 @@ CREATE TABLE switchports (
port int(11) NOT NULL
);

<!-- Routes -->

DROP TABLE IF EXISTS global_routes;
CREATE TABLE global_routes (
Network varchar(32) NOT NULL default '',
Netmask varchar(32) NOT NULL default '',
Gateway varchar(32) NOT NULL default '',
Subnet int(11) default NULL references subnets,
Interface varchar(32) default NULL
);

DROP TABLE IF EXISTS os_routes;
CREATE TABLE os_routes (
OS varchar(32) NOT NULL default '&os;',
Network varchar(32) NOT NULL default '',
Netmask varchar(32) NOT NULL default '',
Gateway varchar(32) NOT NULL default '',
Subnet int(11) default NULL references subnets,
Interface varchar(32) default NULL
);

DROP TABLE IF EXISTS appliance_routes;
CREATE TABLE appliance_routes (
Appliance int(11) NOT NULL default '0' references appliances,
Network varchar(32) NOT NULL default '',
Netmask varchar(32) NOT NULL default '',
Gateway varchar(32) NOT NULL default '',
Subnet int(11) default NULL references subnets,
Interface varchar(32) default NULL,
INDEX (Network)
);

DROP TABLE IF EXISTS node_routes;
CREATE TABLE node_routes (
Node int(11) NOT NULL default '0',
Network varchar(32) NOT NULL default '',
Netmask varchar(32) NOT NULL default '',
Gateway varchar(32) NOT NULL default '',
Subnet int(11) default NULL references subnets,
Interface varchar(32) default NULL
);

DROP TABLE IF EXISTS environment_routes;
CREATE TABLE environment_routes (
Environment int(11) NOT NULL default '0',
Network varchar(32) NOT NULL default '',
Netmask varchar(32) NOT NULL default '',
Gateway varchar(32) NOT NULL default '',
Subnet int(11) default NULL references subnets,
Interface varchar(32) default NULL
);

<!-- Stacks -->

DROP TABLE IF EXISTS stacks;
@@ -345,96 +293,71 @@ CREATE TABLE partitions (
PRIMARY KEY (ID)
);

<!-- Firewall Tables -->

DROP TABLE IF EXISTS global_firewall;
CREATE TABLE global_firewall (
Tabletype enum('nat','filter','mangle','raw') NOT NULL
default 'filter',
Name varchar(256) default NULL,
InSubnet int(11) default NULL references subnets,
OutSubnet int(11) default NULL references subnets,
Service varchar(256) default NULL,
Protocol varchar(256) default NULL,
Action varchar(256) default NULL,
Chain varchar(256) default NULL,
Flags varchar(256) default NULL,
Comment varchar(256) default NULL,
INDEX (Name),
INDEX (Service)
<!-- Gotta drop the tables that use scope_map first -->
DROP TABLE IF EXISTS firewall_rules;
DROP TABLE IF EXISTS routes;
DROP TABLE IF EXISTS storage_controller;
DROP TABLE IF EXISTS scope_map;

CREATE TABLE scope_map (
id INT AUTO_INCREMENT PRIMARY KEY,
scope ENUM('global','appliance','os','environment', 'host') NOT NULL,
appliance_id INT DEFAULT NULL,
os_id INT DEFAULT NULL,
environment_id INT DEFAULT NULL,
node_id INT DEFAULT NULL,
INDEX (scope),
FOREIGN KEY (appliance_id) REFERENCES appliances(id) ON DELETE CASCADE,
FOREIGN KEY (os_id) REFERENCES oses(id) ON DELETE CASCADE,
FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE,
FOREIGN KEY (node_id) REFERENCES nodes(id) ON DELETE CASCADE
);

CREATE TABLE firewall_rules (
id INT AUTO_INCREMENT PRIMARY KEY,
scope_map_id INT NOT NULL,
name VARCHAR(256) NOT NULL,
table_type ENUM('nat','filter','mangle','raw') NOT NULL,
chain VARCHAR(256) NOT NULL,
action VARCHAR(256) NOT NULL,
service VARCHAR(256) NOT NULL,
protocol VARCHAR(256) NOT NULL,
in_subnet_id INT DEFAULT NULL,
out_subnet_id INT DEFAULT NULL,
flags VARCHAR(256) DEFAULT NULL,
comment VARCHAR(256) DEFAULT NULL,
INDEX (name),
INDEX (table_type),
FOREIGN KEY (scope_map_id) REFERENCES scope_map(id) ON DELETE CASCADE,
FOREIGN KEY (in_subnet_id) REFERENCES subnets(id) ON DELETE CASCADE,
FOREIGN KEY (out_subnet_id) REFERENCES subnets(id) ON DELETE CASCADE
);

CREATE TABLE routes (
id INT AUTO_INCREMENT PRIMARY KEY,
scope_map_id INT NOT NULL,
address VARCHAR(32) NOT NULL,
netmask VARCHAR(32) NOT NULL,
gateway VARCHAR(32) DEFAULT NULL,
subnet_id INT DEFAULT NULL,
interface VARCHAR(32) DEFAULT NULL,
INDEX (address),
INDEX (interface),
FOREIGN KEY (scope_map_id) REFERENCES scope_map(id) ON DELETE CASCADE,
FOREIGN KEY (subnet_id) REFERENCES subnets(id) ON DELETE CASCADE
);

DROP TABLE IF EXISTS os_firewall;
CREATE TABLE os_firewall (
OS varchar(32) NOT NULL default '&os;',
Tabletype enum('nat','filter','mangle','raw') NOT NULL
default 'filter',
Name varchar(256) default NULL,
InSubnet int(11) default NULL references subnets,
OutSubnet int(11) default NULL references subnets,
Service varchar(256) default NULL,
Protocol varchar(256) default NULL,
Action varchar(256) default NULL,
Chain varchar(256) default NULL,
Flags varchar(256) default NULL,
Comment varchar(256) default NULL,
INDEX (OS),
INDEX (Name),
INDEX (Service)
);

DROP TABLE IF EXISTS appliance_firewall;
CREATE TABLE appliance_firewall (
Appliance int(11) NOT NULL default '0' references appliances,
Tabletype enum('nat','filter','mangle','raw') NOT NULL
default 'filter',
Name varchar(256) default NULL,
InSubnet int(11) default NULL references subnets,
OutSubnet int(11) default NULL references subnets,
Service varchar(256) default NULL,
Protocol varchar(256) default NULL,
Action varchar(256) default NULL,
Chain varchar(256) default NULL,
Flags varchar(256) default NULL,
Comment varchar(256) default NULL,
INDEX (Name),
INDEX (Service)
);

DROP TABLE IF EXISTS node_firewall;
CREATE TABLE node_firewall (
Node int(11) NOT NULL default '0' references nodes,
Tabletype enum('nat','filter','mangle','raw') NOT NULL
default 'filter',
Name varchar(256) default NULL,
InSubnet int(11) default NULL references subnets,
OutSubnet int(11) default NULL references subnets,
Service varchar(256) default NULL,
Protocol varchar(256) default NULL,
Action varchar(256) default NULL,
Chain varchar(256) default NULL,
Flags varchar(256) default NULL,
Comment varchar(256) default NULL,
INDEX (Name),
INDEX (Service)
);

DROP TABLE IF EXISTS environment_firewall;
CREATE TABLE environment_firewall (
Environment int(11) NOT NULL default '0',
Tabletype enum('nat','filter','mangle','raw') NOT NULL
default 'filter',
Name varchar(256) default NULL,
InSubnet int(11) default NULL references subnets,
OutSubnet int(11) default NULL references subnets,
Service varchar(256) default NULL,
Protocol varchar(256) default NULL,
Action varchar(256) default NULL,
Chain varchar(256) default NULL,
Flags varchar(256) default NULL,
Comment varchar(256) default NULL,
INDEX (Name),
INDEX (Service)
CREATE TABLE storage_controller (
id INT AUTO_INCREMENT PRIMARY KEY,
scope_map_id INT NOT NULL,
enclosure INT NOT NULL,
adapter INT NOT NULL,
slot INT NOT NULL,
raidlevel VARCHAR(16) NOT NULL,
arrayid INT NOT NULL,
options VARCHAR(512) NOT NULL,
INDEX (enclosure, adapter, slot),
FOREIGN KEY (scope_map_id) REFERENCES scope_map(id) ON DELETE CASCADE
);

<!-- Miscellaneous -->
@@ -447,18 +370,6 @@ CREATE TABLE public_keys (
PRIMARY KEY (ID)
);

DROP TABLE IF EXISTS storage_controller;
CREATE TABLE storage_controller (
Scope enum('global', 'os', 'appliance', 'host'),
TableID int(11) NOT NULL,
Adapter int(11) NOT NULL,
Enclosure int(11) NOT NULL,
Slot int(11) NOT NULL,
RaidLevel varchar(16) NOT NULL,
ArrayID int(11) NOT NULL,
Options varchar(512) NOT NULL default ''
);

DROP TABLE IF EXISTS storage_partition;
CREATE TABLE storage_partition (
Scope enum('global', 'os', 'appliance', 'host'),
@@ -499,28 +410,30 @@ CREATE TABLE ib_memberships (

</stack:file>

/usr/bin/mysqladmin --defaults-extra-file=/etc/root.my.cnf \
--user=root create cluster

/usr/bin/mysql --defaults-extra-file=/etc/root.my.cnf \
--user=root cluster &lt; /tmp/tables.sql

<!-- Append the default database -->
<stack:file stack:mode="append"
stack:name="/etc/root.my.cnf">
database = cluster
<stack:file stack:name="/tmp/shadow.sql">
DROP TABLE IF EXISTS attributes;
CREATE TABLE attributes (
Scope enum ('global', 'os', 'environment', 'appliance', 'host'),
Attr varchar(128) NOT NULL,
Value text,
ScopeID int(11)
);
</stack:file>

<stack:file stack:name="/var/db/cluster-grants.sql" stack:perms="0400">
/usr/bin/mysqladmin --defaults-extra-file=/etc/root.my.cnf --user=root create cluster
/usr/bin/mysqladmin --defaults-extra-file=/etc/root.my.cnf --user=root create shadow
/usr/bin/mysql --defaults-extra-file=/etc/root.my.cnf --user=root cluster &lt; /tmp/cluster.sql
/usr/bin/mysql --defaults-extra-file=/etc/root.my.cnf --user=root shadow &lt; /tmp/shadow.sql

<stack:file stack:name="/var/db/grants.sql" stack:perms="0400">
grant select on cluster.* to ''@'localhost';
grant select (scope, attr, value, scopeid) on cluster.attributes to ''@'localhost';
grant select (attr, doc) on cluster.attributes_doc to ''@'localhost';
grant select,update,insert,delete,lock tables on cluster.* to apache@localhost;
grant select,update,insert,delete,lock tables on cluster.* to apache@"&hostname;";
grant select,update,insert,delete,lock tables on shadow.* to apache@localhost;
grant select,update,insert,delete,lock tables on shadow.* to apache@"&hostname;";
</stack:file>

/usr/bin/mysql --defaults-extra-file=/etc/root.my.cnf \
--user=root cluster &lt; /var/db/cluster-grants.sql
/usr/bin/mysql --defaults-extra-file=/etc/root.my.cnf --user=root &lt; /var/db/grants.sql


<!--
@@ -531,7 +444,7 @@ grant select,update,insert,delete,lock tables on cluster.* to apache@"&hostname;
<stack:file stack:name="/var/db/restore-stacki-database.sh" stack:perms="0400">#!/bin/sh

/usr/bin/mysql --defaults-file=/etc/root.my.cnf &lt; /var/db/mysql-backup-cluster
/usr/bin/mysql --defaults-file=/etc/root.my.cnf &lt; /var/db/cluster-grants.sql
/usr/bin/mysql --defaults-file=/etc/root.my.cnf &lt; /var/db/grants.sql

/usr/bin/mysql --defaults-file=/opt/stack/etc/django.my.cnf django &lt; /var/db/mysql-backup-django
/usr/bin/mysql --defaults-file=/etc/root.my.cnf &lt; /var/db/django-grants.sql
Oops, something went wrong.

0 comments on commit fbe111a

Please sign in to comment.