sambot 0.1.121 → 0.1.122
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sambot/chef/kitchen.rb +2 -0
- data/lib/sambot/cli.rb +47 -6
- data/lib/sambot/commands/base_command.rb +3 -3
- data/lib/sambot/templates/Vagrantfile.erb +1 -1
- data/lib/sambot/templates/bootstrap.sh +7 -6
- data/lib/sambot/version.rb +1 -1
- data/lib/sambot/workflow/session.rb +3 -0
- metadata +2 -4
- data/lib/sambot/commands/session_cmd.rb +0 -26
- data/lib/sambot/commands/workstation_cmd.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2612a9924613c9ac613d8ae3ad97305929cda3f
|
4
|
+
data.tar.gz: d405ff38f47c7719206ef02ebe33cad953d19bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3692b8e21daa65591df42f7676d6e6def2143d2b8bc12676831483ae7bb53ac3501cdb1804014459743ba055d4353f3c8fa18090eb5dab5daeeb9b57241ddf5d
|
7
|
+
data.tar.gz: 395bed6e32d1dc491a9a0c6b0e5b7edc5aa6517e3a9c3d67b769a3cec84c8e62736039e2247261da22ead85f0fa347c5a8a0142012a5360e96ecf7b063e89432
|
data/lib/sambot/chef/kitchen.rb
CHANGED
@@ -49,6 +49,8 @@ module Sambot
|
|
49
49
|
value['suites'].each do |config|
|
50
50
|
config['attributes'] = config['attributes'] || {}
|
51
51
|
config['attributes']['cloud_platform'] = platform
|
52
|
+
config['attributes']['vault'] = config['attributes']['vault'] || {}
|
53
|
+
config['attributes']['vault']['exec_renew'] = false
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
data/lib/sambot/cli.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'commands/cookbook_cmd'
|
4
|
-
require_relative 'commands/session_cmd'
|
5
|
-
require_relative 'commands/workstation_cmd'
|
6
4
|
|
7
5
|
module Sambot
|
8
6
|
class CLI < Thor
|
@@ -10,11 +8,54 @@ module Sambot
|
|
10
8
|
desc 'cookbook', 'Manage Chef cookbooks'
|
11
9
|
subcommand 'cookbook', Sambot::Commands::CookbookCmd
|
12
10
|
|
13
|
-
desc '
|
14
|
-
|
11
|
+
desc 'clean', 'Remove all generated build files from a Chef cookbook'
|
12
|
+
def clean
|
13
|
+
execute { Chef::Cookbook.clean() }
|
14
|
+
end
|
15
15
|
|
16
|
-
desc '
|
17
|
-
|
16
|
+
desc 'build', 'Builds a Chef cookbook from its configuration file'
|
17
|
+
def build
|
18
|
+
execute { Chef::Cookbook.build(config) }
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'generate', 'Creates a new Chef cookbook'
|
22
|
+
def generate
|
23
|
+
execute do
|
24
|
+
config = {
|
25
|
+
name: ask(' What is the name of this cookbook?'),
|
26
|
+
type: ask(' What type of cookbook will this be?', :limited_to => ['wrapper', 'role']),
|
27
|
+
platforms: ask(' What operating system will this cookbook run on?', :limited_to => ['windows', 'centos', 'both']),
|
28
|
+
description: ask(' What does this cookbook do?')
|
29
|
+
}
|
30
|
+
config[:identifier] = ask(' What will be the unique machiner identifier for this role cookbook?') if config[:type] == 'role'
|
31
|
+
config[:platforms] = config[:platforms] == 'both' ? ['centos', 'windows'] : [config[:platforms]]
|
32
|
+
Chef::Cookbook.generate(config)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
desc 'version', 'Gives the cookbook version as a TeamCity service message'
|
37
|
+
def version
|
38
|
+
execute { puts "##teamcity[buildNumber '#{config['version'].to_s}']" }
|
39
|
+
end
|
40
|
+
|
41
|
+
desc 'configure', 'Sets up an engineering workstation'
|
42
|
+
def configure
|
43
|
+
execute(need_dev_credentials: true, need_sudo_password: true) do
|
44
|
+
Workflow::Workstation.configure(ENV['SAMBOT_DEV_PASSWORD'])
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'start', 'Start a new Sambot session'
|
49
|
+
def start
|
50
|
+
execute(need_dev_credentials: true, need_sudo_password: true) do
|
51
|
+
Workflow::Session.new.start(ENV['SAMBOT_DEV_USERNAME'], ENV['SAMBOT_DEV_PASSWORD'], ENV['SAMBOT_SUDO_PASSWORD'])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
desc 'stop', 'Stop any active Sambot session'
|
56
|
+
def stop
|
57
|
+
execute(need_sudo_password: true) { Workflow::Session.new.stop }
|
58
|
+
end
|
18
59
|
|
19
60
|
end
|
20
61
|
end
|
@@ -78,14 +78,14 @@ module Sambot
|
|
78
78
|
UI.info("Sambot will need to make some secure operations on your behalf. You can provide your credentials below or set them as environment variables:")
|
79
79
|
end
|
80
80
|
if need_dev_credentials && !ENV['SAMBOT_DEV_USERNAME']
|
81
|
-
ENV['SAMBOT_DEV_USERNAME'] = UI.ask("Please provide your DEV/QE AD username: ")
|
81
|
+
ENV['SAMBOT_DEV_USERNAME'] = UI.ask("No environment variable SAMBOT_DEV_USERNAME found. Please provide your DEV/QE AD username: ")
|
82
82
|
end
|
83
83
|
if need_dev_credentials && !ENV['SAMBOT_DEV_PASSWORD']
|
84
|
-
ENV['SAMBOT_DEV_PASSWORD'] = UI.ask_password("Please provide your DEV/QE AD password: ")
|
84
|
+
ENV['SAMBOT_DEV_PASSWORD'] = UI.ask_password("No environment variable SAMBOT_DEV_PASSWORD found. Please provide your DEV/QE AD password: ")
|
85
85
|
puts "\n"
|
86
86
|
end
|
87
87
|
if need_sudo_password && !ENV['SAMBOT_SUDO_PASSWORD']
|
88
|
-
ENV['SAMBOT_SUDO_PASSWORD'] = UI.ask_password("Please provide your sudo password - this is required for operations such as setting up your local SSH tunnels: ")
|
88
|
+
ENV['SAMBOT_SUDO_PASSWORD'] = UI.ask_password("No environment variable SAMBOT_SUDO_PASSWORD found. Please provide your sudo password - this is required for operations such as setting up your local SSH tunnels: ")
|
89
89
|
puts "\n"
|
90
90
|
end
|
91
91
|
Runtime.ensure_latest
|
@@ -86,7 +86,7 @@ Vagrant.configure("2") do |c|
|
|
86
86
|
<% end %>
|
87
87
|
|
88
88
|
<% if config[:box] =~ /centos/ %>
|
89
|
-
c.vm.provision "file", source: "~/.vault-token", destination: "
|
89
|
+
c.vm.provision "file", source: "~/.vault-token", destination: "/tmp/vault-token"
|
90
90
|
c.vm.provision "shell", inline: "bash /vagrant/bootstrap.sh"
|
91
91
|
<% else %>
|
92
92
|
c.vm.provision "shell", inline: "powershell -ExecutionPolicy Bypass -File C:/Vagrant/bootstrap.ps1"
|
@@ -1,9 +1,10 @@
|
|
1
1
|
#!/bin/bash -e
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
token=$(cat /tmp/vault-token)
|
3
|
+
sudo mkdir /etc/vault
|
4
|
+
echo "{\"skip-verify\": true, \"access\": \"$token\", \"vault-addr\": \"https://vault.brighter.io:8200\"}" > /etc/vault/tokens.json
|
5
|
+
rm -f /tmp/vault-token
|
6
|
+
host_ip=`ip route | awk '/default/ {print $3}'`
|
7
|
+
echo "$host_ip vault.brighter.io" > /etc/hosts
|
6
8
|
sudo yum install -y unzip
|
7
|
-
wget "https://releases.hashicorp.com/vault/0.6.5/vault_0.6.5_linux_amd64.zip"
|
9
|
+
wget "https://releases.hashicorp.com/vault/0.6.5/vault_0.6.5_linux_amd64.zip" –qnv
|
8
10
|
unzip vault_0.6.5_linux_amd64.zip -d /usr/bin
|
9
|
-
sudo mkdir /etc/vault
|
data/lib/sambot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.122
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Kouame
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor-hollaback
|
@@ -466,8 +466,6 @@ files:
|
|
466
466
|
- lib/sambot/cli.rb
|
467
467
|
- lib/sambot/commands/base_command.rb
|
468
468
|
- lib/sambot/commands/cookbook_cmd.rb
|
469
|
-
- lib/sambot/commands/session_cmd.rb
|
470
|
-
- lib/sambot/commands/workstation_cmd.rb
|
471
469
|
- lib/sambot/config.rb
|
472
470
|
- lib/sambot/dns/records.rb
|
473
471
|
- lib/sambot/dns/repository.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_command'
|
4
|
-
require_relative '../workflow/session'
|
5
|
-
|
6
|
-
module Sambot
|
7
|
-
module Commands
|
8
|
-
class SessionCmd < BaseCommand
|
9
|
-
|
10
|
-
namespace 'session'
|
11
|
-
|
12
|
-
desc 'start', 'Start a new Sambot session'
|
13
|
-
def start
|
14
|
-
execute(need_dev_credentials: true, need_sudo_password: true) do
|
15
|
-
Workflow::Session.new.start(ENV['SAMBOT_DEV_USERNAME'], ENV['SAMBOT_DEV_PASSWORD'], ENV['SAMBOT_SUDO_PASSWORD'])
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
desc 'stop', 'Stop any active Sambot session'
|
20
|
-
def stop
|
21
|
-
execute(need_sudo_password: true) { Workflow::Session.new.stop }
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'base_command'
|
4
|
-
require_relative '../workflow/workstation'
|
5
|
-
|
6
|
-
module Sambot
|
7
|
-
module Commands
|
8
|
-
class WorkstationCmd < BaseCommand
|
9
|
-
|
10
|
-
namespace 'workstation'
|
11
|
-
|
12
|
-
desc 'configure', 'Sets up an engineering workstation'
|
13
|
-
def configure
|
14
|
-
execute(need_dev_credentials: true, need_sudo_password: true) do
|
15
|
-
Workflow::Workstation.configure(ENV['SAMBOT_DEV_PASSWORD'])
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|