IF YOU NEED XCODE'S COMPILER, THIS WILL BREAK ALL THE THINGS!!!
-
Install GCC for OSX.
- The filename of the download for Mountain Lion is listed as GCC-10.7.pkg on the site, but downloads as GCC-10.7-v2.pkg
- If you get a warning that the file can't be opened because it's from an unidentified developer, just control-click on it, and then click open.
-
Install the Xcode command line tools from https://developer.apple.com/downloads
- Register if you don't have an AppleID, and login.
- In the left hand search bar, search for "command", and download
the latest command line tools for your release of OSX.
- At time of writing, the latest tools are the April release, for Mountain Lion.
-
Install homebrew.
- Scroll down to the bottom of the page for the ruby one-liner.
- After running the one-liner, run
brew doctor
. It should print outYour system is ready to brew.
If you get any errors, either follow the instructions to fix the problems, or ask somebody for help.
-
Run
brew install wget gnu-tar rbenv ruby-build
.- We install wget because Mac OS X doesn't come with it.
- We install gnu-tar because there is a bug in the way that PE 2.7.2
was packages, and you can't untar it with BSD-tar or the finder's
archive utility. The gnu-tar package installs with the command
gtar
which does work.
-
Set up your shell to work with rbenv and rbenv install/ruby-build.
- BASH
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL -l
- ZSH
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
exec $SHELL -l
- BASH
-
Install the latest 1.9.3 ruby with rbenv.
rbenv install -l |grep 1.9.3
- At time of writing this was 1.9.3-p429
rbenv install 1.9.3-p429
(or latest version of 1.9.3 listed)
-
Set your new ruby as the rbenv global version.
rbenv versions
rbenv global 1.9.3-p429
(or latest version)ruby --version
should report the version of ruby you just set as global.
-
Set up oscar/insta-pe/insta-pants/soupkitchen/aka the rza/aka the jza/THE WU TANG CLAN.
git clone https://github.com/adrienthebo/oscar.git ~/oscar
cd ~/oscar
git checkout a737af1
- Set the version of ruby used with oscar permanently.
rbenv local 1.9.3-p429
(or latest version)
- Install virtualbox.
- Install vagrant:
gem install vagrant
.- NB: Don't get clever here! Don't download vagrant from the website! Install the gem!
- Download my good config.yaml and stick it in ~/oscar.
Oscar is basically just a fancy Vagrantfile. We don't really ever edit the Vagrantfile. All (almost) configuration is done via the config.yaml file, which has 4 sections.
WARNING: Yaml is super finnicky about syntax, so you'll want to make sure that indents and other things line up exactly when you edit your config file.
This controls what version of PE we want to install, and where oscar should expect that file. As long as the structure of the puppet installer doesn't change, we don't really need to edit this. Just change the "version" line to reflect the version you want to install.
The version you want to install must be downloaded and untarred inside of ~/oscar/files.
These are just the vagrant boxes you want to use. You can add any sources you like. There are various fairly up-to-date boxes available at here. You do not need to download the boxes yourself - vagrant does that for you. Just create profiles for them in config.yaml.
The nodes section contains the list of vagrant boxes you want to spin up. They are a collection of attributes, and look like this:
-
name: master
role: master
profile: ubuntu
address: 172.16.0.2
forwards:
443: 20443
-
name: agent
role: agent
profile: ubuntu
address: 172.16.0.2
- name - This is the vagrant name and hostname of the node.
- role - The role maps to an answers file in
~/oscar/answers
, so master would result in the master.txt answers file being used. - profile - the vagrant box you want to use, as defined earlier.
- address - By default, VirtualBox and Vagrant assign NAT interfaces
to boxes, which can't communicate with each other. This makes
master-agent puppet impossible. To work around this, oscar creates
"host-only" interfaces on all the machines, with the private addresses
that we specify in the
address:
field. Oscar then does some magic so that all of these addresses are in the/etc/hosts
files of all the vagrant boxes, which gives us functional name resolution between the vagrant boxes. The natted addresses are also retained, so that the nodes can access the internet.- In theory you could work around this by using bridged networking, but it's probably a bad idea, given the limited number of available IPs on our network, and the large number of users spinning up VMs.
- Forwards - Since vagrant boxes are natted, they can't be accessed directly. Therefore in order to access the console, we need to create a PAT forward. So in the example above, on the master node, localhost:20443 on our machine maps to 443 on the vagrant box. You can also forward other arbitrary ports, but there's mostly no reason to.
NB: The entire ~oscar/ directory will be shared as /vagrant
on
your nodes.
Contains various answer files, as mentioned above in the config.yaml
section. Typically you will need at least two, one
for the master and one for all your agents.
PE installers that you want to use should be untarred here.
The puppet modulepath is automatically changed to /modules
, and that
directory is mapped to ~/oscar/modules
on your host machine, using
VirtualBox's built in shared directory functionality.
Same as modules. manifestdir
is changed to /manifests
and is mapped
to ~oscar/manifests
.
The configuration provided by my config.yaml should be pretty reasonable.
-
vagrant up master
will spin up the node named master, which should be an Ubuntu 12.04 server, running PE installed with the master.txt answers file, assuming you used my config.yaml. This will take a few minutes. -
vagrant ssh master
will SSH into the master node that you just spun up. You can use the system normally. -
To access the console, visit https://localhost:20443 in your browser. The username and password is set in the answers file. (master.txt)
That's pretty much it. The nodes behave like normal puppetized systems.
You can spin up an agent node by editing config.yaml
and uncommenting
the client node, or adding your own nodes.
- CentOS has iptables enabled by default, which means if you try to spin up a master node and an agent node, they won't be able to talk. You need to disable iptables on the master, and then disable iptables on the agent before puppet installs. It's possible to build this into the vagrantfile, but I haven't figured it out yet.
- vagrant reload nodename --no-provision caveats (different on ubuntu and centos)
- Solaris guide.
- Sahara usage
- Figure out how to add CentOS itpables fix to vagrantfile.
Is step 7 (set your global ruby to 1.9.3) necessary/desirable?