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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88abd41e053c9866b8f2466db3cb2e4d9a8507e5
4
- data.tar.gz: 4dfebc52309da38dee4aeddbac1779bd6f3a64b5
3
+ metadata.gz: cfc866ec66a95cbeea052093c2715fddd315ec0a
4
+ data.tar.gz: 02fb758ebf416f3ec07c9757519809137b329e76
5
5
  SHA512:
6
- metadata.gz: df7201e96ff1be8e8eb2b9888b91740634274ece0e308d6eddab6308c0c8af9f5b6a578a6d075098c637e4f45fc0bd99256450142dc58199179ee3dcb5736450
7
- data.tar.gz: 2c2a356116320d76908586c0d26d312b1844bfdd906544d09f0bafdf706c4b92d541a4c50632b5943d2a6fd75989ad1ff99c138ce63056f8f7355769f89ac426
6
+ metadata.gz: 2f26b250a995fed84b8494444938b1177d50a7a8b6c1d66f99664b25bb56f0d42e5bc426599409fb41b8b3f2fd175724cae361ce7fe42a24bf0e3c5b71217d1a
7
+ data.tar.gz: e8c9223e041d7b1d9657dff06af2333fe542daa627b16442c9468e76ae0e7df8985b52018001acb5a1d0b5778be2871b6267d6f07adbd4ee30234ebc7144e547
@@ -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
- 'bootstrap.ps1': {eruby: false, dest: 'bootstrap.ps1', platform: [:windows]},
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['GCP_BOOTSTRAP_SCRIPT'] %>
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
- custom_metadata:
57
- windows-startup-script-url: https://storage.googleapis.com/test-kitchen-sfmc/startup-script.ps1
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/bootstrap.sh"
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/bootstrap.ps1"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.137'.freeze
4
+ VERSION = '0.1.138'.freeze
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.137
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
@@ -1,4 +0,0 @@
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"}