sambot 0.1.137 → 0.1.138
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.
- checksums.yaml +4 -4
- data/lib/sambot/chef/cookbook.rb +2 -1
- data/lib/sambot/templates/.kitchen.gcp.yml.erb +3 -3
- data/lib/sambot/templates/Vagrantfile.erb +2 -2
- data/lib/sambot/templates/gcp_bootstrap.ps1.erb +28 -0
- data/lib/sambot/templates/gcp_bootstrap.sh.erb +19 -0
- data/lib/sambot/templates/{bootstrap.ps1 → local_bootstrap.ps1} +0 -0
- data/lib/sambot/templates/{bootstrap.sh → local_bootstrap.sh} +0 -0
- data/lib/sambot/version.rb +1 -1
- metadata +5 -4
- data/lib/sambot/templates/startup-script.ps1 +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cfc866ec66a95cbeea052093c2715fddd315ec0a
|
|
4
|
+
data.tar.gz: 02fb758ebf416f3ec07c9757519809137b329e76
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f26b250a995fed84b8494444938b1177d50a7a8b6c1d66f99664b25bb56f0d42e5bc426599409fb41b8b3f2fd175724cae361ce7fe42a24bf0e3c5b71217d1a
|
|
7
|
+
data.tar.gz: e8c9223e041d7b1d9657dff06af2333fe542daa627b16442c9468e76ae0e7df8985b52018001acb5a1d0b5778be2871b6267d6f07adbd4ee30234ebc7144e547
|
data/lib/sambot/chef/cookbook.rb
CHANGED
|
@@ -20,7 +20,8 @@ module Sambot
|
|
|
20
20
|
'.rubocop.yml': {eruby: false, dest: '.rubocop.yml', platform: [:windows, :centos]},
|
|
21
21
|
'.gitignore.sample': {eruby: false, dest: '.gitignore', platform: [:windows, :centos]},
|
|
22
22
|
'bootstrap.sh': {eruby: false, dest: 'bootstrap.sh', platform: [:centos]},
|
|
23
|
-
'
|
|
23
|
+
'gcp_bootstrap.sh.erb': {eruby: true, dest: 'gcp_bootstrap.sh', platform: [:centos]},
|
|
24
|
+
'bootstrap.ps1.er ': {eruby: true, dest: 'bootstrap.ps1', platform: [:windows]},
|
|
24
25
|
'Vagrantfile.erb': {eruby: false, dest: 'Vagrantfile.erb', platform: [:windows, :centos]},
|
|
25
26
|
'winrm_config': {eruby: false, dest: 'winrm_config', platform: [:windows]}
|
|
26
27
|
}
|
|
@@ -24,7 +24,7 @@ platforms:
|
|
|
24
24
|
preemptible: true
|
|
25
25
|
service_account_name: <%= ENV['GCP_SERVICE_ACCOUNT_NAME'] %>
|
|
26
26
|
custom_metadata_from_disk:
|
|
27
|
-
startup-script: <%= ENV['
|
|
27
|
+
startup-script: <%= ENV['GCP_BOOTSTRAP_SCRIPT_CENTOS'] %>
|
|
28
28
|
service_account_scopes:
|
|
29
29
|
- userinfo-email
|
|
30
30
|
- logging-write
|
|
@@ -53,8 +53,8 @@ platforms:
|
|
|
53
53
|
preemptible: true
|
|
54
54
|
disk_size: 80
|
|
55
55
|
service_account_name: <%= ENV['GCP_SERVICE_ACCOUNT_NAME'] %>
|
|
56
|
-
|
|
57
|
-
windows-startup-script
|
|
56
|
+
custom_metadata_from_disk:
|
|
57
|
+
windows-startup-script: <%= ENV['GCP_BOOTSTRAP_SCRIPT_WINDOWS'] %>
|
|
58
58
|
service_account_scopes:
|
|
59
59
|
- userinfo-email
|
|
60
60
|
- logging-write
|
|
@@ -86,9 +86,9 @@ Vagrant.configure("2") do |c|
|
|
|
86
86
|
<% end %>
|
|
87
87
|
|
|
88
88
|
<% if config[:box] =~ /centos/ %>
|
|
89
|
-
c.vm.provision "shell", inline: "bash /vagrant/
|
|
89
|
+
c.vm.provision "shell", inline: "bash /vagrant/local_bootstrap.sh"
|
|
90
90
|
<% else %>
|
|
91
|
-
c.vm.provision "shell", inline: "powershell -ExecutionPolicy Bypass -File C:/Vagrant/
|
|
91
|
+
c.vm.provision "shell", inline: "powershell -ExecutionPolicy Bypass -File C:/Vagrant/local_bootstrap.ps1"
|
|
92
92
|
<% end %>
|
|
93
93
|
|
|
94
94
|
c.vm.provider "virtualbox" do |p|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
netsh advfirewall firewall add rule name="winrm" dir=in action=allow protocol=TCP localport=5985
|
|
2
|
+
winrm quickconfig -q
|
|
3
|
+
winrm set winrm/config/service @{AllowUnencrypted="true"}
|
|
4
|
+
winrm set winrm/config/service/auth @{Basic="true"}
|
|
5
|
+
|
|
6
|
+
Add-Type -AssemblyName "System.IO.Compression.FileSystem"
|
|
7
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
8
|
+
|
|
9
|
+
$output = "C:\Program Files\vault"
|
|
10
|
+
New-Item $output -ItemType Directory -Force
|
|
11
|
+
$url = "https://storage.googleapis.com/ads-devops-chef/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/windows_amd64.zip"
|
|
12
|
+
$zipfile = "$output\$($url.Split('/')[-1])"
|
|
13
|
+
$wc.DownloadFile($url, $zipfile)
|
|
14
|
+
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $output)
|
|
15
|
+
|
|
16
|
+
$json = @"
|
|
17
|
+
{
|
|
18
|
+
"vault-addr": "<%= ENV['GCP_VAULT_ADDR'] %>",
|
|
19
|
+
"skip-verify": true,
|
|
20
|
+
"wrapped": "<%= ENV['GCP_VAULT_TOKEN'] %>",
|
|
21
|
+
"access": ""
|
|
22
|
+
}
|
|
23
|
+
"@
|
|
24
|
+
|
|
25
|
+
New-Item 'C:\ProgramData\vault' -ItemType Directory -Force
|
|
26
|
+
Set-Content -Path 'C:\ProgramData\vault\tokens.json' -Value $json
|
|
27
|
+
|
|
28
|
+
& "$output\as-vault-tool" tokenrenew
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/bash -e
|
|
2
|
+
|
|
3
|
+
yum install -y unzip wget
|
|
4
|
+
mkdir /etc/vault
|
|
5
|
+
|
|
6
|
+
token=$(vault token-create -policy=nightswatch-ro -role=nightswatch-ro -wrap-ttl=72h | awk '/^wrapping_token:/ {print $2}')
|
|
7
|
+
cat << EOF > /etc/vault/tokens.json
|
|
8
|
+
{
|
|
9
|
+
"vault-addr": "<%= ENV['GCP_VAULT_ADDR'] %>",
|
|
10
|
+
"skip-verify": true,
|
|
11
|
+
"wrapped": "<%= ENV['GCP_VAULT_TOKEN'] %>",
|
|
12
|
+
"access": ""
|
|
13
|
+
}
|
|
14
|
+
EOF
|
|
15
|
+
|
|
16
|
+
mkdir -p /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>
|
|
17
|
+
wget https://storage.googleapis.com/ads-devops-chef/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/linux_amd64.zip
|
|
18
|
+
unzip linux_amd64 -d /opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/
|
|
19
|
+
/opt/as-vault-tool/<%= ENV['AS_VAULT_TOOL_VERSION'] %>/as-vault-tool tokenrenew
|
|
File without changes
|
|
File without changes
|
data/lib/sambot/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.1.138
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Olivier Kouame
|
|
@@ -480,12 +480,13 @@ files:
|
|
|
480
480
|
- lib/sambot/templates/.rubocop.yml
|
|
481
481
|
- lib/sambot/templates/Berksfile
|
|
482
482
|
- lib/sambot/templates/Vagrantfile.erb
|
|
483
|
-
- lib/sambot/templates/bootstrap.ps1
|
|
484
|
-
- lib/sambot/templates/bootstrap.sh
|
|
485
483
|
- lib/sambot/templates/chefignore
|
|
484
|
+
- lib/sambot/templates/gcp_bootstrap.ps1.erb
|
|
485
|
+
- lib/sambot/templates/gcp_bootstrap.sh.erb
|
|
486
|
+
- lib/sambot/templates/local_bootstrap.ps1
|
|
487
|
+
- lib/sambot/templates/local_bootstrap.sh
|
|
486
488
|
- lib/sambot/templates/metadata.rb.erb
|
|
487
489
|
- lib/sambot/templates/pre-push
|
|
488
|
-
- lib/sambot/templates/startup-script.ps1
|
|
489
490
|
- lib/sambot/templates/teamcity.sh.erb
|
|
490
491
|
- lib/sambot/templates/winrm_config
|
|
491
492
|
- lib/sambot/ui.rb
|