Skip to content

Instantly share code, notes, and snippets.

@filler
Created June 14, 2012 14:25
Show Gist options
  • Save filler/2930683 to your computer and use it in GitHub Desktop.
Save filler/2930683 to your computer and use it in GitHub Desktop.
hack via vagrant shell provider to get yale cfengine 3 going
.vagrant
cf3dcsunix
PROJ=cas
cd ~/Vagrant
git clone git://gist.github.com/2930683.git ${proj}
cd ${proj}
svn co https://cf3svn.its.yale.edu/repos/cf3dcsunix
sed -i '' 's/vm-cfgprdapp-01.its.yale.edu/localhost/' ./cf3dcsunix/trunk/inputs/dcsunix/group.cf
sed -i '' 's/vm-cfgprdapp-01.its.yale.edu/localhost/' ./cf3dcsunix/trunk/inputs/dcsunix/promises.cf
vagrant up
#!/bin/bash
sudo netstat -nr
sudo ip route add blackhole 130.132.50.34 # dont even think about phoning home to canonical policymaster
sudo netstat -nr
sudo cp \
/var/cfengine/masterfiles/inputs/dcsunix/group.cf \
/var/cfengine/inputs/group.cf
sudo cp \
/var/cfengine/masterfiles/inputs/core/failsafe.cf \
/var/cfengine/inputs/failsafe.cf
sudo /var/cfengine/bin/cf-agent -K -N nfsClient,NfsClient -D localDev
sudo /var/cfengine/bin/cf-agent -K -N nfsClient,NfsClient -D localDev
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :d7 do |d7_config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
d7_config.vm.box = "RHEL-6.1-x86_64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
# config.vm.box_url = "http://domain.com/path/to/above.box"
d7_config.vm.box_url = "http://rhad.net/boxes/RHEL-6.1-x86_64.box"
# Boot with a GUI so you can see the screen. (Default is headless)
# config.vm.boot_mode = :gui
# Assign this VM to a host-only network IP, allowing you to access it
# via the IP. Host-only networks can talk to the host machine as well as
# any other machines on the same network, but cannot be accessed (through this
# network interface) by any external networks.
d7_config.vm.network :hostonly, "33.33.33.10"
# Assign this VM to a bridged network, allowing you to connect directly to a
# network using the host's network device. This makes the VM appear as another
# physical device on your network.
# config.vm.network :bridged
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
# config.vm.forward_port 80, 8080
# d7_config.vm.forward_port 80, 8080
# d7_config.vm.forward_port 443, 8443
# d7_config.vm.forward_port 3306, 3306
# d7_config.vm.forward_port 6081, 6081
# Share an additional folder to the guest VM. The first argument is
# an identifier, the second is the path on the guest to mount the
# folder, and the third is the path on the host to the actual folder.
# config.vm.share_folder "v-data", "/vagrant_data", "../data"
d7_config.vm.share_folder "masterfiles","/var/cfengine/masterfiles","./cf3dcsunix/trunk/"
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file RHEL-6.2-x86_64-sudo.pp in the manifests_path directory.
#
# An example Puppet manifest to provision the message of the day:
#
# # group { "puppet":
# # ensure => "present",
# # }
# #
# # File { owner => 0, group => 0, mode => 0644 }
# #
# # file { '/etc/motd':
# # content => "Welcome to your Vagrant-built virtual machine!
# # Managed by Puppet.\n"
# # }
#
# config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "RHEL-6.2-x86_64-sudo.pp"
# end
# Enable provisioning with chef solo, specifying a cookbooks path (relative
# to this Vagrantfile), and adding some recipes and/or roles.
#
# config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "cookbooks"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
# end
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision :chef_client do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# IF you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
#
#d7_config.vm.provision :shell do |shell|
# shell.inline = "/var/cfengine/bin/cf-agent"
# shell.args = "-Kv -D drupal7Dev,localDev"
d7_config.vm.provision :shell, :path => "cfengine.sh"
#end
#
end
end
@fishnix
Copy link

fishnix commented Jul 10, 2012

no <3 for chef-solo? ;) newest basebox is RHEL6 in cfe3 vagrant stuff https://gist.github.com/3006712 #trololol

@filler
Copy link
Author

filler commented Jul 11, 2012

You know I got nothing but love for dat chef.

I went the https://gist.github.com/3006712/eb28973a7f4fd4c9a44f4f546465c2a21d1e3fc8 route, found that a lot of our cf3 policy ralphed when I tried to poz match the dpl, wp, whatever class(es) I needed to spin up yesterday. Went back to my basebox, Vagrantfile, shell provisioner.

Thanks for bumping the basebox. Ill spin it up next time I need to get up on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment