hybrid_platforms_conductor 32.18.0 → 33.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +3 -3
  4. data/bin/check-node +0 -1
  5. data/bin/deploy +0 -1
  6. data/bin/get_impacted_nodes +0 -1
  7. data/bin/last_deploys +8 -7
  8. data/bin/nodes_to_deploy +2 -2
  9. data/bin/setup +6 -6
  10. data/bin/topograph +1 -1
  11. data/docs/config_dsl.md +23 -1
  12. data/docs/executables.md +6 -7
  13. data/docs/executables/check-node.md +3 -3
  14. data/docs/executables/deploy.md +3 -3
  15. data/docs/executables/dump_nodes_json.md +3 -3
  16. data/docs/executables/test.md +3 -3
  17. data/docs/executables/topograph.md +3 -3
  18. data/docs/plugins.md +21 -0
  19. data/docs/plugins/secrets_reader/cli.md +31 -0
  20. data/docs/plugins/secrets_reader/thycotic.md +46 -0
  21. data/lib/hybrid_platforms_conductor/action.rb +4 -4
  22. data/lib/hybrid_platforms_conductor/actions_executor.rb +37 -42
  23. data/lib/hybrid_platforms_conductor/bitbucket.rb +5 -4
  24. data/lib/hybrid_platforms_conductor/cmd_runner.rb +26 -23
  25. data/lib/hybrid_platforms_conductor/cmdb.rb +2 -2
  26. data/lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb +2 -1
  27. data/lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb +2 -1
  28. data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +5 -4
  29. data/lib/hybrid_platforms_conductor/common_config_dsl/github.rb +4 -3
  30. data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +2 -2
  31. data/lib/hybrid_platforms_conductor/config.rb +8 -4
  32. data/lib/hybrid_platforms_conductor/confluence.rb +1 -1
  33. data/lib/hybrid_platforms_conductor/connector.rb +5 -2
  34. data/lib/hybrid_platforms_conductor/core_extensions/cleanroom/fix_kwargs.rb +116 -0
  35. data/lib/hybrid_platforms_conductor/core_extensions/symbol/zero.rb +24 -0
  36. data/lib/hybrid_platforms_conductor/credentials.rb +39 -36
  37. data/lib/hybrid_platforms_conductor/current_dir_monitor.rb +4 -1
  38. data/lib/hybrid_platforms_conductor/deployer.rb +185 -127
  39. data/lib/hybrid_platforms_conductor/executable.rb +20 -15
  40. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/config.rb +10 -7
  41. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +1 -1
  42. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_keys.rb +2 -2
  43. data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +4 -4
  44. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb +5 -1
  45. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +45 -49
  46. data/lib/hybrid_platforms_conductor/hpc_plugins/log/remote_fs.rb +6 -5
  47. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef.rb +77 -79
  48. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/dsl_parser.rb +13 -0
  49. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/serverless_chef/recipes_tree_builder.rb +39 -38
  50. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/yaml_inventory.rb +5 -4
  51. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/docker.rb +43 -45
  52. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/podman.rb +18 -20
  53. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +119 -118
  54. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +39 -43
  55. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/reserve_proxmox_container +9 -13
  56. data/lib/hybrid_platforms_conductor/hpc_plugins/report/confluence.rb +2 -2
  57. data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +28 -21
  58. data/lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb +26 -22
  59. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb +77 -0
  60. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample +46 -0
  61. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +90 -0
  62. data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +3 -3
  63. data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb +4 -2
  64. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +0 -1
  65. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +21 -19
  66. data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +2 -2
  67. data/lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb +2 -2
  68. data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +19 -21
  69. data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +19 -21
  70. data/lib/hybrid_platforms_conductor/hpc_plugins/test/github_ci.rb +2 -3
  71. data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +2 -2
  72. data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +1 -1
  73. data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_conf.rb +21 -22
  74. data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_masters_ok.rb +10 -12
  75. data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +9 -9
  76. data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +2 -2
  77. data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +2 -2
  78. data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +10 -9
  79. data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +2 -2
  80. data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +5 -5
  81. data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +5 -5
  82. data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +4 -6
  83. data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +3 -3
  84. data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +25 -24
  85. data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +2 -2
  86. data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/stdout.rb +8 -6
  87. data/lib/hybrid_platforms_conductor/io_router.rb +14 -13
  88. data/lib/hybrid_platforms_conductor/json_dumper.rb +2 -2
  89. data/lib/hybrid_platforms_conductor/log.rb +2 -2
  90. data/lib/hybrid_platforms_conductor/logger_helpers.rb +19 -16
  91. data/lib/hybrid_platforms_conductor/nodes_handler.rb +89 -71
  92. data/lib/hybrid_platforms_conductor/parallel_threads.rb +7 -11
  93. data/lib/hybrid_platforms_conductor/platform_handler.rb +7 -7
  94. data/lib/hybrid_platforms_conductor/platforms_handler.rb +5 -3
  95. data/lib/hybrid_platforms_conductor/plugin.rb +2 -2
  96. data/lib/hybrid_platforms_conductor/plugins.rb +14 -8
  97. data/lib/hybrid_platforms_conductor/provisioner.rb +4 -4
  98. data/lib/hybrid_platforms_conductor/report.rb +2 -2
  99. data/lib/hybrid_platforms_conductor/reports_handler.rb +3 -2
  100. data/lib/hybrid_platforms_conductor/secrets_reader.rb +31 -0
  101. data/lib/hybrid_platforms_conductor/services_handler.rb +32 -29
  102. data/lib/hybrid_platforms_conductor/test_only_remote_node.rb +1 -1
  103. data/lib/hybrid_platforms_conductor/test_report.rb +15 -18
  104. data/lib/hybrid_platforms_conductor/tests_runner.rb +116 -118
  105. data/lib/hybrid_platforms_conductor/thycotic.rb +28 -19
  106. data/lib/hybrid_platforms_conductor/topographer.rb +200 -190
  107. data/lib/hybrid_platforms_conductor/topographer/plugins/graphviz.rb +8 -8
  108. data/lib/hybrid_platforms_conductor/topographer/plugins/json.rb +4 -4
  109. data/lib/hybrid_platforms_conductor/version.rb +1 -1
  110. data/spec/hybrid_platforms_conductor_test.rb +29 -6
  111. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +18 -11
  112. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +2 -2
  113. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +32 -21
  114. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +75 -49
  115. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +27 -15
  116. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +90 -59
  117. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +46 -44
  118. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/connectable_nodes_spec.rb +12 -8
  119. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/remote_actions_spec.rb +4 -7
  120. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +21 -22
  121. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb +23 -24
  122. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connectable_nodes_spec.rb +10 -6
  123. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +106 -75
  124. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +145 -126
  125. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/node_helpers_spec.rb +3 -3
  126. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +29 -25
  127. data/spec/hybrid_platforms_conductor_test/api/actions_executor/logging_spec.rb +167 -142
  128. data/spec/hybrid_platforms_conductor_test/api/actions_executor/parallel_spec.rb +272 -244
  129. data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +16 -16
  130. data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +42 -36
  131. data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +24 -22
  132. data/spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb +4 -2
  133. data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +24 -6
  134. data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +34 -26
  135. data/spec/hybrid_platforms_conductor_test/api/deployer/log_plugins/remote_fs_spec.rb +21 -21
  136. data/spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb +55 -59
  137. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +36 -62
  138. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/podman_spec.rb +17 -17
  139. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/config_dsl_spec.rb +4 -4
  140. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/create_spec.rb +44 -51
  141. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb +3 -3
  142. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/ip_spec.rb +12 -16
  143. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/destroy_vm_spec.rb +31 -19
  144. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +324 -266
  145. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/ips_assignment_spec.rb +89 -61
  146. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/other_lxc_containers_resources_spec.rb +117 -93
  147. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/pve_node_resources_spec.rb +71 -54
  148. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +10 -8
  149. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/vm_ids_assignment_spec.rb +80 -60
  150. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb +1 -1
  151. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb +1 -1
  152. data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb +1 -1
  153. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb +64 -0
  154. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +268 -0
  155. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb +8 -10
  156. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +33 -24
  157. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb +64 -51
  158. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/platform_handlers_spec.rb +3 -3
  159. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +50 -51
  160. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/common_spec.rb +91 -81
  161. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/config_dsl_spec.rb +14 -16
  162. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/git_diff_impacts_spec.rb +51 -75
  163. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/nodes_selectors_spec.rb +35 -26
  164. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/platform_handlers_plugins_api_spec.rb +24 -16
  165. data/spec/hybrid_platforms_conductor_test/api/nodes_handler/several_platforms_spec.rb +29 -19
  166. data/spec/hybrid_platforms_conductor_test/api/platform_handler_spec.rb +4 -4
  167. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/config_dsl_spec.rb +2 -2
  168. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/deploy_output_parsing_spec.rb +6 -6
  169. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/diff_impacts_spec.rb +57 -99
  170. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/inventory_spec.rb +4 -4
  171. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/packaging_spec.rb +32 -35
  172. data/spec/hybrid_platforms_conductor_test/api/platform_handlers/serverless_chef/services_deployment_spec.rb +10 -10
  173. data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +38 -27
  174. data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +46 -52
  175. data/spec/hybrid_platforms_conductor_test/api/reports_handler_spec.rb +2 -2
  176. data/spec/hybrid_platforms_conductor_test/api/services_handler/actions_to_deploy_spec.rb +90 -58
  177. data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +38 -34
  178. data/spec/hybrid_platforms_conductor_test/api/services_handler/log_info_spec.rb +11 -9
  179. data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +193 -171
  180. data/spec/hybrid_platforms_conductor_test/api/services_handler/parse_deploy_output_spec.rb +66 -54
  181. data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +147 -133
  182. data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +69 -49
  183. data/spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb +4 -3
  184. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +8 -5
  185. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_spec.rb +8 -5
  186. data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +30 -27
  187. data/spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb +12 -9
  188. data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +48 -47
  189. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb +5 -5
  190. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/github_ci_spec.rb +5 -5
  191. data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb +5 -5
  192. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +9 -9
  193. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb2.rb → test_cmdb_2.rb} +6 -6
  194. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +3 -3
  195. data/spec/hybrid_platforms_conductor_test/cmdb_plugins/{test_cmdb_others2.rb → test_cmdb_others_2.rb} +2 -2
  196. data/spec/hybrid_platforms_conductor_test/docs_spec.rb +1 -1
  197. data/spec/hybrid_platforms_conductor_test/executables/{check-node_spec.rb → check_node_spec.rb} +4 -6
  198. data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +4 -6
  199. data/spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb +76 -77
  200. data/spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb +13 -15
  201. data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +289 -307
  202. data/spec/hybrid_platforms_conductor_test/executables/options/actions_executor_spec.rb +4 -6
  203. data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +3 -5
  204. data/spec/hybrid_platforms_conductor_test/executables/options/common_spec.rb +8 -9
  205. data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +12 -196
  206. data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +9 -10
  207. data/spec/hybrid_platforms_conductor_test/executables/options/nodes_selectors_spec.rb +9 -10
  208. data/spec/hybrid_platforms_conductor_test/executables/options/reports_handler_spec.rb +1 -1
  209. data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +22 -22
  210. data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +22 -16
  211. data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +32 -32
  212. data/spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb +7 -9
  213. data/spec/hybrid_platforms_conductor_test/executables/test_spec.rb +3 -5
  214. data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +2 -2
  215. data/spec/hybrid_platforms_conductor_test/helpers/cmd_runner_helpers.rb +4 -3
  216. data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +2 -2
  217. data/spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb +1 -1
  218. data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +12 -13
  219. data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +216 -14
  220. data/spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb +11 -11
  221. data/spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb +1 -1
  222. data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +39 -28
  223. data/spec/hybrid_platforms_conductor_test/helpers/plugins_helpers.rb +1 -1
  224. data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +86 -111
  225. data/spec/hybrid_platforms_conductor_test/helpers/reports_handler_helpers.rb +1 -1
  226. data/spec/hybrid_platforms_conductor_test/helpers/serverless_chef_helpers.rb +3 -3
  227. data/spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb +1 -1
  228. data/spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb +1 -1
  229. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id1.rb → test_plugin_id_1.rb} +0 -0
  230. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/{test_plugin_id2.rb → test_plugin_id_2.rb} +0 -0
  231. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/{test_plugin_id3.rb → test_plugin_id_3.rb} +0 -0
  232. data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/{test_plugin_type2/test_plugin_id4.rb → test_plugin_type_2/test_plugin_id_4.rb} +0 -0
  233. data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb +1 -1
  234. data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/{test2.rb → test_2.rb} +0 -0
  235. data/spec/hybrid_platforms_conductor_test/rubocop_spec.rb +31 -0
  236. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/1_node/nodes/node.json +3 -3
  237. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/data_bags/nodes/node.json +3 -3
  238. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/recipes/cookbooks/test_cookbook_2/libraries/default.rb +1 -0
  239. data/spec/hybrid_platforms_conductor_test/serverless_chef_repositories/several_cookbooks/other_cookbooks/test_cookbook_2/libraries/default.rb +1 -0
  240. data/spec/hybrid_platforms_conductor_test/shared_examples/deployer.rb +952 -0
  241. data/spec/hybrid_platforms_conductor_test/test_connector.rb +4 -3
  242. data/spec/hybrid_platforms_conductor_test/test_log_no_read_plugin.rb +3 -1
  243. data/spec/hybrid_platforms_conductor_test/test_log_plugin.rb +3 -1
  244. data/spec/hybrid_platforms_conductor_test/test_plugins/global.rb +1 -0
  245. data/spec/hybrid_platforms_conductor_test/test_plugins/node.rb +1 -0
  246. data/spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb +1 -0
  247. data/spec/hybrid_platforms_conductor_test/test_plugins/platform.rb +1 -0
  248. data/spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb +2 -2
  249. data/spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb +45 -0
  250. data/spec/hybrid_platforms_conductor_test/tests_report_plugin.rb +5 -6
  251. data/spec/spec_helper.rb +17 -18
  252. data/tools/check_md +16 -20
  253. data/tools/generate_mermaid +1 -1
  254. metadata +186 -144
  255. data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +0 -916
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b724f6cb69633133e800d381ee1d0bfdd1a1107d7fc388fe1dcbcf423480ca9d
4
- data.tar.gz: 3252bc11e083295c2694df60a9af790d8b01cbe851baebbe1d8e75b656e0acd3
3
+ metadata.gz: bedd336d4e713f15ac516cd61d50cf964c2a25051fbb624e1ca75196ccd9dd39
4
+ data.tar.gz: 2d75b29868194072733dd273f6d2f17ca001cc167f446105b72381e1620c57a1
5
5
  SHA512:
6
- metadata.gz: 43793a4b3f8ec9a1353b4c075289dfcd77574b64a481754db68e1affa1c599500a3c29d8fa12b31c13dd69b47c5a2840f52aef80045fbec8be7a363ca4eb90b7
7
- data.tar.gz: 0451da97325093d7a59684de1ffc77856f4baf5c3a4c76853e6df4492c7cfb1d52cbf9405c0d44b1d8af643e61f64569fc305ed61204be26f081591bdccb6d43
6
+ metadata.gz: f4333f83879592e3089ce6cf0e40609efab2435fe9bbecae699462871bab7c3df6b5e44da476b823dfde6f0f1868d1cbd5ca621a076ca147355950b1610b6e38
7
+ data.tar.gz: e0f21e5ccec863d19c93fa1f36bcf51ce1be1a7b1e7bcdbcf83329914df3b3c852eb43b8af2e178b68f94305584c406007de0d47acc713f8170e7b7bba3da621
data/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # [v33.0.4](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.3...v33.0.4) (2021-06-18 10:09:57)
2
+
3
+ ## Global changes
4
+ ### Patches
5
+
6
+ * [[Fix(cmd_runner)] [#69] Make sure commands are run in unbundled env](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/0795c1ffdcf1b355c9dc91423bb6b7d88918fcf7)
7
+
8
+ ## Changes for cmd_runner
9
+ ### Patches
10
+
11
+ * [[Fix(cmd_runner)] [#69] Make sure commands are run in unbundled env](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/0795c1ffdcf1b355c9dc91423bb6b7d88918fcf7)
12
+
13
+ # [v33.0.3](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.2...v33.0.3) (2021-06-17 12:42:32)
14
+
15
+ ### Patches
16
+
17
+ * [[#49] Corrected minor warnings and added tests that no warning occurs anymore in rspec](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/57e9936da05431ca469a98d7f079211d9278574f)
18
+
19
+ # [v33.0.2](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.1...v33.0.2) (2021-06-17 11:15:29)
20
+
21
+ ### Patches
22
+
23
+ * [[#49] Corrected warnings to prepare migration to Ruby 3](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/8f3e758a881dcd988540d660b2df8a38fe39d1ca)
24
+
25
+ # [v33.0.1](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v33.0.0...v33.0.1) (2021-06-16 16:22:41)
26
+
27
+ ### Patches
28
+
29
+ * [[#49] Added lint checks in CI and corrected all non acceptable lint errors](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/b3188532e679f845f66966e7c8054ce8db63be26)
30
+
31
+ # [v33.0.0](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v32.18.0...v33.0.0) (2021-06-15 16:10:47)
32
+
33
+ ### Breaking changes
34
+
35
+ * [[Breaking] Add secrets reader plugins with 2 default plugins: cli and thycotic](https://github.com/sweet-delights/hybrid-platforms-conductor/commit/2cfacebe8cfac57de40ef003877da5b99aca5b5e)
36
+
1
37
  # [v32.18.0](https://github.com/sweet-delights/hybrid-platforms-conductor/compare/v32.17.1...v32.18.0) (2021-06-14 15:01:02)
2
38
 
3
39
  ## Global changes
data/README.md CHANGED
@@ -216,13 +216,13 @@ Connector ssh options:
216
216
  --ssh-gateways-conf
217
217
 
218
218
  Deployer options:
219
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
220
- * Local path to a JSON file
221
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
222
219
  -p, --parallel Execute the commands in parallel (put the standard output in files <hybrid-platforms-dir>/run_logs/*.stdout)
223
220
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to no timeout)
224
221
  -W, --why-run Use the why-run mode to see what would be the result of the deploy instead of deploying it for real.
225
222
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
223
+
224
+ Secrets reader cli options:
225
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
226
226
  ```
227
227
 
228
228
  All executables also have the `--debug` switch to display more verbose and debugging information.
data/bin/check-node CHANGED
@@ -12,7 +12,6 @@ executable = HybridPlatformsConductor::Executable.new(
12
12
  end
13
13
  end
14
14
  nodes_handler = executable.nodes_handler
15
- actions_executor = executable.actions_executor
16
15
  deployer = executable.deployer
17
16
 
18
17
  executable.parse_options!
data/bin/deploy CHANGED
@@ -2,7 +2,6 @@
2
2
  require 'hybrid_platforms_conductor/executable'
3
3
 
4
4
  executable = HybridPlatformsConductor::Executable.new
5
- actions_executor = executable.actions_executor
6
5
  deployer = executable.deployer
7
6
 
8
7
  executable.parse_options!
@@ -22,7 +22,6 @@ executable = HybridPlatformsConductor::Executable.new(nodes_selection_options: f
22
22
  end
23
23
  nodes_handler = executable.nodes_handler
24
24
  platforms_handler = executable.platforms_handler
25
- cmd_runner = executable.cmd_runner
26
25
  executable.parse_options!
27
26
  raise 'No platform specified. Please use --platform option' if platform.nil?
28
27
 
data/bin/last_deploys CHANGED
@@ -8,12 +8,12 @@ possible_string_sorts = %i[
8
8
  node
9
9
  user
10
10
  ]
11
- possible_sorts = Hash[possible_string_sorts.map do |property_name|
11
+ possible_sorts = possible_string_sorts.map do |property_name|
12
12
  [
13
13
  property_name,
14
14
  proc { |node, deploy_info| [deploy_info.key?(:error) || !deploy_info.key?(property_name) ? '' : deploy_info[property_name], node] }
15
15
  ]
16
- end]
16
+ end.to_h
17
17
 
18
18
  sort_by = :node
19
19
  sort_desc = false
@@ -21,7 +21,7 @@ executable = HybridPlatformsConductor::Executable.new(deploy_options: false) do
21
21
  opts.on('-r', '--sort-by SORT', "Specify a sort. Possible values are: #{possible_sorts.keys.sort.join(', ')}. Each value can append _desc to specify a reverse sorting. Defaults to #{sort_by}.") do |sort_name|
22
22
  if sort_name =~ /^(.+)_desc$/
23
23
  sort_desc = true
24
- sort_name = $1
24
+ sort_name = Regexp.last_match(1)
25
25
  end
26
26
  sort_by = sort_name.to_sym
27
27
  end
@@ -32,8 +32,8 @@ deployer = executable.deployer
32
32
  executable.parse_options!
33
33
  raise "Unknown sort name: #{sort_by}. Should be one of #{possible_sorts.keys.join(', ')}." unless possible_sorts.key?(sort_by)
34
34
 
35
- sorted_deploy_info = Hash[
36
- deployer.deployment_info_from(nodes_handler.select_nodes(executable.selected_nodes.empty? ? [{ all: true }] : executable.selected_nodes)).
35
+ sorted_deploy_info = deployer.
36
+ deployment_info_from(nodes_handler.select_nodes(executable.selected_nodes.empty? ? [{ all: true }] : executable.selected_nodes)).
37
37
  map do |node, deploy_info|
38
38
  decorated_deploy_info = deploy_info.merge(node: node)
39
39
  if deploy_info.key?(:deployment_info)
@@ -42,8 +42,9 @@ sorted_deploy_info = Hash[
42
42
  end
43
43
  decorated_deploy_info[:services] = deploy_info[:services].join(', ') if deploy_info.key?(:services)
44
44
  [node, decorated_deploy_info]
45
- end
46
- ].sort_by(&possible_sorts[sort_by])
45
+ end.
46
+ to_h.
47
+ sort_by(&possible_sorts[sort_by])
47
48
  sorted_deploy_info.reverse! if sort_desc
48
49
  info_displayed = {
49
50
  node: 'Node',
data/bin/nodes_to_deploy CHANGED
@@ -21,7 +21,7 @@ deployer = executable.deployer
21
21
 
22
22
  executable.parse_options!
23
23
 
24
- nodes = (nodes_handler.select_nodes(executable.selected_nodes.empty? ? [{ all: true }] : executable.selected_nodes))
24
+ nodes = nodes_handler.select_nodes(executable.selected_nodes.empty? ? [{ all: true }] : executable.selected_nodes)
25
25
 
26
26
  unless ignore_schedule
27
27
  # Select nodes to be deployed, based first on deployment schedule
@@ -67,7 +67,7 @@ unless ignore_deploy_info
67
67
  node_impacted = false
68
68
  # Loop over all possible repositories concerned by this deployment
69
69
  repo_idx = 0
70
- while node_deploy_info[:deployment_info].key?("repo_name_#{repo_idx}".to_sym) do
70
+ while node_deploy_info[:deployment_info].key?("repo_name_#{repo_idx}".to_sym)
71
71
  repo_name = node_deploy_info[:deployment_info]["repo_name_#{repo_idx}".to_sym]
72
72
  commit_id = node_deploy_info[:deployment_info]["commit_id_#{repo_idx}".to_sym]
73
73
  impacted_nodes = cache_impacted_nodes.dig(repo_name, commit_id)
data/bin/setup CHANGED
@@ -7,10 +7,10 @@ platforms_handler = executable.platforms_handler
7
7
  executable.parse_options!
8
8
 
9
9
  platforms_handler.known_platforms.each do |platform|
10
- if platform.respond_to?(:setup)
11
- executable.out "===== Setup platform #{platform.name}..."
12
- platform.setup
13
- executable.out "===== Platform #{platform.name} setup successfully."
14
- executable.out ''
15
- end
10
+ next unless platform.respond_to?(:setup)
11
+
12
+ executable.out "===== Setup platform #{platform.name}..."
13
+ platform.setup
14
+ executable.out "===== Platform #{platform.name} setup successfully."
15
+ executable.out ''
16
16
  end
data/bin/topograph CHANGED
@@ -17,7 +17,7 @@ executable.parse_options!
17
17
 
18
18
  # Initialize the topograph
19
19
  from_nodes, to_nodes = topographer.resolve_from_to
20
- topographer.get_json_files
20
+ topographer.json_files
21
21
 
22
22
  # The list of clusters to group nodes into 1 graphviz node to simplify the graph.
23
23
  known_nodes_lists = nodes_handler.known_nodes_lists
data/docs/config_dsl.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The DSL used in configuration files is comprised of Ruby methods that can be called directly in the main `hpc_config.rb` file.
4
4
 
5
- This DSL can also be completed by plugins. Check [the plugins documentations](plugins) to know about DSL extensions brought by plugins.
5
+ This DSL can also be completed by plugins. Check [the plugins documentations](plugins.md) to know about DSL extensions brought by plugins.
6
6
 
7
7
  # Table of Contents
8
8
  * [`<platform_type>_platform`](#platform_type_platform)
@@ -13,6 +13,7 @@ This DSL can also be completed by plugins. Check [the plugins documentations](pl
13
13
  * [`hybrid_platforms_dir`](#hybrid_platforms_dir)
14
14
  * [`tests_provisioner`](#tests_provisioner)
15
15
  * [`expect_tests_to_fail`](#expect_tests_to_fail)
16
+ * [`read_secrets_from`](#read_secrets_from)
16
17
  * [`send_logs_to`](#send_logs_to)
17
18
  * [`retry_deploy_for_errors_on_stdout`](#retry_deploy_for_errors_on_stdout)
18
19
  * [`retry_deploy_for_errors_on_stderr`](#retry_deploy_for_errors_on_stderr)
@@ -201,6 +202,27 @@ for_nodes('/tst/') do
201
202
  end
202
203
  ```
203
204
 
205
+ <a name="read_secrets_from"></a>
206
+ ## `read_secrets_from`
207
+
208
+ Set the list of [secrets reader plugins](plugins.md#secrets_reader) to use.
209
+ By default (if no plugins is specifically set) the [secrets reader plugin `cli`](plugins/secrets_reader/cli.md) is being used.
210
+
211
+ Takes the list of secrets reader plugin names, as symbols, as a parameter.
212
+
213
+ Can be applied to subset of nodes using the [`for_nodes` DSL method](#for_nodes).
214
+
215
+ Examples:
216
+ ```ruby
217
+ # By default, get secrets from the command-line
218
+ read_secrets_from :cli
219
+
220
+ # All our production nodes also have their secrets stored on a secured Thycotic server
221
+ for_nodes('/prd/') do
222
+ read_secrets_from :thycotic
223
+ end
224
+ ```
225
+
204
226
  <a name="send_logs_to"></a>
205
227
  ## `send_logs_to`
206
228
 
data/docs/executables.md CHANGED
@@ -132,25 +132,22 @@ The Deployer options are used to drive a deployment (be it in why-run mode or no
132
132
 
133
133
  ```
134
134
  Deployer options:
135
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
136
- * Local path to a JSON file
137
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
138
135
  -p, --parallel Execute the commands in parallel (put the standard output in files <hybrid-platforms-dir>/run_logs/*.stdout)
139
136
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to no timeout)
140
137
  -W, --why-run Use the why-run mode to see what would be the result of the deploy instead of deploying it for real.
141
138
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
139
+
140
+ Secrets reader cli options:
141
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
142
142
  ```
143
143
 
144
- * `--secrets SECRETS_LOCATION`: Specify a JSON file storing secrets that can be used by the deployment process. Secrets are values that are needed for deployment but that should not be part of the platforms repositories (such as passwords, API keys, SSL certificates...).
145
- The location can be:
146
- * A local file path (for example /path/to/file.json).
147
- * A Thycotic Secret Server URL followed by a secret id (for example https://portal.muc.msp.my_company.net/SecretServer:8845).
148
144
  * `--parallel`: Specify that the deployment process should perform concurrently on the different nodes it has to deploy to.
149
145
  * `--timeout SECS`: Specify the timeout (in seconds) to apply while deploying. This can be set only in why-run mode.
150
146
  * `--why-run`: Specify the why-run mode. The why-run mode is used to simulate a deployment on the nodes, and report what a real deployment would have changed on the node.
151
147
  * `--retries-on-error NBR`: Specify the number of retries deploys can do in case of non-deterministic errors.
152
148
  Non-deterministic errors are matched using a set of strings or regular expressions that can be configured in the `hpc_config.rb` file of any platform, using the `retry_deploy_for_errors_on_stdout` and `retry_deploy_for_errors_on_stderr` properties:
153
149
  For example:
150
+
154
151
  ```ruby
155
152
  retry_deploy_for_errors_on_stdout [
156
153
  'This is a raw string error that will be matched against stdout',
@@ -161,6 +158,8 @@ retry_deploy_for_errors_on_stderr [
161
158
  ]
162
159
  ```
163
160
 
161
+ * `--secrets SECRETS_LOCATION`: Specify a JSON file storing secrets that can be used by the deployment process. Secrets are values that are needed for deployment but that should not be part of the platforms repositories (such as passwords, API keys, SSL certificates...). This option is used by the [`cli` secrets reader plugin](plugins/secrets_reader/cli.md). See [secrets reader plugins](plugins.md#secrets_reader) for more info about secrets retrieval.
162
+
164
163
  ## JSON dump options
165
164
 
166
165
  The JSON dump options drive the way nodes' JSON information is being dumped.
@@ -65,11 +65,11 @@ Connector ssh options:
65
65
  --ssh-gateways-conf
66
66
 
67
67
  Deployer options:
68
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
69
- * Local path to a JSON file
70
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
71
68
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to no timeout)
72
69
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
70
+
71
+ Secrets reader cli options:
72
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
73
73
  ```
74
74
 
75
75
  ## Examples
@@ -82,13 +82,13 @@ Connector ssh options:
82
82
  --ssh-gateways-conf
83
83
 
84
84
  Deployer options:
85
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
86
- * Local path to a JSON file
87
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
88
85
  -p, --parallel Execute the commands in parallel (put the standard output in files <hybrid-platforms-dir>/run_logs/*.stdout)
89
86
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to no timeout)
90
87
  -W, --why-run Use the why-run mode to see what would be the result of the deploy instead of deploying it for real.
91
88
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
89
+
90
+ Secrets reader cli options:
91
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
92
92
  ```
93
93
 
94
94
  ## Examples
@@ -54,13 +54,13 @@ Connector ssh options:
54
54
  --ssh-gateways-conf
55
55
 
56
56
  Deployer options:
57
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
58
- * Local path to a JSON file
59
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
60
57
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to 30)
61
58
  -W, --why-run Use the why-run mode to see what would be the result of the deploy instead of deploying it for real.
62
59
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
63
60
 
61
+ Secrets reader cli options:
62
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
63
+
64
64
  JSON dump options:
65
65
  -k, --skip-run Skip the actual gathering of dumps in run_logs. If set, the current run_logs content will be used.
66
66
  -j, --json-dir DIRECTORY Specify the output directory in which JSON files are being written. Defaults to nodes_json.
@@ -93,11 +93,11 @@ Connector ssh options:
93
93
  --ssh-gateways-conf
94
94
 
95
95
  Deployer options:
96
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
97
- * Local path to a JSON file
98
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
99
96
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
100
97
 
98
+ Secrets reader cli options:
99
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
100
+
101
101
  Tests runner options:
102
102
  -i, --tests-list FILE_NAME Specify a tests file name. The file should contain a list of tests name (1 per line). Can be used several times.
103
103
  -k, --skip-run Skip running the check-node commands for real, and just analyze existing run logs.
@@ -39,12 +39,12 @@ Connector ssh options:
39
39
  --ssh-gateways-conf
40
40
 
41
41
  Deployer options:
42
- -e, --secrets SECRETS_LOCATION Specify a secrets location. Can be specified several times. Location can be:
43
- * Local path to a JSON file
44
- * URL of the form http[s]://<url>:<secret_id> to get a secret JSON file from a Thycotic Secret Server at the given URL.
45
42
  -t, --timeout SECS Timeout in seconds to wait for each chef run. Only used in why-run mode. (defaults to 30)
46
43
  --retries-on-error NBR Number of retries in case of non-deterministic errors (defaults to 0)
47
44
 
45
+ Secrets reader cli options:
46
+ -e, --secrets JSON_FILE Specify a secrets location from a local JSON file. Can be specified several times.
47
+
48
48
  JSON dump options:
49
49
  -j, --json-dir DIRECTORY Specify the output directory in which JSON files are being written. Defaults to nodes_json.
50
50
 
data/docs/plugins.md CHANGED
@@ -14,6 +14,7 @@ Following are all possible plugin types and the plugins shipped by default with
14
14
  * [`platform_handler`](#platform_handler)
15
15
  * [`provisioner`](#provisioner)
16
16
  * [`report`](#report)
17
+ * [`secrets_reader`](#secrets_reader)
17
18
  * [`test`](#test)
18
19
  * [`test_report`](#test_report)
19
20
 
@@ -177,6 +178,26 @@ Plugins shipped by default:
177
178
  * [`mediawiki`](plugins/report/mediawiki.md)
178
179
  * [`stdout`](plugins/report/stdout.md)
179
180
 
181
+ <a name="secrets_reader"></a>
182
+ ## Secrets readers
183
+
184
+ Secrets reader are responsible for fetching secrets (passwords, private keys, API tokens...) needed during deployment from various sources (command line, environment, vaults, secrets servers...).
185
+
186
+ Corresponding plugin type: `secrets_reader`.
187
+
188
+ These plugins add new ways to retrieve secrets used by the [`Deployer`](../lib/hybrid_platforms_conductor/deployer.rb)
189
+
190
+ Examples of secrets readers are:
191
+ * Command-line: Give secrets from a local file.
192
+ * Vault: Get secrets from vaults (encrypted databases).
193
+ * Secrets servers: Query secrets servers to retrieve secrets.
194
+
195
+ Check the [sample plugin file](../lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample) to know more about the API that needs to be implemented by such plugins.
196
+
197
+ Plugins shipped by default:
198
+ * [`cli`](plugins/secrets_reader/cli.md)
199
+ * [`thycotic`](plugins/secrets_reader/thycotic.md)
200
+
180
201
  <a name="test"></a>
181
202
  ## Tests
182
203
 
@@ -0,0 +1,31 @@
1
+ # Secrets reader plugin: `cli`
2
+
3
+ The `cli` secrets reader plugin reads secrets from a local JSON file that can be given through the `--secrets` command-line parameter.
4
+
5
+ Example:
6
+ ```bash
7
+ ./bin/deploy --node my_node --secrets /path/to/my_secrets.json
8
+ ```
9
+
10
+ ## Config DSL extension
11
+
12
+ None
13
+
14
+ ## Used credentials
15
+
16
+ | Credential | Usage
17
+ | --- | --- |
18
+
19
+ ## Used Metadata
20
+
21
+ | Metadata | Type | Usage
22
+ | --- | --- | --- |
23
+
24
+ ## Used environment variables
25
+
26
+ | Variable | Usage
27
+ | --- | --- |
28
+
29
+ ## External tools dependencies
30
+
31
+ None
@@ -0,0 +1,46 @@
1
+ # Secrets reader plugin: `thycotic`
2
+
3
+ The `thycotic` secrets reader plugin retrieves secrets from a [Thycotic secrets server](https://thycotic.com/products/secret-server-vdo/), using its SOAP API.
4
+
5
+ It is configured using the `secrets_from_thycotic` (see below) config DSL and uses the `thycotic` credential ID to authenticate.
6
+
7
+ ## Config DSL extension
8
+
9
+ ### `secrets_from_thycotic`
10
+
11
+ Define a Thycotic URL and Thycotic secret ID to fetch from a Thycotic server.
12
+ The Thycotic secret should contain a JSON file that will be retrieved locally to be used as a secrets source. The local copy will then be removed after deployment.
13
+
14
+ Can be applied to subset of nodes using the [`for_nodes` DSL method](/docs/config_dsl.md#for_nodes).
15
+
16
+ It takes the following parameters:
17
+ * **thycotic_url** (`String`): The Thycotic server URL.
18
+ * **secret_id** (`Integer`): The Thycotic secret ID containing the secrets file to be used as secrets.
19
+
20
+ Example:
21
+ ```ruby
22
+ secrets_from_thycotic(
23
+ thycotic_url: 'https://my-thycotic-server.my-domain.com/SecretServer',
24
+ secret_id: 1107
25
+ )
26
+ ```
27
+
28
+ ## Used credentials
29
+
30
+ | Credential | Usage
31
+ | --- | --- |
32
+ | `thycotic` | Used to authenticate on the Thycotic server's SOAP API |
33
+
34
+ ## Used Metadata
35
+
36
+ | Metadata | Type | Usage
37
+ | --- | --- | --- |
38
+
39
+ ## Used environment variables
40
+
41
+ | Variable | Usage
42
+ | --- | --- |
43
+
44
+ ## External tools dependencies
45
+
46
+ None