sambot 0.1.197 → 0.1.198

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: ffe1d989549a35f6166b856dc83ff30d536e42c6
4
- data.tar.gz: 0cf41173f56f4adcfb88329d9ed58678a69c4d24
3
+ metadata.gz: e83a497801a896e26973a5da27bcd6ce504551d7
4
+ data.tar.gz: f6c08bb358361f8d07c0fd452785c67004abce60
5
5
  SHA512:
6
- metadata.gz: 643275e2af3e518eedcbd2d08a873de7454809c24c04c577968c18c625afaa49cb14c24b51acbfff28f97f2d6a4f4387601144f76d26ade1c75ed788f36df378
7
- data.tar.gz: eb1b4bcafa4fa4718b9672d4281b4e6d172bd42397fafd3083196c0bfc1f58addb81b2d2c922e598808e99be275c179b165398a68adcb80d31ae4e3fc0728bba
6
+ metadata.gz: 51cce94ee0fe4d09702768401fb3203684571ad7f79a2916d48855913c25ed8799d2810f81cdd60767dba839015d39c8570c925b7a63a90eff0819cd35c83c07
7
+ data.tar.gz: ad1f1bf1b03bd786178e2dd35db0be3334a877b082f778a98f291007ae66d814b0c75acc38c8b36d8686ad97ea35a3265df4c8805efc2157a3541ade7362088c
data/lib/sambot/cli.rb CHANGED
@@ -10,6 +10,30 @@ module Sambot
10
10
  execute { Chef::Cookbook.clean }
11
11
  end
12
12
 
13
+ desc 'up', 'Setup the Docker environment for testing cookbooks'
14
+ def up
15
+ execute do
16
+ `docker-compose -p chef up -d`
17
+ `chef exec sambot populate`
18
+ end
19
+ end
20
+
21
+ desc 'down', 'Destroy the Docker environment for testing cookbooks'
22
+ def down
23
+ execute do
24
+ `docker-compose down`
25
+ end
26
+ end
27
+
28
+ desc 'test', 'Test a cookbook using the Docker environment'
29
+ def down
30
+ execute do
31
+ `docker-compose -p chef up -d`
32
+ `chef exec sambot populate`
33
+ `docker-compose down`
34
+ end
35
+ end
36
+
13
37
  desc 'populate', 'Populates Vault and Consul with seed data'
14
38
  def populate
15
39
  execute do
@@ -69,7 +69,17 @@ $json = @"
69
69
  New-Item 'C:\ProgramData\vault' -ItemType Directory -Force
70
70
  Set-Content -Path 'C:\ProgramData\vault\tokens.json' -Value $json
71
71
 
72
- ###### TODO - NEED TO ADD GROUPS STUFF!!!!!
72
+ #################################################################################
73
+ # Create the 'vault-tokens' group so other services/applications apart from #
74
+ # 'root' can access the file. #
75
+ #################################################################################
76
+
77
+ $acl = Get-Acl 'C:\ProgramData\vault\tokens.json'
78
+ NET LOCALGROUP "vault-tokens" /add
79
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Administrators', 'FullControl', 'Allow')
80
+ $acl.SetAccessRule($ar)
81
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('vault-tokens', 'FullControl', 'Allow')
82
+ $acl.SetAccessRule($ar)
73
83
 
74
84
  #################################################################################
75
85
  # Get the real token from the wrapped token and store it in the #
@@ -53,8 +53,8 @@ $json = @"
53
53
  {
54
54
  "vault-addr": "$env:VAULT_ADDR",
55
55
  "skip-verify": true,
56
- "wrapped": "",
57
- "access": "$Token"
56
+ "wrapped": "$Token",
57
+ "access": ""
58
58
  }
59
59
  "@
60
60
 
@@ -65,3 +65,10 @@ Set-Content -Path 'C:\ProgramData\vault\tokens.json' -Value $json
65
65
  # Create the 'vault-tokens' group so other services/applications apart from #
66
66
  # 'root' can access the file. #
67
67
  #################################################################################
68
+
69
+ $acl = Get-Acl 'C:\ProgramData\vault\tokens.json'
70
+ NET LOCALGROUP "vault-tokens" /add
71
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Administrators', 'FullControl', 'Allow')
72
+ $acl.SetAccessRule($ar)
73
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('vault-tokens', 'FullControl', 'Allow')
74
+ $acl.SetAccessRule($ar)
@@ -83,7 +83,12 @@ Set-Content -Path 'C:\ProgramData\vault\tokens.json' -Value $json
83
83
  # 'root' can access the file. #
84
84
  #################################################################################
85
85
 
86
- ###### TODO - NEED TO ADD GROUPS STUFF!!!!!
86
+ $acl = Get-Acl 'C:\ProgramData\vault\tokens.json'
87
+ NET LOCALGROUP "vault-tokens" /add
88
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('Administrators', 'FullControl', 'Allow')
89
+ $acl.SetAccessRule($ar)
90
+ $ar = New-Object System.Security.AccessControl.FileSystemAccessRule('vault-tokens', 'FullControl', 'Allow')
91
+ $acl.SetAccessRule($ar)
87
92
 
88
93
  #################################################################################
89
94
  # Get the real token from the wrapped token and store it in the #
@@ -21,9 +21,3 @@ if [ $? -ne 0 ]; then
21
21
  echo "Failed when running Cookstyle. Aborting the Git push."
22
22
  exit 1
23
23
  fi
24
-
25
- chef exec sambot clean
26
- if [ $? -ne 0 ]; then
27
- echo "Failed when cleaning the cookbook. Aborting the Git push."
28
- exit 1
29
- fi
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.197'
4
+ VERSION = '0.1.198'
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.197
4
+ version: 0.1.198
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Kouame