vagrant-lfstacks 0.0.1 → 0.1.1
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/Gemfile +1 -0
- data/Vagrantfile.dev_example +31 -7
- data/lib/commands/reimage.rb +10 -10
- data/lib/commands/remaster.rb +1 -1
- data/lib/commands/repuppet.rb +11 -11
- data/lib/commands/rssh.rb +28 -0
- data/lib/vagrant-lfstacks/version.rb +1 -1
- data/lib/vagrant-lfstacks.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95597ff7c38a0522acbbf46b291ebb17e9053e6
|
4
|
+
data.tar.gz: 4ccb4319c32f4e0e3f7e3ee4fd2ed7b5f51cc46b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510c98fe2af6fdb2f0d8c59aa837283c22c44178340018c128d05147dbb0ab4a4cf24203d58125cc5f8b5d58f86554e2a10b7cc04c44fc133b6e741bfda0bccc
|
7
|
+
data.tar.gz: 9a9fc870d7c0c89f48de5e52323d0be9c018f5b401dba07dc14cce3d07c144db67c3cfb8dbcbba6b6888a9f09b15f02730429d880136b709fd743be5acc9f3f3
|
data/Gemfile
CHANGED
data/Vagrantfile.dev_example
CHANGED
@@ -11,10 +11,13 @@ require 'vagrant-lfstacks'
|
|
11
11
|
|
12
12
|
require 'yaml'
|
13
13
|
require 'pp'
|
14
|
+
require 'erb'
|
14
15
|
|
15
16
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
16
17
|
VAGRANTFILE_API_VERSION = "2"
|
17
18
|
|
19
|
+
# NK Global config hash. When creating a new key for overrides, YOU MUST PROVIDE A DEFAULT HERE!
|
20
|
+
|
18
21
|
global_config = {
|
19
22
|
:tld => 'localdev.livefyre.com',
|
20
23
|
:synced_folders => [
|
@@ -23,17 +26,22 @@ global_config = {
|
|
23
26
|
["#{ENV['HOME']}/dev/lfconfig", '/opt/lfconfig'],
|
24
27
|
],
|
25
28
|
:cache => true,
|
26
|
-
:vb_mem => '
|
27
|
-
:vb_cpus => '
|
29
|
+
:vb_mem => '512',
|
30
|
+
:vb_cpus => '1',
|
28
31
|
:vbg_auto_update => true,
|
29
32
|
:vb_gui => false,
|
33
|
+
:userdata_template_path => "#{ENV['HOME']}/dev/lfconfig/ops_tools/lfstacks/lfuserdata.sh.erb",
|
34
|
+
:userdata_provision => true
|
30
35
|
}
|
31
36
|
|
37
|
+
|
38
|
+
|
39
|
+
|
32
40
|
# NK here we grab any overrides
|
33
41
|
|
34
|
-
if File.exists?('./config.d/global_overrides.
|
35
|
-
overrides = YAML.load_file('./config.d/global_overrides.
|
36
|
-
global_config.update(overrides)
|
42
|
+
if File.exists?('./config.d/global_overrides.yml')
|
43
|
+
overrides = YAML.load_file('./config.d/global_overrides.yml')
|
44
|
+
global_config.update(overrides) if overrides
|
37
45
|
end
|
38
46
|
|
39
47
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
@@ -48,6 +56,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
48
56
|
puppet_config.vm.network "private_network", ip: guest[:ip]
|
49
57
|
#puppet_config.vm.customize ["setextradata", :id, cnames]
|
50
58
|
puppet_config.vm.host_name = "#{guest[:hostname]}.#{guest[:domain]}"
|
59
|
+
|
60
|
+
# USERDATA provisioning!
|
61
|
+
if global_config[:userdata_provision]
|
62
|
+
# NK **** This follows our nodes.pp convention, see Andrew on why he wants to follow it.
|
63
|
+
role = /^(\D+)(\d*)$/.match(guest[:hostname])[0]
|
64
|
+
@hostname = "#{guest[:hostname]}.#{guest[:domain]}"
|
65
|
+
template = File.read(global_config[:userdata_template_path])
|
66
|
+
@userdata_vagrant = true
|
67
|
+
user_data = ERB.new(template).result(binding)
|
68
|
+
puppet_config.vm.provision 'shell', inline: user_data
|
69
|
+
end
|
70
|
+
|
51
71
|
end
|
52
72
|
end
|
53
73
|
end
|
@@ -59,8 +79,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
59
79
|
config.vm.synced_folder(*synced_folder)
|
60
80
|
end
|
61
81
|
|
62
|
-
|
63
|
-
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
# short term fix for vagrant dns issue....see https://github.com/BerlinVagrant/vagrant-dns/issues/27
|
86
|
+
# Will be fixed in Vagrant 1.5.0, see https://github.com/mitchellh/vagrant/issues/2756
|
87
|
+
VagrantDNS::Config.auto_run = false
|
64
88
|
|
65
89
|
|
66
90
|
|
data/lib/commands/reimage.rb
CHANGED
@@ -21,13 +21,13 @@ class ReimageCommand < Vagrant.plugin(2, :command)
|
|
21
21
|
end
|
22
22
|
|
23
23
|
with_target_vms("puppet") do |machine|
|
24
|
-
@env.ui.info "Removing #{machine.name}'s cert on puppet master"
|
24
|
+
@env.ui.info "Removing #{machine.name}'s cert on puppet master", :color => :green
|
25
25
|
argv.each do |target|
|
26
|
-
ssh_cmd
|
26
|
+
ssh_cmd(machine, "puppet cert clean #{target}.localdev.livefyre.com", {:error_check => false})
|
27
27
|
end
|
28
28
|
end
|
29
29
|
with_target_vms(argv) do |machine|
|
30
|
-
@env.ui.info "Destroying #{machine.name}"
|
30
|
+
@env.ui.info "Destroying #{machine.name}", :color => :green
|
31
31
|
machine.action(:destroy, :force_confirm_destroy => true)
|
32
32
|
machine.action(:up)
|
33
33
|
|
@@ -35,13 +35,13 @@ class ReimageCommand < Vagrant.plugin(2, :command)
|
|
35
35
|
# initialization.
|
36
36
|
# this is the issue on REHL:
|
37
37
|
# https://github.com/mitchellh/vagrant/pull/1577
|
38
|
-
cycle_iface machine, "eth1"
|
39
|
-
ssh_cmd machine, "rm -rf /var/lib/puppet/"
|
40
|
-
ssh_cmd machine, "/puppet_configs/scripts/ensure_hostname #{machine.name}.localdev.livefyre.com"
|
41
|
-
@env.ui.info "Installing puppet for #{machine.name}"
|
42
|
-
ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_installed client"
|
43
|
-
@env.ui.info "Running puppet on#{machine.name}"
|
44
|
-
ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_converged -w"
|
38
|
+
# cycle_iface machine, "eth1"
|
39
|
+
# ssh_cmd machine, "rm -rf /var/lib/puppet/"
|
40
|
+
# ssh_cmd machine, "/puppet_configs/scripts/ensure_hostname #{machine.name}.localdev.livefyre.com"
|
41
|
+
# @env.ui.info "Installing puppet for #{machine.name}"
|
42
|
+
# ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_installed client"
|
43
|
+
# @env.ui.info "Running puppet on#{machine.name}"
|
44
|
+
# ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_converged -w"
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/lib/commands/remaster.rb
CHANGED
@@ -9,7 +9,7 @@ class RemasterCommand < Vagrant.plugin(2, :command)
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.synopsis
|
12
|
-
"Sets up a new puppet master while recycling the SSL keys on a puppetdb"
|
12
|
+
"DOES NOT WORK YET -- Sets up a new puppet master while recycling the SSL keys on a puppetdb"
|
13
13
|
end
|
14
14
|
|
15
15
|
def execute
|
data/lib/commands/repuppet.rb
CHANGED
@@ -19,7 +19,7 @@ class RepuppetCommand < Vagrant.plugin(2, :command)
|
|
19
19
|
# Destroy all the puppet infrastructure #
|
20
20
|
#########################################
|
21
21
|
with_target_vms('puppetdb') do |machine|
|
22
|
-
@env.ui.info "Destroying puppet db"
|
22
|
+
@env.ui.info "Destroying puppet db", :color => :green
|
23
23
|
machine.action(:destroy, :force_confirm_destroy=>true)
|
24
24
|
end
|
25
25
|
with_target_vms('puppet') do |machine|
|
@@ -31,7 +31,7 @@ class RepuppetCommand < Vagrant.plugin(2, :command)
|
|
31
31
|
# Rebuild the puppet master in no-db mode #
|
32
32
|
###########################################
|
33
33
|
with_target_vms('puppet') do |machine|
|
34
|
-
@env.ui.info "rebuilding puppet"
|
34
|
+
@env.ui.info "rebuilding puppet", :color => :green
|
35
35
|
machine.action(:up)
|
36
36
|
|
37
37
|
# this is hack to get around a bug in the vagrant
|
@@ -40,15 +40,15 @@ class RepuppetCommand < Vagrant.plugin(2, :command)
|
|
40
40
|
# https://github.com/mitchellh/vagrant/pull/1577
|
41
41
|
cycle_iface machine, "eth1"
|
42
42
|
|
43
|
-
@env.ui.info "Bootstrapping puppet master"
|
44
|
-
ssh_cmd machine, "/
|
43
|
+
@env.ui.info "Bootstrapping puppet master", :color => :green
|
44
|
+
# ssh_cmd machine, "/opt/lfuserdata/puppet_master_setup.sh puppet.localdev.livefyre.com"
|
45
45
|
end
|
46
46
|
|
47
47
|
########################
|
48
48
|
# Rebuild the puppetdb #
|
49
49
|
########################
|
50
50
|
with_target_vms('puppetdb') do |machine|
|
51
|
-
@env.ui.info "rebuilding puppetdb"
|
51
|
+
@env.ui.info "rebuilding puppetdb", :color => :green
|
52
52
|
machine.action(:up)
|
53
53
|
|
54
54
|
# this is hack to get around a bug in the vagrant
|
@@ -57,18 +57,18 @@ class RepuppetCommand < Vagrant.plugin(2, :command)
|
|
57
57
|
# https://github.com/mitchellh/vagrant/pull/1577
|
58
58
|
cycle_iface machine, "eth1"
|
59
59
|
|
60
|
-
@env.ui.info "Bootstrapping puppetdb"
|
61
|
-
ssh_cmd machine, "/
|
62
|
-
@env.ui.info "Running puppet on puppet db"
|
63
|
-
ssh_cmd machine, "/
|
60
|
+
# @env.ui.info "Bootstrapping puppetdb"
|
61
|
+
# ssh_cmd machine, "/opt/lfuserdata/puppet_db_setup.sh puppetdb.localdev.livefyre.com"
|
62
|
+
# @env.ui.info "Running puppet on puppet db"
|
63
|
+
# ssh_cmd machine, "/opt/lfuserdata/ensure_puppet_converged.sh -w"
|
64
64
|
end
|
65
65
|
|
66
66
|
#####################################
|
67
67
|
# Re-enable store configs in puppet #
|
68
68
|
#####################################
|
69
69
|
with_target_vms('puppet') do |machine|
|
70
|
-
@env.ui.info "Running puppet on puppet master"
|
71
|
-
ssh_cmd machine, "/
|
70
|
+
@env.ui.info "Running puppet on puppet master", :color => :green
|
71
|
+
ssh_cmd machine, "/opt/lfuserdata/ensure_puppet_converged.sh -w"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
|
2
|
+
require "vagrant/util/ssh"
|
3
|
+
|
4
|
+
class RsshCommand < Vagrant.plugin(2, :command)
|
5
|
+
|
6
|
+
def self.synopsis
|
7
|
+
"Ssh on the secondary interface to work around network freeze"
|
8
|
+
end
|
9
|
+
|
10
|
+
def execute
|
11
|
+
|
12
|
+
argv = parse_options
|
13
|
+
return unless argv.length == 1
|
14
|
+
|
15
|
+
target_machine = argv[0]
|
16
|
+
with_target_vms(argv) do |machine|
|
17
|
+
|
18
|
+
old_info = machine.ssh_info.dup
|
19
|
+
old_info[:port] = 22
|
20
|
+
old_info[:host] = machine.config.vm.hostname
|
21
|
+
# key_path = info[:private_key_path]
|
22
|
+
# `ssh -i #{key_path} vagrant@#{machine.host_name}`
|
23
|
+
Vagrant::Util::SSH.exec(old_info)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/vagrant-lfstacks.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-lfstacks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Navid Khalili
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/commands/reimage.rb
|
70
70
|
- lib/commands/remaster.rb
|
71
71
|
- lib/commands/repuppet.rb
|
72
|
+
- lib/commands/rssh.rb
|
72
73
|
- lib/commands/s3box.rb
|
73
74
|
- lib/vagrant-lfstacks.rb
|
74
75
|
- lib/vagrant-lfstacks/utils.rb
|