vagrant-hivemind 0.1.0
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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +21 -0
- data/README.md +63 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/keys/id_rsa +27 -0
- data/keys/id_rsa.ppk +26 -0
- data/keys/id_rsa.pub +1 -0
- data/lib/vagrant/hivemind.rb +2 -0
- data/lib/vagrant/hivemind/commands/desc.rb +83 -0
- data/lib/vagrant/hivemind/commands/halt.rb +77 -0
- data/lib/vagrant/hivemind/commands/init.rb +67 -0
- data/lib/vagrant/hivemind/commands/kill.rb +77 -0
- data/lib/vagrant/hivemind/commands/list.rb +112 -0
- data/lib/vagrant/hivemind/commands/morph.rb +166 -0
- data/lib/vagrant/hivemind/commands/root.rb +90 -0
- data/lib/vagrant/hivemind/commands/spawn.rb +95 -0
- data/lib/vagrant/hivemind/commands/up.rb +102 -0
- data/lib/vagrant/hivemind/constants.rb +38 -0
- data/lib/vagrant/hivemind/host.rb +34 -0
- data/lib/vagrant/hivemind/plugin.rb +16 -0
- data/lib/vagrant/hivemind/util.rb +236 -0
- data/lib/vagrant/hivemind/version.rb +5 -0
- data/scripts/install-ansible.sh +8 -0
- data/scripts/post-install-ansible.sh +4 -0
- data/scripts/setup-control-ssh.sh +5 -0
- data/scripts/setup-drone-ssh.sh +7 -0
- data/scripts/setup-hostname.sh +11 -0
- data/scripts/update-system-hosts.sh +5 -0
- data/templates/Vagrantfile.erb +48 -0
- data/templates/ansible.hosts.erb +6 -0
- data/templates/system.hosts.erb +10 -0
- data/vagrant-hivemind.gemspec +25 -0
- metadata +124 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
Vagrant.configure(2) do |config|
|
2
|
+
config.vm.define "<%= host.hostname %>" do |host_config|
|
3
|
+
host_config.vm.box = "<%= box_types[host.box_type.to_sym][:box_id] %>"
|
4
|
+
host_config.vm.network "private_network", ip: "<%= host.ip_address %>", virtualbox__intnet: true
|
5
|
+
|
6
|
+
<% host.forwarded_ports.each do |forwarded_port| %>
|
7
|
+
host_config.vm.network "forwarded_port", guest: <%= forwarded_port["guest_port"] %>, host: <%= forwarded_port["host_port"] %><% end %>
|
8
|
+
|
9
|
+
host_config.vm.provider "virtualbox" do |vb|
|
10
|
+
vb.memory = "<%= box_sizes[host.box_size.to_sym][:memory_in_mb] %>".to_i
|
11
|
+
vb.gui = "<%= box_types[host.box_type.to_sym][:is_gui] %>" == "true"
|
12
|
+
end
|
13
|
+
|
14
|
+
host_config.vm.synced_folder "<%= cache_path %>/cache/apt", "/var/cache/apt/archives", create: true
|
15
|
+
host_config.vm.provision "shell", run: "once" do |s|
|
16
|
+
s.path = "<%= hivemind_home_path %>/scripts/setup-hostname.sh"
|
17
|
+
s.args = ["<%= host.hostname %>"]
|
18
|
+
end
|
19
|
+
|
20
|
+
if "<%= host.is_control %>" == "true"
|
21
|
+
# Setup Control Machine SSH
|
22
|
+
# 1. Copy the private key
|
23
|
+
host_config.vm.provision "file", source: "<%= hivemind_home_path %>/keys/id_rsa", destination: "/home/vagrant/.ssh/id_rsa", run: "once"
|
24
|
+
|
25
|
+
# 2. Set the right permissions of the SSH directory and private key
|
26
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/setup-control-ssh.sh", run: "once"
|
27
|
+
|
28
|
+
# Setup Ansible in the Control Machine
|
29
|
+
# 1. Install Ansible from the PPA
|
30
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/install-ansible.sh", run: "once"
|
31
|
+
|
32
|
+
# 2. Copy the Ansible hosts file: First to /tmp, next from /tmp to /etc/ansible/hosts using sudo
|
33
|
+
host_config.vm.provision "file", source: "<%= local_data_path %>/ansible.hosts", destination: "/tmp/ansible.hosts", run: "always"
|
34
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/post-install-ansible.sh", run: "always"
|
35
|
+
end
|
36
|
+
|
37
|
+
# Setup Drone SSH
|
38
|
+
# 1. Copy the Control Machine public key
|
39
|
+
host_config.vm.provision "file", source: "<%= hivemind_home_path %>/keys/id_rsa.pub", destination: "/home/vagrant/.ssh/control_id_rsa.pub", run: "once"
|
40
|
+
|
41
|
+
# Add the Control Machine public key to the authorized_keys file
|
42
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/setup-drone-ssh.sh", run: "once"
|
43
|
+
|
44
|
+
# 2. Copy the system hosts to /tmp, then append contents from /tmp to /etc/hosts using sudo
|
45
|
+
host_config.vm.provision "file", source: "<%= local_data_path %>/system.hosts", destination: "/tmp/system.hosts", run: "always"
|
46
|
+
host_config.vm.provision "shell", path: "<%= hivemind_home_path %>/scripts/update-system-hosts.sh", run: "always"
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
# Hivemind
|
3
|
+
# Enter hand-edited entries above this comment block.
|
4
|
+
# Entries below are auto-generated by Hivemind, DO NOT EDIT!
|
5
|
+
#
|
6
|
+
# Generated by Hivemind at <%= datetime_now %>
|
7
|
+
#
|
8
|
+
|
9
|
+
<% hosts.values.each do |host| %><%= "#{host.ip_address}\t#{host.hostname}" %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'vagrant/hivemind/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-hivemind"
|
8
|
+
spec.version = Vagrant::Hivemind::VERSION
|
9
|
+
spec.authors = ["Nap Ramirez"]
|
10
|
+
spec.email = ["napramirez@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Vagrant extension directives for the Hivemind platform"
|
13
|
+
spec.description = "Vagrant extension directives for the Hivemind platform..."
|
14
|
+
spec.homepage = "https://github.com/napramirez/vagrant-hivemind"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "rspec"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-hivemind
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nap Ramirez
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Vagrant extension directives for the Hivemind platform...
|
56
|
+
email:
|
57
|
+
- napramirez@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CODE_OF_CONDUCT.md
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- keys/id_rsa
|
73
|
+
- keys/id_rsa.ppk
|
74
|
+
- keys/id_rsa.pub
|
75
|
+
- lib/vagrant/hivemind.rb
|
76
|
+
- lib/vagrant/hivemind/commands/desc.rb
|
77
|
+
- lib/vagrant/hivemind/commands/halt.rb
|
78
|
+
- lib/vagrant/hivemind/commands/init.rb
|
79
|
+
- lib/vagrant/hivemind/commands/kill.rb
|
80
|
+
- lib/vagrant/hivemind/commands/list.rb
|
81
|
+
- lib/vagrant/hivemind/commands/morph.rb
|
82
|
+
- lib/vagrant/hivemind/commands/root.rb
|
83
|
+
- lib/vagrant/hivemind/commands/spawn.rb
|
84
|
+
- lib/vagrant/hivemind/commands/up.rb
|
85
|
+
- lib/vagrant/hivemind/constants.rb
|
86
|
+
- lib/vagrant/hivemind/host.rb
|
87
|
+
- lib/vagrant/hivemind/plugin.rb
|
88
|
+
- lib/vagrant/hivemind/util.rb
|
89
|
+
- lib/vagrant/hivemind/version.rb
|
90
|
+
- scripts/install-ansible.sh
|
91
|
+
- scripts/post-install-ansible.sh
|
92
|
+
- scripts/setup-control-ssh.sh
|
93
|
+
- scripts/setup-drone-ssh.sh
|
94
|
+
- scripts/setup-hostname.sh
|
95
|
+
- scripts/update-system-hosts.sh
|
96
|
+
- templates/Vagrantfile.erb
|
97
|
+
- templates/ansible.hosts.erb
|
98
|
+
- templates/system.hosts.erb
|
99
|
+
- vagrant-hivemind.gemspec
|
100
|
+
homepage: https://github.com/napramirez/vagrant-hivemind
|
101
|
+
licenses:
|
102
|
+
- MIT
|
103
|
+
metadata: {}
|
104
|
+
post_install_message:
|
105
|
+
rdoc_options: []
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
requirements: []
|
119
|
+
rubyforge_project:
|
120
|
+
rubygems_version: 2.4.8
|
121
|
+
signing_key:
|
122
|
+
specification_version: 4
|
123
|
+
summary: Vagrant extension directives for the Hivemind platform
|
124
|
+
test_files: []
|