bitswarmbox 1.0.0.pre16

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.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +70 -0
  3. data/.idea/.rakeTasks +7 -0
  4. data/.idea/compiler.xml +22 -0
  5. data/.idea/composerJson.xml +9 -0
  6. data/.idea/copyright/profiles_settings.xml +3 -0
  7. data/.idea/misc.xml +23 -0
  8. data/.idea/modules.xml +8 -0
  9. data/.ruby-version +1 -0
  10. data/.travis.yml +3 -0
  11. data/Gemfile +3 -0
  12. data/LICENSE +21 -0
  13. data/README.md +67 -0
  14. data/Rakefile +34 -0
  15. data/Vagrantfile +116 -0
  16. data/bin/bitswarmbox +6 -0
  17. data/bitswarmbox.gemspec +48 -0
  18. data/bitswarmbox.iml +51 -0
  19. data/builders/aws/build-all.sh +17 -0
  20. data/builders/aws/debian/build-base-jessie64.sh +11 -0
  21. data/builders/aws/debian/build-base-wheezy64.sh +11 -0
  22. data/builders/aws/debian/build-puppetmaster-jessie64.sh +11 -0
  23. data/builders/aws/ubuntu/build-base-precise64.sh +11 -0
  24. data/builders/aws/ubuntu/build-base-trusty64.sh +11 -0
  25. data/builders/aws/ubuntu/build-base-wily64.sh +11 -0
  26. data/builders/aws/ubuntu/build-base-xenial64.sh +11 -0
  27. data/builders/aws/ubuntu/build-puppetmaster-trusty64.sh +11 -0
  28. data/builders/aws/ubuntu/build-puppetmaster-xenial64.sh +11 -0
  29. data/builders/vagrant/build-all.sh +18 -0
  30. data/builders/vagrant/debian/build-base-jessie64.sh +9 -0
  31. data/builders/vagrant/debian/build-base-wheezy64.sh +9 -0
  32. data/builders/vagrant/debian/build-puppetmaster-jessie64.sh +9 -0
  33. data/builders/vagrant/ubuntu/build-base-precise64.sh +9 -0
  34. data/builders/vagrant/ubuntu/build-base-trusty64.sh +9 -0
  35. data/builders/vagrant/ubuntu/build-base-wily64.sh +9 -0
  36. data/builders/vagrant/ubuntu/build-base-xenial64.sh +9 -0
  37. data/builders/vagrant/ubuntu/build-puppetmaster-trusty64.sh +17 -0
  38. data/builders/vagrant/ubuntu/build-puppetmaster-xenial64.sh +17 -0
  39. data/features/boxes.feature +8 -0
  40. data/features/build.feature +16 -0
  41. data/features/env.feature +18 -0
  42. data/features/support/env.rb +1 -0
  43. data/lib/bitswarmbox/builder.rb +181 -0
  44. data/lib/bitswarmbox/command/build/aws.rb +90 -0
  45. data/lib/bitswarmbox/command/build/vagrant.rb +78 -0
  46. data/lib/bitswarmbox/command/build.rb +42 -0
  47. data/lib/bitswarmbox/command/env.rb +50 -0
  48. data/lib/bitswarmbox/command.rb +15 -0
  49. data/lib/bitswarmbox/config.rb +87 -0
  50. data/lib/bitswarmbox/environment.rb +128 -0
  51. data/lib/bitswarmbox/errors.rb +19 -0
  52. data/lib/bitswarmbox/subprocess.rb +39 -0
  53. data/lib/bitswarmbox/template.rb +50 -0
  54. data/lib/bitswarmbox/version.rb +4 -0
  55. data/lib/bitswarmbox.rb +29 -0
  56. data/lib/boxes.rb +29 -0
  57. data/puppet/Puppetfile +58 -0
  58. data/puppet/environments/aws/manifests/base.pp +3 -0
  59. data/puppet/environments/vagrant/environment.conf +1 -0
  60. data/puppet/environments/vagrant/manifests/base.pp +3 -0
  61. data/puppet/hiera.yaml +15 -0
  62. data/puppet/hieradata/aws.yaml +11 -0
  63. data/puppet/hieradata/common.yaml +9 -0
  64. data/puppet/hieradata/debian.yaml +6 -0
  65. data/puppet/hieradata/puppetmaster.yaml +7 -0
  66. data/puppet/hieradata/ubuntu.yaml +3 -0
  67. data/puppet/hieradata/vagrant.yaml +3 -0
  68. data/puppet/hieradata/vsphere.yaml +3 -0
  69. data/puppet/manifests/r10k_bootstrap.pp +37 -0
  70. data/puppet/modules/packer/manifests/aws/cloudinit.pp +20 -0
  71. data/puppet/modules/packer/manifests/aws/networking/params.pp +46 -0
  72. data/puppet/modules/packer/manifests/aws/networking.pp +23 -0
  73. data/puppet/modules/packer/manifests/aws/sshd.pp +10 -0
  74. data/puppet/modules/packer/manifests/aws/users.pp +26 -0
  75. data/puppet/modules/packer/manifests/aws.pp +7 -0
  76. data/puppet/modules/packer/manifests/clock.pp +10 -0
  77. data/puppet/modules/packer/manifests/updates.pp +27 -0
  78. data/puppet/modules/packer/manifests/vagrant/params.pp +14 -0
  79. data/puppet/modules/packer/manifests/vagrant.pp +63 -0
  80. data/puppet/modules/packer/manifests/vmtools/params.pp +35 -0
  81. data/puppet/modules/packer/manifests/vmtools.pp +52 -0
  82. data/puppet/modules/packer/manifests/vsphere/fw.pp +9 -0
  83. data/puppet/modules/packer/manifests/vsphere/networking.pp +29 -0
  84. data/puppet/modules/packer/manifests/vsphere/params.pp +56 -0
  85. data/puppet/modules/packer/manifests/vsphere/repos.pp +87 -0
  86. data/puppet/modules/packer/manifests/vsphere.pp +45 -0
  87. data/puppet/modules/packer/templates/ec2/ubuntu-cloud-cfg.erb +111 -0
  88. data/puppet/modules/packer/templates/vsphere/debian.rb.erb +45 -0
  89. data/puppet/modules/packer/templates/vsphere/rc.local +5 -0
  90. data/puppet/modules/packer/templates/vsphere/redhat.rb.erb +66 -0
  91. data/puppet/modules/packer/templates/vsphere/ubuntu.rb.erb +50 -0
  92. data/scripts/ansible.sh +17 -0
  93. data/scripts/chef.sh +30 -0
  94. data/scripts/cleanup-aws.sh +6 -0
  95. data/scripts/cleanup-vagrant.sh +26 -0
  96. data/scripts/cleanup.sh +48 -0
  97. data/scripts/docker.sh +23 -0
  98. data/scripts/local-ssh-keygen.sh +16 -0
  99. data/scripts/prepare-done.sh +3 -0
  100. data/scripts/prepare.sh +32 -0
  101. data/scripts/puppet.sh +31 -0
  102. data/scripts/puppetserver-post.sh +8 -0
  103. data/scripts/puppetserver.sh +44 -0
  104. data/scripts/ruby.sh +42 -0
  105. data/scripts/vagrant.sh +42 -0
  106. data/scripts/vmtools.sh +37 -0
  107. data/spec/boxes/builder_spec.rb +52 -0
  108. data/spec/boxes/config_spec.rb +142 -0
  109. data/spec/boxes/environment_spec.rb +73 -0
  110. data/spec/boxes/subprocess_spec.rb +35 -0
  111. data/spec/boxes/template_spec.rb +53 -0
  112. data/spec/spec_helper.rb +5 -0
  113. data/spec/support/subprocess_command.rb +7 -0
  114. data/templates/debian/jessie64.erb +206 -0
  115. data/templates/debian/preseed.cfg +70 -0
  116. data/templates/debian/wheezy64.erb +206 -0
  117. data/templates/ubuntu/precise64.erb +205 -0
  118. data/templates/ubuntu/preseed.cfg +61 -0
  119. data/templates/ubuntu/trusty64.erb +205 -0
  120. data/templates/ubuntu/wily64.erb +209 -0
  121. data/templates/ubuntu/xenial64.erb +209 -0
  122. metadata +349 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4a2c176083f1d052b6781d01298416e1d91e6774
4
+ data.tar.gz: f890fd8f212a3230790d53883325f2c2fb2c1368
5
+ SHA512:
6
+ metadata.gz: 14fe97e87a930d2498a7e9dcffad1d738a29d91e5078f74783d56a6a4ef5066e0848ce85366e2c56df2df90848453c5440090e754b1ea1645d3acfe389df5866
7
+ data.tar.gz: 0454514cac70665e24bfac27e6c58147b2ec2739a7e91b886779959fd60587ccc2b70632d06d0a708d30546f64566084765c256c8c0911507e6842ee8b64bf1e
data/.gitignore ADDED
@@ -0,0 +1,70 @@
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ ### JetBrains template
3
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
4
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5
+
6
+ # User-specific stuff:
7
+ .idea/workspace.xml
8
+ .idea/tasks.xml
9
+ .idea/dictionaries
10
+ .idea/vcs.xml
11
+ .idea/jsLibraryMappings.xml
12
+
13
+ # Sensitive or high-churn files:
14
+ .idea/dataSources.ids
15
+ .idea/dataSources.xml
16
+ .idea/dataSources.local.xml
17
+ .idea/sqlDataSources.xml
18
+ .idea/dynamic.xml
19
+ .idea/uiDesigner.xml
20
+
21
+ # Gradle:
22
+ .idea/gradle.xml
23
+ .idea/libraries
24
+
25
+ # Mongo Explorer plugin:
26
+ .idea/mongoSettings.xml
27
+
28
+ ## File-based project format:
29
+ *.iws
30
+
31
+ ## Plugin-specific files:
32
+
33
+ # IntelliJ
34
+ /out/
35
+
36
+ # mpeltonen/sbt-idea plugin
37
+ .idea_modules/
38
+
39
+ # JIRA plugin
40
+ atlassian-ide-plugin.xml
41
+
42
+ # Crashlytics plugin (for Android Studio and IntelliJ)
43
+ com_crashlytics_export_strings.xml
44
+ crashlytics.properties
45
+ crashlytics-build.properties
46
+ fabric.properties
47
+
48
+ # Rake and Packer generated cruft
49
+ Gemfile.lock
50
+ pkg/
51
+ spec/reports/
52
+ tmp/
53
+ vendor/
54
+
55
+ # Preloaded SSH keys
56
+ keys/
57
+ !keys/.gitkeep
58
+
59
+ # Local Hiera overrides
60
+ puppet/hieradata/local.yaml
61
+
62
+ # Cache objects
63
+ packer_cache/
64
+
65
+ # For built boxes
66
+ *.box
67
+ output-*
68
+
69
+ # Vagrant
70
+ .vagrant/
data/.idea/.rakeTasks ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build bitswarmbox-0.5.0.pre1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Run Cucumber features" fullCmd="features" taksId="features" /><RakeTask description="Build and install bitswarmbox-0.5.0.pre1.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install bitswarmbox-0.5.0.pre1.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.5.0.pre1 and build and push bitswarmbox-0.5.0.pre1.gem to Rubygems" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CompilerConfiguration">
4
+ <resourceExtensions />
5
+ <wildcardResourcePatterns>
6
+ <entry name="!?*.java" />
7
+ <entry name="!?*.form" />
8
+ <entry name="!?*.class" />
9
+ <entry name="!?*.groovy" />
10
+ <entry name="!?*.scala" />
11
+ <entry name="!?*.flex" />
12
+ <entry name="!?*.kt" />
13
+ <entry name="!?*.clj" />
14
+ <entry name="!?*.aj" />
15
+ </wildcardResourcePatterns>
16
+ <annotationProcessing>
17
+ <profile default="true" name="Default" enabled="false">
18
+ <processorPath useClasspath="true" />
19
+ </profile>
20
+ </annotationProcessing>
21
+ </component>
22
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ComposerJsonPluginSettings">
4
+ <unboundedVersionInspectionSettings>
5
+ <excludedPackages />
6
+ </unboundedVersionInspectionSettings>
7
+ <customRepositories />
8
+ </component>
9
+ </project>
@@ -0,0 +1,3 @@
1
+ <component name="CopyrightManager">
2
+ <settings default="" />
3
+ </component>
data/.idea/misc.xml ADDED
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MavenImportPreferences">
4
+ <option name="generalSettings">
5
+ <MavenGeneralSettings>
6
+ <option name="mavenHome" value="Bundled (Maven 3)" />
7
+ </MavenGeneralSettings>
8
+ </option>
9
+ </component>
10
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
11
+ <OptionsSetting value="true" id="Add" />
12
+ <OptionsSetting value="true" id="Remove" />
13
+ <OptionsSetting value="true" id="Checkout" />
14
+ <OptionsSetting value="true" id="Update" />
15
+ <OptionsSetting value="true" id="Status" />
16
+ <OptionsSetting value="true" id="Edit" />
17
+ <ConfirmationsSetting value="0" id="Add" />
18
+ <ConfirmationsSetting value="0" id="Remove" />
19
+ </component>
20
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="false" assert-keyword="false" jdk-15="false" project-jdk-name="RVM: ruby-2.1.1 [global]" project-jdk-type="RUBY_SDK">
21
+ <output url="file://$PROJECT_DIR$/out" />
22
+ </component>
23
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/bitswarmbox.iml" filepath="$PROJECT_DIR$/bitswarmbox.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.1.1
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 bitswarmlabs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # BitswarmBox - Packer Convenience Wrapper for building Bitswarm.io
2
+
3
+ [Packer](http://packer.io) templates for provisioning host operating system environments for the
4
+ [Bitswarm](http://bitswarm.io) ecosystem.
5
+
6
+ ## Packer Templates:
7
+
8
+ Before building any of these templates, you will need to ensure you have suitable `AWS_ACCESS_KEY_ID` and
9
+ `AWS_SECRET_ACCESS_KEY` environment variables available.
10
+ ### bitswarm-base
11
+
12
+ Creates image suitable for general purpose usage, including Puppet 4 pre-configured against puppet master server.
13
+ ### bitswarm-puppetmaster
14
+
15
+ A puppet master server, preloaded with Puppet 4, PuppetDB 4, Facter, Hiera, and mCollective.
16
+
17
+ If the Packer configuration variables `puppet_scm_repo` and `github_webhook_api_token` are set in Packer, this
18
+ repo will be preconfigured for use via r10k.
19
+
20
+ When this template is built, `scripts/local-ssh-key.sh` is invoked which will create an RSA keypair locally within keys/
21
+ and this will be preloaded into the resulting AMIs.
22
+
23
+ ## Pre-requisites
24
+
25
+ - AWS api key and secret for user with sufficient permissions
26
+ - Github API token for user with "owner" role of repos to be used as r10k sources. Owner is necessary for the
27
+ ability to interact with the Github API on the repos to install deployment keys.
28
+
29
+ ## Installation & Requirements
30
+
31
+ ```shell
32
+ [sudo] gem install bitswarmbox
33
+ ```
34
+
35
+ bitswarmbox leans on [Packer][] and [VirtualBox][], [VMware Fusion][fusion] or
36
+ [VMware Workstation][workstation] for building boxes and these will need to
37
+ available in your `$PATH`.
38
+
39
+ ## Example Usage
40
+
41
+ bitswarmbox is driven by the `bitswarmbox` command line tool, and works with artifacts
42
+ inside it's own working directory. You need to specify a name for the build,
43
+ a template to work with and the output provider. Something like so:
44
+
45
+ ```shell
46
+ bitswarmbox build \
47
+ --name=trusty64-empty \
48
+ --template=ubuntu/trusty64 \
49
+ --provider=vmware
50
+ ```
51
+
52
+ This will build a file called `trusty64-empty.box` in the current directory.
53
+
54
+ There's lots more to `bitswarmbox` than building simple empty Vagrant boxes like
55
+ this, which can be see in the inline help.
56
+
57
+ ## Acknowledgements
58
+
59
+ Many thanks to the upstream sources from which this derives, most notably
60
+ [Nick Charlton's Boxes.io](https://github.com/nickcharlton/boxes).
61
+
62
+ ## Disclaimer
63
+
64
+ No warranties given, expressed or implied. Use with parental supervision.
65
+
66
+ ## For more information
67
+ http://bitswarm.io/
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env rake
2
+
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'bundler/gem_tasks'
10
+
11
+ ##
12
+ # Configure the test suite.
13
+ ##
14
+ require 'rspec/core'
15
+ require 'rspec/core/rake_task'
16
+
17
+ RSpec::Core::RakeTask.new
18
+
19
+ ##
20
+ # Cucumber for feature testing.
21
+ ##
22
+ require 'rake/clean'
23
+ require 'cucumber'
24
+ require 'cucumber/rake/task'
25
+
26
+ Cucumber::Rake::Task.new(:features) do |t|
27
+ t.cucumber_opts = 'features --format pretty -x'
28
+ t.fork = false
29
+ end
30
+
31
+ ##
32
+ # By default, just run the tests.
33
+ ##
34
+ task default: :spec
data/Vagrantfile ADDED
@@ -0,0 +1,116 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure(2) do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Every Vagrant development environment requires a box. You can search for
14
+ # boxes at https://atlas.hashicorp.com/search.
15
+ #config.vm.box = "ubuntu-xenial64-base"
16
+ #config.vm.box = "ubuntu-trusty64-puppetserver"
17
+ #config.vm.box = "ubuntu-xenial64-puppetserver"
18
+ config.vm.box = "puppetserver-debian-jessie"
19
+
20
+ # Disable automatic box update checking. If you disable this, then
21
+ # boxes will only be checked for updates when the user runs
22
+ # `vagrant box outdated`. This is not recommended.
23
+ # config.vm.box_check_update = false
24
+
25
+ # Create a forwarded port mapping which allows access to a specific port
26
+ # within the machine from a port on the host machine. In the example below,
27
+ # accessing "localhost:8080" will access port 80 on the guest machine.
28
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
29
+
30
+ # Create a private network, which allows host-only access to the machine
31
+ # using a specific IP.
32
+ # config.vm.network "private_network", ip: "192.168.33.10"
33
+
34
+ # Create a public network, which generally matched to bridged network.
35
+ # Bridged networks make the machine appear as another physical device on
36
+ # your network.
37
+ # config.vm.network "public_network"
38
+
39
+ # Share an additional folder to the guest VM. The first argument is
40
+ # the path on the host to the actual folder. The second argument is
41
+ # the path on the guest to mount the folder. And the optional third
42
+ # argument is a set of non-required options.
43
+ # config.vm.synced_folder "../data", "/vagrant_data"
44
+ config.vm.synced_folder "puppet/hieradata", "/tmp/hieradata"
45
+
46
+ # Provider-specific configuration so you can fine-tune various
47
+ # backing providers for Vagrant. These expose provider-specific options.
48
+ # Example for VirtualBox:
49
+ #
50
+ config.vm.provider "virtualbox" do |vb|
51
+ # Display the VirtualBox GUI when booting the machine
52
+ #vb.gui = true
53
+
54
+ # Customize the amount of memory on the VM:
55
+ vb.memory = "2048"
56
+
57
+ # Customize the number of CPUs on the VM:
58
+ vb.cpus = 2
59
+ end
60
+ #
61
+ # View the documentation for the provider you are using for more
62
+ # information on available options.
63
+
64
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
65
+ # such as FTP and Heroku are also available. See the documentation at
66
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
67
+ # config.push.define "atlas" do |push|
68
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
69
+ # end
70
+
71
+ # Enable provisioning with a shell script. Additional provisioners such as
72
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
73
+ # documentation for more information about their specific syntax and use.
74
+ # config.vm.provision "shell", inline: <<-SHELL
75
+ # sudo apt-get update
76
+ # sudo apt-get install -y apache2
77
+ # SHELL
78
+
79
+ # config.vm.provision "shell", inline: "cp -f /vagrant/puppet/Puppetfile /tmp/"
80
+ # # config.vm.provision "shell", path: "scripts/puppetserver-preload.sh"
81
+ #
82
+ # config.vm.provision "puppet" do |puppet|
83
+ # puppet.manifest_file = "r10k_bootstrap.pp"
84
+ # puppet.manifests_path = "puppet/manifests"
85
+ # puppet.environment = "production"
86
+ # puppet.environment_path = "puppet/environments"
87
+ # puppet.hiera_config_path = "puppet/hiera.yaml"
88
+ #
89
+ # puppet.facter = {
90
+ # "provisioner" => "vagrant",
91
+ # "puppetversion" => "4.0",
92
+ # "app_project" => "bootstrap",
93
+ # }
94
+ #
95
+ # puppet.options = [
96
+ # "--show_diff"
97
+ # ]
98
+ # end
99
+ #
100
+ # config.vm.provision "puppet" do |puppet|
101
+ # puppet.environment = "vagrant"
102
+ # puppet.environment_path = "puppet/environments"
103
+ # puppet.hiera_config_path = "puppet/hiera.yaml"
104
+ #
105
+ # puppet.facter = {
106
+ # "provisioner" => "vagrant",
107
+ # "puppetversion" => "4.0",
108
+ # "app_project" => "puppetmaster",
109
+ # "app_environment" => "production",
110
+ # }
111
+ #
112
+ # puppet.options = [
113
+ # "--show_diff --verbose"
114
+ # ]
115
+ # end
116
+ end
data/bin/bitswarmbox ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'bitswarmbox'
5
+
6
+ BitswarmBox::Command.run(ARGV)
@@ -0,0 +1,48 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bitswarmbox/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'bitswarmbox'
8
+ spec.version = BitswarmBox::VERSION
9
+ spec.executables << 'bitswarmbox'
10
+ spec.authors = ['Bitswarm Labs']
11
+ spec.email = ['ops@bitswarm.io']
12
+
13
+ spec.summary = 'A command line tool to take the complexity out of '\
14
+ 'building Vagrant boxes.'
15
+ spec.description = <<-EOF
16
+ boxes takes the complexity out of building custom Vagrant boxes.
17
+
18
+ It's a command line tool which provides a set of templates and scripts to
19
+ combine as you need. There are also a set of pre-build boxes which are
20
+ regenerated regularly.'
21
+ EOF
22
+ spec.homepage = 'https://github.com/bitswarmlabs/bitswarmbox'
23
+ spec.license = 'MIT'
24
+
25
+ spec.files = `git ls-files`.split($RS)
26
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
27
+ spec.test_files = spec.files.grep(/^(test|spec|features)/)
28
+ spec.require_paths = ['lib']
29
+
30
+ # spec.add_dependency 'boxes', '~> 2.3'
31
+ spec.add_dependency 'claide', '~> 0.9'
32
+ spec.add_dependency 'colored', '~> 1.2'
33
+ spec.add_dependency 'rsync', '1.0.9'
34
+
35
+ spec.add_development_dependency 'bundler', '~> 1.9'
36
+ spec.add_development_dependency 'rake', '~> 10.4'
37
+ spec.add_development_dependency 'rspec', '~> 3.3'
38
+ spec.add_development_dependency 'cucumber', '~> 2.1'
39
+ spec.add_development_dependency 'aruba', '~> 0.8'
40
+ spec.add_development_dependency 'fakefs', '~> 0.6'
41
+ spec.add_development_dependency 'pry'
42
+
43
+ spec.add_development_dependency 'ruby-debug-ide', '0.4.24'
44
+ spec.add_development_dependency 'debase', '0.2.1'
45
+
46
+ end
47
+
48
+
data/bitswarmbox.iml ADDED
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$">
6
+ <sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
7
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
8
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
9
+ <excludeFolder url="file://$MODULE_DIR$/.bundle" />
10
+ <excludeFolder url="file://$MODULE_DIR$/.idea" />
11
+ <excludeFolder url="file://$MODULE_DIR$/.vagrant" />
12
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
13
+ <excludeFolder url="file://$MODULE_DIR$/vendor/bundle" />
14
+ </content>
15
+ <orderEntry type="jdk" jdkName="RVM: ruby-2.1.1" jdkType="RUBY_SDK" />
16
+ <orderEntry type="sourceFolder" forTests="false" />
17
+ <orderEntry type="library" scope="PROVIDED" name="aruba (v0.14.1, RVM: ruby-2.1.1) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, RVM: ruby-2.1.1) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.12.5, RVM: ruby-2.1.1) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="childprocess (v0.5.9, RVM: ruby-2.1.1) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="claide (v0.9.1, RVM: ruby-2.1.1) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="coderay (v1.1.1, RVM: ruby-2.1.1) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="colored (v1.2, RVM: ruby-2.1.1) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="contracts (v0.14.0, RVM: ruby-2.1.1) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="cucumber (v2.4.0, RVM: ruby-2.1.1) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-core (v1.5.0, RVM: ruby-2.1.1) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="cucumber-wire (v0.0.1, RVM: ruby-2.1.1) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="debase (v0.2.1, RVM: ruby-2.1.1) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="debase-ruby_core_source (v0.9.0, RVM: ruby-2.1.1) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-2.1.1) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="fakefs (v0.8.1, RVM: ruby-2.1.1) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.10, RVM: ruby-2.1.1) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="gherkin (v4.0.0, RVM: ruby-2.1.1) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="method_source (v0.8.2, RVM: ruby-2.1.1) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.12.1, RVM: ruby-2.1.1) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="multi_test (v0.1.2, RVM: ruby-2.1.1) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="pry (v0.10.3, RVM: ruby-2.1.1) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.5.0, RVM: ruby-2.1.1) [gem]" level="application" />
39
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.4.0, RVM: ruby-2.1.1) [gem]" level="application" />
40
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.4.4, RVM: ruby-2.1.1) [gem]" level="application" />
41
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.4.0, RVM: ruby-2.1.1) [gem]" level="application" />
42
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.4.1, RVM: ruby-2.1.1) [gem]" level="application" />
43
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.4.1, RVM: ruby-2.1.1) [gem]" level="application" />
44
+ <orderEntry type="library" scope="PROVIDED" name="rsync (v1.0.9, RVM: ruby-2.1.1) [gem]" level="application" />
45
+ <orderEntry type="library" scope="PROVIDED" name="ruby-debug-ide (v0.4.24, RVM: ruby-2.1.1) [gem]" level="application" />
46
+ <orderEntry type="library" scope="PROVIDED" name="slop (v3.6.0, RVM: ruby-2.1.1) [gem]" level="application" />
47
+ <orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-2.1.1) [gem]" level="application" />
48
+ <orderEntry type="library" name="stub [puppet module]" level="application" />
49
+ </component>
50
+ <component name="PuppetLibraryUpdateService" isEnabled="true" />
51
+ </module>
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+
3
+ echo "Building all AWS base AMIs..."
4
+
5
+ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6
+
7
+ cd "${DIR}/../../"
8
+ echo " - Using context root $(pwd)"
9
+
10
+ set -ex
11
+
12
+ $DIR/debian/build-base-jessie64.sh
13
+ $DIR/debian/build-base-wheezy64.sh
14
+ $DIR/ubuntu/build-base-precise64.sh
15
+ $DIR/ubuntu/build-base-trusty64.sh
16
+ $DIR/ubuntu/build-base-wily64.sh
17
+ $DIR/ubuntu/build-base-xenial64.sh
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-debian-jessie64" \
7
+ --template="debian/jessie64" \
8
+ --description="Bitswarm base image bootstrap running Debian Jessie amd64" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-45374b25" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-debian-wheezy64" \
7
+ --template="debian/wheezy64" \
8
+ --description="Bitswarm base image bootstrap running Debian Jessie amd64" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-b4869ff1" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-puppetmaster-debian-jessie64" \
7
+ --template="debian/jessie64" \
8
+ --description="Bitswarm Puppetmaster bootstrap running Debian Jessie amd64" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-45374b25" \
11
+ --puppetserver --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-ubuntu-precise64-hvm-ebs-ssd" \
7
+ --template="ubuntu/precise64" \
8
+ --description="Bitswarm base image bootstrap running Ubuntu Precise 12.04 LTS amd64 hvm:ebs-ssd" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-bc0e4bdc" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-ubuntu-trusty64-hvm-ebs-ssd" \
7
+ --template="ubuntu/trusty64" \
8
+ --description="Bitswarm base image bootstrap running Ubuntu Trusty 14.04 LTS amd64 hvm:ebs-ssd" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-11286c71" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-ubuntu-wily64-hvm-ebs-ssd" \
7
+ --template="ubuntu/wily64" \
8
+ --description="Bitswarm base image bootstrap running Ubuntu Wily 15.10 amd64 hvm:ebs-ssd" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-3ac4be5a" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/bin/bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-base-ubuntu-xenial64-hvm-ebs-ssd" \
7
+ --template="ubuntu/xenial64" \
8
+ --description="Bitswarm base image bootstrap running Ubuntu Xenial 16.04 LTS amd64 hvm:ebs-ssd" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-08490c68" \
11
+ --puppet --bootstrap
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ which bitswarmbox || gem install bitswarmbox
4
+
5
+ bitswarmbox build aws \
6
+ --name="bitswarm-puppetmaster-ubuntu-trusty64-hvm-ebs-ssd" \
7
+ --template="ubuntu/trusty64" \
8
+ --description="Bitswarm Puppetmaster bootstrap running Ubuntu Trusty 14.04 LTS amd64 hvm:ebs-ssd" \
9
+ --aws_region="us-west-1" \
10
+ --aws_source_ami="ami-11286c71" \
11
+ --puppetserver --bootstrap