hybrid_platforms_conductor 32.18.0 → 33.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +3 -3
  4. data/docs/config_dsl.md +23 -1
  5. data/docs/executables.md +6 -7
  6. data/docs/executables/check-node.md +3 -3
  7. data/docs/executables/deploy.md +3 -3
  8. data/docs/executables/dump_nodes_json.md +3 -3
  9. data/docs/executables/test.md +3 -3
  10. data/docs/executables/topograph.md +3 -3
  11. data/docs/plugins.md +21 -0
  12. data/docs/plugins/secrets_reader/cli.md +31 -0
  13. data/docs/plugins/secrets_reader/thycotic.md +46 -0
  14. data/lib/hybrid_platforms_conductor/deployer.rb +96 -36
  15. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb +75 -0
  16. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample +46 -0
  17. data/lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb +87 -0
  18. data/lib/hybrid_platforms_conductor/plugins.rb +1 -0
  19. data/lib/hybrid_platforms_conductor/secrets_reader.rb +31 -0
  20. data/lib/hybrid_platforms_conductor/version.rb +1 -1
  21. data/spec/hybrid_platforms_conductor_test.rb +5 -0
  22. data/spec/hybrid_platforms_conductor_test/api/deployer/config_dsl_spec.rb +22 -0
  23. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb +63 -0
  24. data/spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb +253 -0
  25. data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +0 -182
  26. data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +249 -13
  27. data/spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb +45 -0
  28. metadata +13 -2
@@ -0,0 +1,45 @@
1
+ require 'hybrid_platforms_conductor/secrets_reader'
2
+
3
+ module HybridPlatformsConductorTest
4
+
5
+ # Mock a secrets reader plugin
6
+ class TestSecretsReaderPlugin < HybridPlatformsConductor::SecretsReader
7
+
8
+ class << self
9
+ attr_accessor :calls
10
+ attr_accessor :deployer
11
+ attr_accessor :mocked_secrets
12
+ end
13
+
14
+ # Return secrets for a given service to be deployed on a node.
15
+ # [API] - This method is mandatory
16
+ # [API] - The following API components are accessible:
17
+ # * *@config* (Config): Main configuration API.
18
+ # * *@cmd_runner* (CmdRunner): Command Runner API.
19
+ # * *@nodes_handler* (NodesHandler): Nodes handler API.
20
+ #
21
+ # Parameters::
22
+ # * *node* (String): Node to be deployed
23
+ # * *service* (String): Service to be deployed
24
+ # Result::
25
+ # * Hash: The secrets
26
+ def secrets_for(node, service)
27
+ # Get the name by looking into the plugins' map
28
+ plugin_name, _plugin = TestSecretsReaderPlugin.deployer.instance_variable_get(:@secrets_readers).find { |plugin_name, plugin| plugin == self }
29
+ TestSecretsReaderPlugin.calls << {
30
+ instance: plugin_name,
31
+ node: node,
32
+ service: service
33
+ }
34
+ TestSecretsReaderPlugin.mocked_secrets.dig(node, service, plugin_name) || {
35
+ node => {
36
+ service => {
37
+ plugin_name.to_s => 'Secret value'
38
+ }
39
+ }
40
+ }
41
+ end
42
+
43
+ end
44
+
45
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hybrid_platforms_conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 32.18.0
4
+ version: 33.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muriel Salvan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: range_operators
@@ -398,6 +398,8 @@ extra_rdoc_files:
398
398
  - docs/plugins/action/remote_bash.md
399
399
  - docs/plugins/action/ruby.md
400
400
  - docs/plugins/action/bash.md
401
+ - docs/plugins/secrets_reader/cli.md
402
+ - docs/plugins/secrets_reader/thycotic.md
401
403
  - docs/plugins/cmdb/host_ip.md
402
404
  - docs/plugins/cmdb/config.md
403
405
  - docs/plugins/cmdb/platform_handlers.md
@@ -543,6 +545,8 @@ files:
543
545
  - docs/plugins/report/confluence.md
544
546
  - docs/plugins/report/mediawiki.md
545
547
  - docs/plugins/report/stdout.md
548
+ - docs/plugins/secrets_reader/cli.md
549
+ - docs/plugins/secrets_reader/thycotic.md
546
550
  - docs/plugins/test/bitbucket_conf.md
547
551
  - docs/plugins/test/can_be_checked.md
548
552
  - docs/plugins/test/check_deploy_and_idempotence.md
@@ -699,6 +703,9 @@ files:
699
703
  - lib/hybrid_platforms_conductor/hpc_plugins/report/my_report_plugin.rb.sample
700
704
  - lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb
701
705
  - lib/hybrid_platforms_conductor/hpc_plugins/report/templates/confluence_inventory.html.erb
706
+ - lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/cli.rb
707
+ - lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/my_secrets_reader_plugin.rb.sample
708
+ - lib/hybrid_platforms_conductor/hpc_plugins/secrets_reader/thycotic.rb
702
709
  - lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb
703
710
  - lib/hybrid_platforms_conductor/hpc_plugins/test/can_be_checked.rb
704
711
  - lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb
@@ -749,6 +756,7 @@ files:
749
756
  - lib/hybrid_platforms_conductor/provisioner.rb
750
757
  - lib/hybrid_platforms_conductor/report.rb
751
758
  - lib/hybrid_platforms_conductor/reports_handler.rb
759
+ - lib/hybrid_platforms_conductor/secrets_reader.rb
752
760
  - lib/hybrid_platforms_conductor/services_handler.rb
753
761
  - lib/hybrid_platforms_conductor/test.rb
754
762
  - lib/hybrid_platforms_conductor/test_by_service.rb
@@ -809,6 +817,8 @@ files:
809
817
  - spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb
810
818
  - spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb
811
819
  - spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb
820
+ - spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/cli_spec.rb
821
+ - spec/hybrid_platforms_conductor_test/api/deployer/secrets_reader_plugins/thycotic_spec.rb
812
822
  - spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb
813
823
  - spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb
814
824
  - spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb
@@ -940,6 +950,7 @@ files:
940
950
  - spec/hybrid_platforms_conductor_test/test_plugins/platform.rb
941
951
  - spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb
942
952
  - spec/hybrid_platforms_conductor_test/test_provisioner.rb
953
+ - spec/hybrid_platforms_conductor_test/test_secrets_reader_plugin.rb
943
954
  - spec/hybrid_platforms_conductor_test/tests_report_plugin.rb
944
955
  - spec/spec_helper.rb
945
956
  - tools/check_md