Skip to content

Instantly share code, notes, and snippets.

@asimihsan
Created June 16, 2013 14:20
Show Gist options
  • Save asimihsan/5792218 to your computer and use it in GitHub Desktop.
Save asimihsan/5792218 to your computer and use it in GitHub Desktop.
Vagrant + Puppet config for setting up Fedora 18 x64 with Python, pip, and virtualenv.
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export WORKON_HOME=/home/vagrant/.envs
source /usr/bin/virtualenvwrapper.sh
# Put in manifests/init.pp
class puppet {
group { "puppet":
ensure => present,
}
}
class development_tools {
exec { 'yum --assumeyes groupinstall "Development Tools"':
path => "/usr/bin:/bin",
unless => 'yum grouplist "Development Tools" | grep "^Installed Groups"',
}
}
class python {
package {
"python": ensure => installed;
"python-devel": ensure => installed;
"python-pip": ensure => installed;
}
exec { "pip-python install --upgrade --force pip":
path => "/usr/local/bin:/usr/bin:/bin",
unless => "which pip",
}
}
class virtualenv {
exec { "pip install virtualenv virtualenvwrapper":
path => "/usr/local/bin:/usr/bin:/bin",
unless => "pip list | grep virtualenv",
}
}
class user_environment {
file { "/home/vagrant/.bashrc": source => "/vagrant/bashrc" }
}
Class['development_tools'] -> Class['python']
Class['python'] -> Class['virtualenv']
include puppet
include development_tools
include python
include virtualenv
include user_environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "fedora-18-x64"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/fedora-18-x64-vbox4210.box"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "init.pp"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment