- Host:
- Mac mini late 2012
- OSX Mountain Lion 10.8.3
- Vagrant 1.2.1 + VMware Fusion Provider
- VMware Fusion 5.0.3
- VM:
- Ubuntu 12.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| irb(main):001:0> require 'facter' | |
| => true | |
| irb(main):002:0> network = Facter.value('network_bond0') or Facter.value('network_eth0') | |
| => "100.10.3.0" | |
| irb(main):003:0> network | |
| => nil | |
| irb(main):004:0> network = Facter.value('network_bond0') || Facter.value('network_eth0') | |
| => "100.10.3.0" | |
| irb(main):005:0> network | |
| => "100.10.3.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff9bffe000 | |
| 0x00007fbaacf5f0a3 in epoll_wait () from /lib/x86_64-linux-gnu/libc.so.6 | |
| (gdb) c | |
| Continuing. | |
| Program received signal SIGPIPE, Broken pipe. | |
| 0x00007fbaadb5f19d in send () from /lib/x86_64-linux-gnu/libpthread.so.0 | |
| (gdb) bt | |
| #0 0x00007fbaadb5f19d in send () from /lib/x86_64-linux-gnu/libpthread.so.0 | |
| #1 0x00000000004fdc6d in ?? () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FindDjangoSettings2() | |
| if strlen($VIRTUAL_ENV) && has('python') | |
| let django_check = system("pip freeze | grep -q Django") | |
| if v:shell_error | |
| " echo 'django not installed.' | |
| else | |
| " echo 'django is installed.' | |
| let output = system("find $VIRTUAL_ENV \\( -wholename '*/lib/*' -or -wholename '*/install/' \\) -or \\( -name 'settings.py' -print0 \\) | tr '\n' ' '") | |
| let outarray= split(output, '[\/]\+') | |
| let module = outarray[-2] . '.' . 'settings' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.provider :virtualbox do |v, override| | |
| override.vm.box = "centos-64-x64-vbox4210" | |
| override.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo puppet resource sshkey github.com ensure=present type=ssh-rsa key="AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| backend WebCluster | |
| <% @web_servers.keys.sort.each do |ws| -%> | |
| server <%= web_servers[ws]['hostname'] %> <%= web_servers[ws]['ipaddress'] %>:80 weight 1 maxconn 100 | |
| <% end -%> | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class apache2 { | |
| class{'apache2::install':}-> | |
| class{'apache2::config':}-> | |
| class{'apache2::service':} | |
| @@ini_setting { $::fqdn : | |
| ensure => present, | |
| path => '/etc/haproxy/haproxy.conf', | |
| section => 'backend WebCluster', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'facter' | |
| output = {} | |
| xml_file = "/usr/share/gugent/site/CustomizeOS/properties.xml" | |
| fact_prefix = "vcac_" | |
| keys_we_care_about = [ | |
| 'VirtualMachine.Admin.AdministratorEmail', | |
| 'VirtualMachine.Admin.Approver', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import json | |
| import pprint | |
| def main(args): | |
| if len(args) >= 2: | |
| for i in args[1:]: | |
| s = open(i).read() | |
| try: | |
| pprint.pprint(json.loads(s)) |