hybrid_platforms_conductor 32.11.2 → 32.13.3

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 (199) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1121 -0
  3. data/LICENSE.md +31 -0
  4. data/README.md +402 -0
  5. data/bin/setup +1 -1
  6. data/docs/api.md +349 -0
  7. data/docs/config_dsl.md +315 -0
  8. data/docs/executables.md +226 -0
  9. data/docs/executables/check-node.md +155 -0
  10. data/docs/executables/deploy.md +198 -0
  11. data/docs/executables/dump_nodes_json.md +110 -0
  12. data/docs/executables/free_ips.md +93 -0
  13. data/docs/executables/free_veids.md +73 -0
  14. data/docs/executables/get_impacted_nodes.md +94 -0
  15. data/docs/executables/last_deploys.md +114 -0
  16. data/docs/executables/nodes_to_deploy.md +139 -0
  17. data/docs/executables/report.md +159 -0
  18. data/docs/executables/run.md +126 -0
  19. data/docs/executables/setup.md +92 -0
  20. data/docs/executables/ssh_config.md +151 -0
  21. data/docs/executables/test.md +213 -0
  22. data/docs/executables/topograph.md +139 -0
  23. data/docs/gen/mermaid/README.md-0.png +0 -0
  24. data/docs/gen/mermaid/docs/executables/check-node.md-0.png +0 -0
  25. data/docs/gen/mermaid/docs/executables/deploy.md-0.png +0 -0
  26. data/docs/gen/mermaid/docs/executables/free_ips.md-0.png +0 -0
  27. data/docs/gen/mermaid/docs/executables/free_veids.md-0.png +0 -0
  28. data/docs/gen/mermaid/docs/executables/get_impacted_nodes.md-0.png +0 -0
  29. data/docs/gen/mermaid/docs/executables/last_deploys.md-0.png +0 -0
  30. data/docs/gen/mermaid/docs/executables/nodes_to_deploy.md-0.png +0 -0
  31. data/docs/gen/mermaid/docs/executables/report.md-0.png +0 -0
  32. data/docs/gen/mermaid/docs/executables/run.md-0.png +0 -0
  33. data/docs/gen/mermaid/docs/executables/setup.md-0.png +0 -0
  34. data/docs/gen/mermaid/docs/executables/ssh_config.md-0.png +0 -0
  35. data/docs/gen/mermaid/docs/executables/test.md-0.png +0 -0
  36. data/docs/install.md +161 -0
  37. data/docs/plugins.md +215 -0
  38. data/docs/plugins/action/bash.md +37 -0
  39. data/docs/plugins/action/interactive.md +37 -0
  40. data/docs/plugins/action/remote_bash.md +67 -0
  41. data/docs/plugins/action/ruby.md +69 -0
  42. data/docs/plugins/action/scp.md +61 -0
  43. data/docs/plugins/cmdb/config.md +46 -0
  44. data/docs/plugins/cmdb/host_ip.md +33 -0
  45. data/docs/plugins/cmdb/host_keys.md +33 -0
  46. data/docs/plugins/cmdb/platform_handlers.md +33 -0
  47. data/docs/plugins/connector/local.md +28 -0
  48. data/docs/plugins/connector/ssh.md +95 -0
  49. data/docs/plugins/platform_handler/yaml_inventory.md +105 -0
  50. data/docs/plugins/provisioner/docker.md +27 -0
  51. data/docs/plugins/provisioner/podman.md +27 -0
  52. data/docs/plugins/provisioner/proxmox.md +115 -0
  53. data/docs/plugins/report/confluence.md +49 -0
  54. data/docs/plugins/report/mediawiki.md +28 -0
  55. data/docs/plugins/report/stdout.md +32 -0
  56. data/docs/plugins/test/bitbucket_conf.md +97 -0
  57. data/docs/plugins/test/can_be_checked.md +27 -0
  58. data/docs/plugins/test/check_deploy_and_idempotence.md +61 -0
  59. data/docs/plugins/test/check_from_scratch.md +28 -0
  60. data/docs/plugins/test/connection.md +27 -0
  61. data/docs/plugins/test/deploy_freshness.md +27 -0
  62. data/docs/plugins/test/deploy_from_scratch.md +28 -0
  63. data/docs/plugins/test/deploy_removes_root_access.md +29 -0
  64. data/docs/plugins/test/divergence.md +41 -0
  65. data/docs/plugins/test/executables.md +26 -0
  66. data/docs/plugins/test/file_system.md +49 -0
  67. data/docs/plugins/test/file_system_hdfs.md +65 -0
  68. data/docs/plugins/test/hostname.md +27 -0
  69. data/docs/plugins/test/idempotence.md +56 -0
  70. data/docs/plugins/test/ip.md +28 -0
  71. data/docs/plugins/test/jenkins_ci_conf.md +54 -0
  72. data/docs/plugins/test/jenkins_ci_masters_ok.md +54 -0
  73. data/docs/plugins/test/linear_strategy.md +26 -0
  74. data/docs/plugins/test/local_users.md +48 -0
  75. data/docs/plugins/test/mounts.md +55 -0
  76. data/docs/plugins/test/orphan_files.md +38 -0
  77. data/docs/plugins/test/ports.md +50 -0
  78. data/docs/plugins/test/private_ips.md +27 -0
  79. data/docs/plugins/test/public_ips.md +27 -0
  80. data/docs/plugins/test/spectre.md +26 -0
  81. data/docs/plugins/test/veids.md +27 -0
  82. data/docs/plugins/test/vulnerabilities.md +65 -0
  83. data/docs/plugins/test_report/confluence.md +43 -0
  84. data/docs/plugins/test_report/stdout.md +26 -0
  85. data/docs/plugins_create.md +135 -0
  86. data/docs/tutorial.md +61 -0
  87. data/docs/tutorial/01_installation.md +131 -0
  88. data/docs/tutorial/02_first_node.md +468 -0
  89. data/docs/tutorial/03_scale.md +878 -0
  90. data/docs/tutorial/04_test.md +977 -0
  91. data/docs/tutorial/05_extend_with_plugins.md +1132 -0
  92. data/examples/bare/Gemfile +4 -0
  93. data/examples/bare/hpc_config.rb +2 -0
  94. data/examples/localhost/Gemfile +4 -0
  95. data/examples/localhost/hpc_config.rb +2 -0
  96. data/examples/localhost/inventory.yaml +4 -0
  97. data/examples/tutorial/01_installation/my-platforms/Gemfile +3 -0
  98. data/examples/tutorial/01_installation/my-platforms/hpc_config.rb +0 -0
  99. data/examples/tutorial/02_first_node/my-platforms/Gemfile +3 -0
  100. data/examples/tutorial/02_first_node/my-platforms/hpc_config.rb +1 -0
  101. data/examples/tutorial/02_first_node/my-service-conf-repo/inventory.yaml +13 -0
  102. data/examples/tutorial/02_first_node/my-service-conf-repo/my-service.conf.erb +3 -0
  103. data/examples/tutorial/02_first_node/my-service-conf-repo/service_my-service.rb +58 -0
  104. data/examples/tutorial/02_first_node/node/my-service.conf +4 -0
  105. data/examples/tutorial/03_scale/my-platforms/Gemfile +3 -0
  106. data/examples/tutorial/03_scale/my-platforms/hpc_config.rb +1 -0
  107. data/examples/tutorial/03_scale/my-platforms/my_commands.bash +2 -0
  108. data/examples/tutorial/03_scale/my-service-conf-repo/inventory.yaml +90 -0
  109. data/examples/tutorial/03_scale/my-service-conf-repo/my-service.conf.erb +3 -0
  110. data/examples/tutorial/03_scale/my-service-conf-repo/service_my-service.rb +58 -0
  111. data/examples/tutorial/03_scale/my-service-conf-repo/service_web-hello.rb +43 -0
  112. data/examples/tutorial/03_scale/node/my-service.conf +4 -0
  113. data/examples/tutorial/03_scale/web_docker_image/Dockerfile +33 -0
  114. data/examples/tutorial/03_scale/web_docker_image/hello_world.txt +1 -0
  115. data/examples/tutorial/03_scale/web_docker_image/hpc_root.key +27 -0
  116. data/examples/tutorial/03_scale/web_docker_image/hpc_root.key.pub +1 -0
  117. data/examples/tutorial/03_scale/web_docker_image/main.go +43 -0
  118. data/examples/tutorial/03_scale/web_docker_image/start.sh +7 -0
  119. data/examples/tutorial/03_scale/web_docker_image/test.bash +6 -0
  120. data/examples/tutorial/04_test/my-platforms/Gemfile +3 -0
  121. data/examples/tutorial/04_test/my-platforms/hpc_config.rb +12 -0
  122. data/examples/tutorial/04_test/my-platforms/images/debian_10/Dockerfile +13 -0
  123. data/examples/tutorial/04_test/my-platforms/my_commands.bash +2 -0
  124. data/examples/tutorial/04_test/my-service-conf-repo/inventory.yaml +100 -0
  125. data/examples/tutorial/04_test/my-service-conf-repo/my-service.conf.erb +3 -0
  126. data/examples/tutorial/04_test/my-service-conf-repo/service_my-service.rb +58 -0
  127. data/examples/tutorial/04_test/my-service-conf-repo/service_web-hello.rb +43 -0
  128. data/examples/tutorial/04_test/node/my-service.conf +4 -0
  129. data/examples/tutorial/04_test/web_docker_image/Dockerfile +33 -0
  130. data/examples/tutorial/04_test/web_docker_image/hello_world.txt +1 -0
  131. data/examples/tutorial/04_test/web_docker_image/hpc_root.key +27 -0
  132. data/examples/tutorial/04_test/web_docker_image/hpc_root.key.pub +1 -0
  133. data/examples/tutorial/04_test/web_docker_image/main.go +43 -0
  134. data/examples/tutorial/04_test/web_docker_image/start.sh +7 -0
  135. data/examples/tutorial/04_test/web_docker_image/test.bash +6 -0
  136. data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/hosts.json +12 -0
  137. data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-gcc.bash +14 -0
  138. data/examples/tutorial/05_extend_with_plugins/dev-servers-conf-repo/install-python.bash +14 -0
  139. data/examples/tutorial/05_extend_with_plugins/dev_docker_image/Dockerfile +20 -0
  140. data/examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key +27 -0
  141. data/examples/tutorial/05_extend_with_plugins/dev_docker_image/hpc_root.key.pub +1 -0
  142. data/examples/tutorial/05_extend_with_plugins/my-platforms/Gemfile +4 -0
  143. data/examples/tutorial/05_extend_with_plugins/my-platforms/hpc_config.rb +13 -0
  144. data/examples/tutorial/05_extend_with_plugins/my-platforms/images/debian_10/Dockerfile +13 -0
  145. data/examples/tutorial/05_extend_with_plugins/my-platforms/my_commands.bash +2 -0
  146. data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/inventory.yaml +100 -0
  147. data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/my-service.conf.erb +3 -0
  148. data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_my-service.rb +58 -0
  149. data/examples/tutorial/05_extend_with_plugins/my-service-conf-repo/service_web-hello.rb +43 -0
  150. data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/platform_handler/json_bash.rb +115 -0
  151. data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/report/web_report.rb +52 -0
  152. data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/lib/my_hpc_plugins/hpc_plugins/test/root_space.rb +44 -0
  153. data/examples/tutorial/05_extend_with_plugins/my_hpc_plugins/my_hpc_plugins.gemspec +15 -0
  154. data/examples/tutorial/05_extend_with_plugins/node/my-service.conf +4 -0
  155. data/examples/tutorial/05_extend_with_plugins/web_docker_image/Dockerfile +33 -0
  156. data/examples/tutorial/05_extend_with_plugins/web_docker_image/hello_world.txt +1 -0
  157. data/examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key +27 -0
  158. data/examples/tutorial/05_extend_with_plugins/web_docker_image/hpc_root.key.pub +1 -0
  159. data/examples/tutorial/05_extend_with_plugins/web_docker_image/main.go +43 -0
  160. data/examples/tutorial/05_extend_with_plugins/web_docker_image/start.sh +7 -0
  161. data/examples/tutorial/05_extend_with_plugins/web_docker_image/test.bash +6 -0
  162. data/lib/hybrid_platforms_conductor/actions_executor.rb +1 -0
  163. data/lib/hybrid_platforms_conductor/deployer.rb +3 -2
  164. data/lib/hybrid_platforms_conductor/hpc_plugins/action/remote_bash.rb +29 -13
  165. data/lib/hybrid_platforms_conductor/hpc_plugins/action/scp.rb +1 -1
  166. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/local.rb +98 -0
  167. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/my_connector.rb.sample +2 -2
  168. data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +15 -4
  169. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/platform_handler_plugin.rb.sample +5 -5
  170. data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/yaml_inventory.rb +140 -0
  171. data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +6 -3
  172. data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +4 -4
  173. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +1 -1
  174. data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +19 -17
  175. data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +3 -0
  176. data/lib/hybrid_platforms_conductor/hpc_plugins/test/hostname.rb +2 -1
  177. data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +2 -1
  178. data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +2 -1
  179. data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +4 -3
  180. data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +2 -1
  181. data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +1 -1
  182. data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +8 -7
  183. data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +1 -1
  184. data/lib/hybrid_platforms_conductor/json_dumper.rb +1 -1
  185. data/lib/hybrid_platforms_conductor/platform_handler.rb +1 -1
  186. data/lib/hybrid_platforms_conductor/services_handler.rb +18 -16
  187. data/lib/hybrid_platforms_conductor/tests_runner.rb +0 -1
  188. data/lib/hybrid_platforms_conductor/topographer.rb +0 -1
  189. data/lib/hybrid_platforms_conductor/version.rb +1 -1
  190. data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +16 -0
  191. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/connectable_nodes_spec.rb +30 -0
  192. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/local/remote_actions_spec.rb +113 -0
  193. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +6 -2
  194. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +38 -1
  195. data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +37 -4
  196. data/spec/hybrid_platforms_conductor_test/docs_spec.rb +10 -0
  197. data/tools/check_md +89 -0
  198. data/tools/generate_mermaid +75 -0
  199. metadata +337 -12
@@ -0,0 +1,159 @@
1
+ # `report`
2
+
3
+ The `report` executable will produce some reports for a list of nodes, using a given format and locale.
4
+ This executable is using [report plugins](../plugins.md#report) so that the tool is easily extensible to any format or locale needed (think of CSV, Excel, DNS configuration files, other configuration management tools...).
5
+
6
+ ## Process
7
+
8
+ <!-- Mermaid generator - Section start -->
9
+ ![Mermaid diagram](/docs/gen/mermaid/docs/executables/report.md-0.png)
10
+ <details>
11
+ <summary><sub><sup>Diagram code</sup></sub></summary>
12
+
13
+ ```mermaid
14
+ sequenceDiagram
15
+ participant Main as ./bin/report
16
+ participant Report as Report
17
+ participant CMDB as CMDB
18
+
19
+ Main->>+Report: Produce a report for selected nodes
20
+ Report->>+CMDB: Get metadata to be reported for nodes
21
+ CMDB-->>-Report: Nodes' metadata
22
+ Report->>-Main: Report produced
23
+ ```
24
+ </details>
25
+ <!-- Mermaid generator - Section end -->
26
+
27
+ ## Usage
28
+
29
+ ```
30
+ Usage: ./bin/report [options]
31
+
32
+ Main options:
33
+ -d, --debug Activate debug mode
34
+ -h, --help Display help and exit
35
+
36
+ Nodes handler options:
37
+ -o, --show-nodes Display the list of possible nodes and exit
38
+
39
+ Nodes selection options:
40
+ -a, --all-nodes Select all nodes
41
+ -b, --nodes-platform PLATFORM Select nodes belonging to a given platform name. Available platforms are: ansible-repo, chef-repo (can be used several times)
42
+ -l, --nodes-list LIST Select nodes defined in a nodes list (can be used several times)
43
+ -n, --node NODE Select a specific node. Can be a regular expression to select several nodes if used with enclosing "/" characters. (can be used several times).
44
+ -r, --nodes-service SERVICE Select nodes implementing a given service (can be used several times)
45
+ --nodes-git-impact GIT_IMPACT
46
+ Select nodes impacted by a git diff from a platform (can be used several times).
47
+ GIT_IMPACT has the format PLATFORM:FROM_COMMIT:TO_COMMIT:FLAGS
48
+ * PLATFORM: Name of the platform to check git diff from. Available platforms are: ansible-repo, chef-repo
49
+ * FROM_COMMIT: Commit ID or refspec from which we perform the diff. If ommitted, defaults to master
50
+ * TO_COMMIT: Commit ID ot refspec to which we perform the diff. If ommitted, defaults to the currently checked-out files
51
+ * FLAGS: Extra comma-separated flags. The following flags are supported:
52
+ - min: If specified then each impacted service will select only 1 node implementing this service. If not specified then all nodes implementing the impacted services will be selected.
53
+
54
+ Command runner options:
55
+ -s, --show-commands Display the commands that would be run instead of running them
56
+
57
+ Reports handler options:
58
+ -c, --locale LOCALE_CODE Generate the report in the given format. Possible codes are formats specific. [confluence: en], [stdout: en], [mediawiki: en]
59
+ -f, --format FORMAT Generate the report in the given format. Possible formats are confluence, mediawiki, stdout. Default: stdout.
60
+ ```
61
+
62
+ ## Examples
63
+
64
+ ```bash
65
+ # Output all nodes info using mediawiki format
66
+ ./bin/report --format mediawiki
67
+
68
+ # Output all nodes info using mediawiki format in en locale
69
+ ./bin/report --format mediawiki --locale en
70
+
71
+ # Output all nodes containing /xae/ in their names using mediawiki format
72
+ ./bin/report --node /xae/ --format mediawiki
73
+ ```
74
+
75
+ Example of output:
76
+ ```
77
+ => ./bin/report --format mediawiki
78
+ Back to the [[Hadoop]] / [[Impala]] / [[XAE_Network_Topology]] portal pages
79
+
80
+ This page has been generated using <code>./helpers/report --format mediawiki</code> on 2018-03-26 08:58:55 UTC.
81
+
82
+ = Physical nodes =
83
+
84
+ == Independent nodes ==
85
+
86
+ === 172.16.0/24 ===
87
+
88
+ * '''WinNode''' - 172.16.0.140 - AD of QlikSense Server (primary AD of Production) - WinNode
89
+ : Handled by Chef: No
90
+ : Server type: Virtual Machine on node456.my_domain.com.
91
+
92
+
93
+ * '''WinNode''' - 172.16.0.141 - AD of QlikSense Server (secondary AD of Production) - WinNode
94
+ : Handled by Chef: No
95
+ : Server type: Virtual Machine on node456.my_domain.com.
96
+
97
+
98
+ * '''node237''' - 172.16.0.9 - Gateway to Dedicated Cloud (Former Tableau 8) - node237.my_domain.com
99
+ : Handled by Chef: No
100
+ : Location: RBX
101
+ : OS: Windows Server 2008
102
+ : XAE IP: 192.168.255.159
103
+ : Public IPs:
104
+ ::* 192.168.255.159
105
+
106
+ [...]
107
+
108
+ === 172.16.139/24 ===
109
+
110
+ * '''node12lnx09''' - 172.16.139.98 - Data Processing (Gurobi, GPU, RStudio)
111
+ : OS: Debian 7
112
+
113
+
114
+ === 172.30.14/24 ===
115
+
116
+ * '''node''' - 172.30.14.226 - ADP gateway in my_platform IaaS
117
+ : OS: RHEL 7 ADP Stadard
118
+
119
+
120
+ === 192.168.0/24 ===
121
+
122
+ * '''project-pinger''' - 192.168.0.2 - Product availability tester
123
+ : Connection settings:
124
+ ::* ip: 192.168.0.77
125
+ : Direct deployment: Yes
126
+ : Public IPs:
127
+ ::* 192.168.0.77
128
+
129
+
130
+ Back to the [[Hadoop]] / [[Impala]] / [[XAE_Network_Topology]] portal pages
131
+
132
+ [[Category:My Project]]
133
+ [[Category:Hadoop]]
134
+ [[Category:NoSQL]]
135
+ [[Category:Hosting]]
136
+ [[Category:XAE]]
137
+ [[Category:Server]]
138
+ [[Category:Configuration]]
139
+ [[Category:Chef]]
140
+ ```
141
+
142
+ ## Used credentials
143
+
144
+ | Credential | Usage
145
+ | --- | --- |
146
+
147
+ ## Used Metadata
148
+
149
+ | Metadata | Type | Usage
150
+ | --- | --- | --- |
151
+
152
+ ## Used environment variables
153
+
154
+ | Variable | Usage
155
+ | --- | --- |
156
+
157
+ ## External tools dependencies
158
+
159
+ None
@@ -0,0 +1,126 @@
1
+ # `run`
2
+
3
+ The `run` executable will run any Bash command (or interactive session) remotely on a node (or list of nodes).
4
+ It will use connectors (SSH...) to do so.
5
+
6
+ ## Process
7
+
8
+ <!-- Mermaid generator - Section start -->
9
+ ![Mermaid diagram](/docs/gen/mermaid/docs/executables/run.md-0.png)
10
+ <details>
11
+ <summary><sub><sup>Diagram code</sup></sub></summary>
12
+
13
+ ```mermaid
14
+ sequenceDiagram
15
+ participant Main as ./bin/run --node my_node --command "echo Hello"
16
+ participant Connector as Connector
17
+ participant Node as Provisioned node (my_node)
18
+
19
+ Main->>+Connector: Connect to my_node to execute actions
20
+ Connector->>+Node: Execute bash command on my_node
21
+ Node-->>-Connector: stdout of bash execution
22
+ Connector-->>-Main: Close connection
23
+ ```
24
+ </details>
25
+ <!-- Mermaid generator - Section end -->
26
+
27
+ ## Usage
28
+
29
+ ```
30
+ Usage: ./bin/run [options]
31
+
32
+ Main options:
33
+ -d, --debug Activate debug mode
34
+ -h, --help Display help and exit
35
+ -c, --command CMD Command to execute (can't be used with --interactive) (can be used several times, commands will be executed sequentially)
36
+ -f, --commands-file FILE_NAME Execute commands taken from a file (can't be used with --interactive) (can be used several times, commands will be executed sequentially)
37
+ -i, --interactive Run an interactive SSH session instead of executing a command (can't be used with --command or --commands-file)
38
+ -p, --parallel Execute the commands in parallel (put the standard output in files <hybrid-platforms-dir>/run_logs/*.stdout)
39
+ -t, --timeout SECS Timeout in seconds to wait for each command (defaults to no timeout)
40
+
41
+ Nodes handler options:
42
+ -o, --show-nodes Display the list of possible nodes and exit
43
+
44
+ Nodes selection options:
45
+ -a, --all-nodes Select all nodes
46
+ -b, --nodes-platform PLATFORM Select nodes belonging to a given platform name. Available platforms are: ansible-repo, chef-repo (can be used several times)
47
+ -l, --nodes-list LIST Select nodes defined in a nodes list (can be used several times)
48
+ -n, --node NODE Select a specific node. Can be a regular expression to select several nodes if used with enclosing "/" characters. (can be used several times).
49
+ -r, --nodes-service SERVICE Select nodes implementing a given service (can be used several times)
50
+ --nodes-git-impact GIT_IMPACT
51
+ Select nodes impacted by a git diff from a platform (can be used several times).
52
+ GIT_IMPACT has the format PLATFORM:FROM_COMMIT:TO_COMMIT:FLAGS
53
+ * PLATFORM: Name of the platform to check git diff from. Available platforms are: ansible-repo, chef-repo
54
+ * FROM_COMMIT: Commit ID or refspec from which we perform the diff. If ommitted, defaults to master
55
+ * TO_COMMIT: Commit ID ot refspec to which we perform the diff. If ommitted, defaults to the currently checked-out files
56
+ * FLAGS: Extra comma-separated flags. The following flags are supported:
57
+ - min: If specified then each impacted service will select only 1 node implementing this service. If not specified then all nodes implementing the impacted services will be selected.
58
+
59
+ Command runner options:
60
+ -s, --show-commands Display the commands that would be run instead of running them
61
+
62
+ Actions Executor options:
63
+ -m, --max-threads NBR Set the number of threads to use for concurrent queries (defaults to 16)
64
+
65
+ Connector ssh options:
66
+ -g, --ssh-gateway-user USER Name of the gateway user to be used by the gateways. Can also be set from environment variable hpc_ssh_gateway_user. Defaults to ubradm.
67
+ -j, --ssh-no-control-master If used, don't create SSH control masters for connections.
68
+ -q, --ssh-no-host-key-checking If used, don't check for SSH host keys.
69
+ -u, --ssh-user USER Name of user to be used in SSH connections (defaults to hpc_ssh_user or USER environment variables)
70
+ -w, --password If used, then expect SSH connections to ask for a password.
71
+ -y GATEWAYS_CONF, Name of the gateways configuration to be used. Can also be set from environment variable hpc_ssh_gateways_conf.
72
+ --ssh-gateways-conf
73
+ ```
74
+
75
+ ## Examples
76
+
77
+ ```bash
78
+ # Display the possible nodes we can run commands on (also outputs the possible nodes lists, services...)
79
+ ./bin/run --show-nodes
80
+
81
+ # Run an interactive SSH session on node23hst-nn1
82
+ ./bin/run --node node23hst-nn1 --interactive
83
+
84
+ # Run the hostname command on node23hst-nn1
85
+ ./bin/run --node node23hst-nn1 --command hostname
86
+
87
+ # Run the hostname and ls commands on node23hst-nn1
88
+ ./bin/run --node node23hst-nn1 --command hostname --command ls
89
+
90
+ # Run a list of commands (taken from the file cmds.list) on node23hst-nn1
91
+ ./bin/run --node node23hst-nn1 --commands-file cmds.list
92
+
93
+ # Run a list of commands (taken from the file cmds.list) and the hostname command on node23hst-nn1
94
+ ./bin/run --node node23hst-nn1 --commands-file cmds.list --command hostname
95
+
96
+ # Run the hostname command on node23hst-nn1 with a timeout of 5 seconds that would interrupt the command if it does not end before
97
+ ./bin/run --node node23hst-nn1 --command hostname --timeout 5
98
+
99
+ # Run the hostname command on all nodes containing xae in parallel (and send each standard output in log files in ./run_logs/*.stdout)
100
+ ./bin/run --node /xae/ --command hostname --parallel
101
+ ```
102
+
103
+ Example of output:
104
+ ```
105
+ => ./bin/run --node node12had01 --command hostname
106
+ node12host.site.my_company.net
107
+ ```
108
+
109
+ ## Used credentials
110
+
111
+ | Credential | Usage
112
+ | --- | --- |
113
+
114
+ ## Used Metadata
115
+
116
+ | Metadata | Type | Usage
117
+ | --- | --- | --- |
118
+
119
+ ## Used environment variables
120
+
121
+ | Variable | Usage
122
+ | --- | --- |
123
+
124
+ ## External tools dependencies
125
+
126
+ None
@@ -0,0 +1,92 @@
1
+ # `setup`
2
+
3
+ The `setup` executable installs all dependencies needed for a platform to be operated by Hybrid Platforms Conductor.
4
+ It is intended to be run only for the initial setup or when such dependencies change (for example if a `Gemfile` of a `chef` platform changes).
5
+
6
+ ***This executable is still in alpha version: not properly tested, no clear process, no stable interface. Pending [this ticket](https://github.com/sweet-delights/hybrid-platforms-conductor/issues/45).***
7
+
8
+ ## Process
9
+
10
+ <!-- Mermaid generator - Section start -->
11
+ ![Mermaid diagram](/docs/gen/mermaid/docs/executables/setup.md-0.png)
12
+ <details>
13
+ <summary><sub><sup>Diagram code</sup></sub></summary>
14
+
15
+ ```mermaid
16
+ sequenceDiagram
17
+ participant Main as ./bin/setup
18
+ participant PlatformHandler as Platform Handler
19
+
20
+ Main->>+PlatformHandler: Install dependencies for each platform
21
+ PlatformHandler-->>-Main: Dependencies installed
22
+ ```
23
+ </details>
24
+ <!-- Mermaid generator - Section end -->
25
+
26
+ ## Usage
27
+
28
+ ```
29
+ Usage: ./bin/setup [options]
30
+
31
+ Main options:
32
+ -d, --debug Activate debug mode
33
+ -h, --help Display help and exit
34
+
35
+ Nodes handler options:
36
+ -o, --show-nodes Display the list of possible nodes and exit
37
+
38
+ Command runner options:
39
+ -s, --show-commands Display the commands that would be run instead of running them
40
+ ```
41
+
42
+ ## Examples
43
+
44
+ ```bash
45
+ # Setup all declared platforms
46
+ ./bin/setup
47
+ ```
48
+
49
+ Here is an example of output:
50
+ ```
51
+ => ./bin/setup
52
+ cd ../chef-repo && rm -rf Gemfile.lock vendor && bundle install --path vendor/bundle --binstubs
53
+ Fetching gem metadata from http://rubygems.org/........
54
+ Fetching gem metadata from http://rubygems.org/.
55
+ Resolving dependencies....
56
+ Fetching rake 12.3.1
57
+ Installing rake 12.3.1
58
+ [...]
59
+ Bundle complete! 12 Gemfile dependencies, 101 gems now installed.
60
+ Bundled gems are installed into `./vendor/bundle`
61
+ Post-install message from minitar:
62
+ The `minitar` executable is no longer bundled with `minitar`. If you are
63
+ expecting this executable, make sure you also install `minitar-cli`.
64
+ cd ./cloned_platforms/xae-chef-repo && rm -rf Gemfile.lock vendor && bundle install --path vendor/bundle --binstubs
65
+ Fetching gem metadata from http://rubygems.org/........
66
+ Fetching gem metadata from http://rubygems.org/.
67
+ Resolving dependencies....
68
+ Fetching rake 12.3.1
69
+ Installing rake 12.3.1
70
+ [...]
71
+ Bundle complete! 9 Gemfile dependencies, 98 gems now installed.
72
+ Bundled gems are installed into `./vendor/bundle`
73
+ ```
74
+
75
+ ## Used credentials
76
+
77
+ | Credential | Usage
78
+ | --- | --- |
79
+
80
+ ## Used Metadata
81
+
82
+ | Metadata | Type | Usage
83
+ | --- | --- | --- |
84
+
85
+ ## Used environment variables
86
+
87
+ | Variable | Usage
88
+ | --- | --- |
89
+
90
+ ## External tools dependencies
91
+
92
+ None
@@ -0,0 +1,151 @@
1
+ # `ssh_config`
2
+
3
+ The `ssh_config` executable will output (in standard output) an SSH config file ready to be used to address any node accessible using the [`ssh` connector](../plugins/connector/ssh.md).
4
+ The configuration also includes any proxy configuration needed.
5
+ The generated file can also be tuned by specifying the gateway user names to be used, and a path to a different ssh executable.
6
+
7
+ This executable is also used internally by other tools of Hybrid Platforms Conductor to prepare the SSH environment before executing SSH commands, so it's a good way to see and debug the SSH configuration used internally by the Hybrid Platform Conductor's processes.
8
+
9
+ ## Process
10
+
11
+ <!-- Mermaid generator - Section start -->
12
+ ![Mermaid diagram](/docs/gen/mermaid/docs/executables/ssh_config.md-0.png)
13
+ <details>
14
+ <summary><sub><sup>Diagram code</sup></sub></summary>
15
+
16
+ ```mermaid
17
+ sequenceDiagram
18
+ participant Main as ./bin/ssh_config
19
+ participant CMDB as CMDB
20
+ participant Connector as Connector
21
+ participant ConnectorSSH as Connector SSH
22
+
23
+ Main->>+CMDB: Get metadata of all nodes
24
+ CMDB->>-Main: Metadata
25
+ Main->>+Connector: Select nodes that are SSH-connectable from their metadata
26
+ Connector->>-Main: List of SSH-connectable nodes
27
+ Main->>+ConnectorSSH: Get the SSH config for selected nodes
28
+ ConnectorSSH-->>-Main: Display SSH config
29
+ ```
30
+ </details>
31
+ <!-- Mermaid generator - Section end -->
32
+
33
+ ## Usage
34
+
35
+ ```
36
+ Usage: ./bin/ssh_config [options]
37
+
38
+ Main options:
39
+ -d, --debug Activate debug mode
40
+ -h, --help Display help and exit
41
+ -x, --ssh-exec FILE_PATH Path to the SSH executable to be used. Useful to give default options (especially with GIT_SSH). Defaults to ssh.
42
+
43
+ Nodes handler options:
44
+ -o, --show-nodes Display the list of possible nodes and exit
45
+
46
+ Command runner options:
47
+ -s, --show-commands Display the commands that would be run instead of running them
48
+
49
+ Connector ssh options:
50
+ -g, --ssh-gateway-user USER Name of the gateway user to be used by the gateways. Can also be set from environment variable hpc_ssh_gateway_user. Defaults to ubradm.
51
+ -j, --ssh-no-control-master If used, don't create SSH control masters for connections.
52
+ -q, --ssh-no-host-key-checking If used, don't check for SSH host keys.
53
+ -u, --ssh-user USER Name of user to be used in SSH connections (defaults to hpc_ssh_user or USER environment variables)
54
+ -w, --password If used, then expect SSH connections to ask for a password.
55
+ -y GATEWAYS_CONF, Name of the gateways configuration to be used. Can also be set from environment variable hpc_ssh_gateways_conf.
56
+ --ssh-gateways-conf
57
+ ```
58
+
59
+ ## Examples
60
+
61
+ ```bash
62
+ # Dump in stdout
63
+ ./bin/ssh_config
64
+
65
+ # Use it to overwrite directly the SSH config file
66
+ ./bin/ssh_config >~/.ssh/config ; chmod 600 ~/.ssh/config
67
+
68
+ # Use it to generate a separate included config file (for OpenSSH version >= 7.3p1)
69
+ # Need to add "Include platforms_config" in the existing ~/.ssh/config file.
70
+ ./bin/ssh_config >~/.ssh/platforms_config
71
+
72
+ # Dump in stdout, using hadcli as gateway user
73
+ ./bin/ssh_config --ssh-gateway-user hadcli
74
+
75
+ # Dump in stdout, using /my/other/ssh instead of ssh
76
+ ./bin/ssh_config --ssh-exec /my/other/ssh
77
+
78
+ # Dump in stdout, using the madrid SSH gateways configuration
79
+ ./bin/ssh_config --ssh-gateways-conf madrid
80
+ ```
81
+
82
+ Example of output:
83
+ ```
84
+ => ./bin/ssh_config
85
+
86
+ ############
87
+ # GATEWAYS #
88
+ ############
89
+
90
+ # Gateway Nice (when connecting from other sites)
91
+ Host my.gateway.com
92
+ User sitegw
93
+ Hostname node12hst-nn5.site.my_company.net
94
+
95
+ # DMZ Gateway
96
+ Host gw.dmz.be
97
+ HostName dmz.my_domain.com
98
+ ProxyCommand ssh -q -W %h:%p my.gateway.com
99
+
100
+ # Data Gateway
101
+ Host gw.data.be
102
+ HostName fr-had.my_domain.com
103
+ ProxyCommand ssh -q -W %h:%p datagw@gw.dmz.be
104
+
105
+
106
+ #############
107
+ # ENDPOINTS #
108
+ #############
109
+
110
+ Host *
111
+ User a_usernme
112
+ # Default control socket path to be used when multiplexing SSH connections
113
+ ControlPath /tmp/actions_executor_mux_%h_%p_%r
114
+ PubkeyAcceptedKeyTypes +ssh-dss
115
+
116
+ # AD_Win2012_NP0 - 172.16.16.105 - ./cloned_platforms/xae-chef-repo - AD of QlikSense Server (primary AD of Non-production) - AD_Win2012_NP0
117
+ Host hpc.172.16.16.105 hpc.16.105 hpc.AD_Win2012_NP0
118
+ Hostname 172.16.16.105
119
+ ProxyCommand ssh -q -W %h:%p ubradm@gw.dmz.be
120
+
121
+ [...]
122
+
123
+ # xaetitanuwsd01 - 172.16.16.89 - ./cloned_platforms/xae-chef-repo - Traffic Analytics WS (UAT/jessie)
124
+ Host hpc.172.16.16.89 hpc.16.89 hpc.xaetitanuwsd01
125
+ Hostname 172.16.16.89
126
+ ProxyCommand ssh -q -W %h:%p ubradm@gw.dmz.be
127
+
128
+ # project-pinger - 192.168.0.2 - ../chef-repo - Product availability tester
129
+ Host hpc.192.168.0.2 hpc.project-pinger
130
+ Hostname 192.168.0.77
131
+
132
+ ```
133
+
134
+ ## Used credentials
135
+
136
+ | Credential | Usage
137
+ | --- | --- |
138
+
139
+ ## Used Metadata
140
+
141
+ | Metadata | Type | Usage
142
+ | --- | --- | --- |
143
+
144
+ ## Used environment variables
145
+
146
+ | Variable | Usage
147
+ | --- | --- |
148
+
149
+ ## External tools dependencies
150
+
151
+ None