sambot 0.1.225 → 0.1.226

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 181b34f8dc667713236f6eb5b977d4867b03dcb5
4
- data.tar.gz: 73117bd92de7f49725971cb1a1a71671f48852dd
3
+ metadata.gz: affbea566a85c539706f2cfd4631f0cc284fe180
4
+ data.tar.gz: 04e0a3981f427552ba2862c9cfdec0301e1155bc
5
5
  SHA512:
6
- metadata.gz: eb5c17af4f26acf78f6409965e524ae0959cedc09b5c96d5c8f23e8770cea813f0f91446895fb8286a7be195fc29b13c05b77046a9733fd3bdfea3f0290cfb4a
7
- data.tar.gz: 07f4af7a8f0bf13babb5293c4220543c0689490fe876871e414b9568c10ccac24d89a458af0e82e7ff7a1f5bc2f13009849c21911de175599c288dc26f921ede
6
+ metadata.gz: 12f8c11b2047fd44b983573a09112f6ac2c1a05bbb6f642ba3108ab64d0edacf1b5bf1d72f6538c837b1eee1e3a0c93403ed119667b57d569bdc2caa1d170943
7
+ data.tar.gz: 4fb72537af45b48ab69d5188bf6b2f85abf55e7d9fc584534c2578c3a75d4586026c313de509e16ee655f344f8a790c43e900de89a3134cd12cb9bd5c7a949ed
@@ -9,9 +9,12 @@ module Sambot
9
9
  no_commands do
10
10
 
11
11
  def run(options)
12
+ config = Config.read
13
+ #Sambot::Testing::DataBagsHelper.import_databags
12
14
  Sambot::Testing::VaultHelper.setup
13
- Sambot::Testing::VaultHelper.load_secrets(Config.read)
14
- Sambot::Testing::ConsulHelper.load_values(Config.read)
15
+ Sambot::Testing::VaultHelper.load_secrets(config)
16
+ Sambot::Testing::ConsulHelper.load_values(config)
17
+
15
18
  end
16
19
 
17
20
  end
@@ -34,6 +34,7 @@ yum install -y unzip wget
34
34
 
35
35
  if [ ! -d /etc/vault ]; then mkdir /etc/vault; fi
36
36
 
37
+ echo 'Creating /etc/vault/tokens.json'
37
38
  cat << EOF > /etc/vault/tokens.json
38
39
  {
39
40
  "vault-addr": "<%= ENV['GCP_VAULT_ADDR'] %>",
@@ -43,9 +44,11 @@ cat << EOF > /etc/vault/tokens.json
43
44
  }
44
45
  EOF
45
46
 
47
+ cat /etc/vault/tokens.json
48
+
49
+ echo 'Setting permissions on /etc/vault/tokens.json'
46
50
  groupadd -fg 9897 vault-tokens
47
51
  usermod -aG vault-tokens root
48
-
49
52
  chmod 0640 /etc/vault/tokens.json
50
53
  chown root:vault-tokens /etc/vault/tokens.json
51
54
 
@@ -53,6 +56,7 @@ chown root:vault-tokens /etc/vault/tokens.json
53
56
  # Install Advertising Studio's as-vault-tool binary. #
54
57
  #################################################################################
55
58
 
59
+ echo 'Installing the as-vault-tool binary'
56
60
  if [ ! -d /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %> ]; then
57
61
  mkdir -p /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>
58
62
  fi
@@ -64,4 +68,5 @@ unzip linux_amd64 -d /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/
64
68
  # tokens.json file. #
65
69
  #################################################################################
66
70
 
71
+ echo 'Running the as-vault-tool in order to unwrap the token'
67
72
  /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/as-vault-tool tokenrenew
File without changes
@@ -56,11 +56,12 @@ module Sambot
56
56
 
57
57
  def load_secrets(config, src = 'local_testing')
58
58
  UI.info('Reading secrets from the configuration file')
59
- if config.secrets.nil? || config.secrets.empty?
59
+ secrets = merge_wrapper_cookbook_secrets(config.dependencies, config.secrets)
60
+ if secrets.nil? || secrets.empty?
60
61
  UI.info('No secrets were found in the secrets configuration file')
61
62
  return 0
62
63
  else
63
- store_secrets(config.secrets, src)
64
+ store_secrets(secrets, src)
64
65
  end
65
66
  end
66
67
 
@@ -76,6 +77,10 @@ module Sambot
76
77
 
77
78
  private
78
79
 
80
+ def merge_wrapper_cookbook_secrets(dependencies, secrets)
81
+ secrets
82
+ end
83
+
79
84
  def store_secrets(secrets, src)
80
85
  counter = 0
81
86
  secrets.each do |secret|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.225'
4
+ VERSION = '0.1.226'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.225
4
+ version: 0.1.226
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Kouame
@@ -470,6 +470,7 @@ files:
470
470
  - lib/sambot/templates/vault-config
471
471
  - lib/sambot/templates/winrm_config
472
472
  - lib/sambot/testing/consul_helper.rb
473
+ - lib/sambot/testing/data_bags_helper.rb
473
474
  - lib/sambot/testing/fixtures.rb
474
475
  - lib/sambot/testing/vault_helper.rb
475
476
  - lib/sambot/ui.rb