Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Commit

Permalink
🆕 version 1.0.0.alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Apr 19, 2017
0 parents commit 0db6562
Show file tree
Hide file tree
Showing 12 changed files with 282 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## IDE files
.idea/
## Packer artifacts
packer_cache/
output-virtualbox-iso/
*.box
# Vagrant files
.vagrant/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# RancherOS

Due to not being able to install VBox Extensions, this box may require setting the following in your Vagrantfile - The base Vagrantfile should already do this for you by default.

```
# Disable synced folder due to not being able to install VBox Extensions
config.vm.synced_folder ".", "/vagrant", disabled: true
# For now, until I can get a 'vagrant user' working
config.ssh.username = "rancher"
```

The default SSH Key has been set up for `vagrant ssh` to allow hacking via the the shell script provisioner.

Box versions will match the OS version, with `alpha/beta/pre` reserved for hacking
78 changes: 78 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "MatthewHartstonge/RancherOS"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Disable synced folder due to not being able to install VBox Extensions in busybox
config.vm.synced_folder ".", "/vagrant", disabled: true

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.

# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL

# SSH Configuration
config.ssh.username = "rancher"
config.ssh.keys_only = true
end
4 changes: 4 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@ECHO OFF
SET VM_DESCRIPTION=A simplified Linux distribution built from containers, for containers
SET VM_VERSION=1.0.0
packer build -force -var "vm_description=%VM_DESCRIPTION%" -var "vm_version=%VM_VERSION%" "packer_rancheros.json"
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
vm_description='A simplified Linux distribution built from containers, for containers'
vm_version='1.0.0'
packer build \
-var "vm_description=${vm_description}" \
-var "vm_version=${vm_version}" \
"packer_rancheros.json"
20 changes: 20 additions & 0 deletions conf/cloud-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
users:
- name: "vagrant"
# Set a default password of 'vagrant'
passwd: "$6$rounds=4096$TRz4pW9gdPU$wsGte5ncb2c.GFhdvDxghtn6Jep/2gAbrsdlQreJHdJAtLLaZVEwpsoJ1PvE6CpmkWn9QqRJ3SpqlSVaGS2Zr0"
groups:
- "sudo"
- "docker"
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
#rancher:
# services:
# rancher-server:
# image: rancher/server:stable
# # command: --db-host 127.0.0.1 --db-port 3306 --db-user cattle --db-pass cattle --db-name cattle
# restart: always
# ports:
# - "8080:8080"
10 changes: 10 additions & 0 deletions conf/rancheros-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- 1.0.0:
url: https://releases.rancher.com/os/v1.0.0/rancheros.iso
checksums:
md5: b0e3e198a12a2ae8efe89f5167655879
sha256: 7259e55e4bd249c35a36b3a1c4fe41d6ebb59df5740211ccbf2423e9f7dae855
- 0.9.1:
url: https://releases.rancher.com/os/v0.9.1/rancheros.iso
checksums:
md5: 02a98f2105ef29ca61b647399bc44f78
sha256: f541af7c9e6616dcdeb702b194d38af75903ef996e86d91874ffd26ea28bb5e8
10 changes: 10 additions & 0 deletions keys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Insecure Keypair

These keys are the "insecure" public/private keypair we offer to
[base box creators](https://www.vagrantup.com/docs/boxes/base.html) for use in their base boxes so that
vagrant installations can automatically SSH into the boxes.

If you're working with a team or company or with a custom box and
you want more secure SSH, you should create your own keypair
and configure the private key in the Vagrantfile with
`config.ssh.private_key_path`
27 changes: 27 additions & 0 deletions keys/vagrant
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzI
w+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoP
kcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2
hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NO
Td0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcW
yLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQIBIwKCAQEA4iqWPJXtzZA68mKd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Mdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH
+vq/5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQ
NE5OgEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
-----END RSA PRIVATE KEY-----
26 changes: 26 additions & 0 deletions keys/vagrant.ppk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: vagrant insecure public key
Public-Lines: 6
AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+k
z4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdO
KLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4
O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGj
yiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPK
cF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==
Private-Lines: 14
AAABAQDiKpY8le3NkDryYp0QuziMmx3KTL57B1l412zm2NycdTnNRgTbkr598kQP
2pRYgJwtkNzzVMZaMfICoPUHDtemBTAWB5QnBSXNC6sC/7/JKfGLC5oYl+EUzUJp
AfN9emGBWaX59lS+clRO/N9MrYuDoR1tQT1NqtSUF//E9+4SExKUgTmR5v9nPf8t
SVGDzIOrPnD5BZUni62cqcqKrBk3SbCnBTthLImGVPhhXUXefhiMuzAznAmzaiqb
SOyxC78FPS3IRc0NgEsQXgCwKVpa5InaSOrsqGuthfNqCqGdJ6L04NgVKEm7xRZV
5zciFvlleXM7q901DUn1ex/ib7bLAAAAgQD6qFxx/Rv9CNN96l/4rb14HKirC2o/
orApiHmHDsURs5rUKDx0f9iPcXN7S1uePXuJRK/5hsubaOCx3Owd2u9gD6Oq0CsM
kE4CUSiJcYrMANtx54cGH7RkEjFZxK8xAv1ldELEyxrFqkbE4BKd8QOt414qjvTG
yAK+OLD3M2QdCQAAAIEA7cfKTQgMUe8oR2yFk9QB+uvl1jfG16u5d0Tv7pHmnIvf
CX5G5MVEWYbcVfxx7r1IZzy3V908MoDwWGRTaOKc1RIc1qE7ZxLaxbniscnN/i42
abqPpgZUOjkbX4JK/YAVaYV2RmBM5Ag95VXZfC+HMPQVaSqyQrNXObWhow4HSJ0A
AACANWrLCz708y7VYgAtW2Uf1DPOIYMdvo6fxIB5i9ZfISgcJ/bbCUkFrhoH+vq/
5CIWxCPp0f85R4qxxQ5ihxJ0YDQT9Jpx4TMss4PSavPaBH3RXow5Ohe+bYoQNE5O
gEXk2wVfZczCZpigBKbKZHNYcelXtTt/nP3rsCuGcM4h53s=
Private-MAC: 7e88d78e4843aa189575dd8214a9607a8dda3b14
1 change: 1 addition & 0 deletions keys/vagrant.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
77 changes: 77 additions & 0 deletions packer_rancheros.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"variables": {
"vm_description": "",
"vm_version": ""
},
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Linux26_64",
"iso_url": "https://releases.rancher.com/os/v1.0.0/rancheros.iso",
"iso_checksum": "b0e3e198a12a2ae8efe89f5167655879",
"iso_checksum_type": "md5",
"guest_additions_mode": "disable",
"ssh_private_key_file": "./keys/vagrant",
"ssh_username": "rancher",
"ssh_wait_timeout": "360s",
"hard_drive_interface": "sata",
"hard_drive_nonrotational": true,
"iso_interface": "sata",
"vm_name": "rancherOS",
"disk_size": "24000",
"boot_wait": "30s",
"boot_command": [
"echo \"#cloud-config \" >> cloud-config.yml<enter>",
"echo \"ssh_authorized_keys: \" >> cloud-config.yml<enter>",
"echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key \" >> cloud-config.yml<enter>",
"sudo ros install -c cloud-config.yml -d /dev/sda<enter>",
"y<enter>",
"<wait5>",
"y<enter>",
"<wait10><wait10><wait10><wait10><wait10><wait10><wait10><wait10><wait10>"
],
"shutdown_command": "sudo shutdown -h now",
"export_opts": [
"--manifest",
"--vsys", "0",
"--description", "{{user `vm_description`}}",
"--version", "{{user `vm_version`}}.alpha1"
],
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"1024"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"1"
]
]
}
],
"post-processors": [
[
{
"type": "vagrant",
"compression_level": 9,
"keep_input_artifact": false,
"output":"RancherOS_{{user `vm_version`}}.box",
"vagrantfile_template": "./Vagrantfile"
},
{
"type": "atlas",
"only": ["virtualbox-iso"],
"artifact": "MatthewHartstonge/RancherOS",
"artifact_type": "vagrant.box",
"metadata": {
"provider": "virtualbox",
"version": "{{user `vm_version`}}.alpha1"
}
}
]
]
}

0 comments on commit 0db6562

Please sign in to comment.