Skip to content

Instantly share code, notes, and snippets.

View swalberg's full-sized avatar

Sean Walberg swalberg

View GitHub Profile
public class Test {
public static void main(String[] args) {
VisTest v1 = new VisTest("v1");
VisTest v2 = new VisTest("v2");
v1.doIt(v2);
}
}
def add_nic(name)
network = find_network(options["net"])
puts network.class
case network
when RbVmomi::VIM::DistributedVirtualPortgroup
switch, pg_key = network.collect 'config.distributedVirtualSwitch', 'key'
port = RbVmomi::VIM.DistributedVirtualSwitchPortConnection(
switchUuid: switch.uuid,
portgroupKey: pg_key)
result = if something
something_else # properly indented
else # lined up with the if
something_else_entirely
end # note we're still lined up

Chef is an amazing tool but to really unlock its potential you need to look at how it integrates with the rest of your technology. This presentation is the story of how the NFL used Chef to transform its siloed infrastructure and practices into something more agile, automated, and reliable.

This presentation will talk about the last 2 years of Chef at the NFL including how we integrated it into our virtualization infrastructure, load balancers, storage, and application performance monitoring. We'll talk about some things that Chef taught us about infrastructure-as-code that we were able to apply to other areas, and things we learned to make our cookbooks easier to manage across groups.

@swalberg
swalberg / vmware_chef.md
Last active September 13, 2016 22:26
VMware and Chef Tools

VMware and Chef tools

Chef and VMware are a natural pairing and there are several tools available to enhance the integration.

Knife is a command-line tool that provides an interface between a local chef-repo and the Chef server and allows you to manipulate objects on the Chef server. Knife plugin allows your computer to talk to a 3rd party systems like vSphere or vRA. A plugin can create a VM in vSphere and then bootstrap it with Chef, for example, or it can expose your vRa catalog to your workstation so you don't need to use a GUI.

The following are the main interfaces with VMware and Chef our "knife" plugins.

This file has been truncated, but you can view the full file.
[{"pid":78038,"tid":1547,"ts":135999022028,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc","src_func":"PushOntoImmediateIncomingQueueLocked"},"dur":89,"tdur":62,"tts":416345},
{"pid":78038,"tid":1547,"ts":135999022077,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":16,"tdur":14,"tts":416370},
{"pid":78038,"tid":1547,"ts":135999022098,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":7,"tdur":4,"tts":416391},
{"pid":78038,"tid":1547,"ts":135999022106,"ph":"X","cat":"toplevel","name":"TaskQueueManager::ProcessTaskFromWorkQueue","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":6,"tdur":3,"tts":416399},
{"pid":78038,"tid":1547,"ts":13600105977
Recipe: aspera::users
* chef_gem[vault] action install (up to date)
* aspera_user[sea] action create
- create sea
- set unix_user to "sea"
- create sea
- set password to "initial"failure
Missing User/Group data: User sea does not appear to exist on the computer (User not found)
tell application "System Events"
tell application "Slack" to activate
key code 18 using {command down}
delay 1
keystroke "/status pomodoro"
delay 0.5
key code 36
delay 0.3
keystroke "/away "
delay 0.5
tell application "System Events"
tell application "Slack" to activate
key code 18 using {command down}
delay 1
keystroke "/status clear"
delay 0.5
key code 36
delay 0.3
keystroke "/away "
delay 0.5
@swalberg
swalberg / gist:1ad5de8235a204cc13bdc98601b537f3
Last active September 27, 2017 15:26 — forked from mattjbarlow/gist:242b66cdae6938d34419
Chef Shell in Test Kitchen
cd C:\Users\vagrant\AppData\local\Temp\kitchen
C:\opscode\chef\embedded\bin\gem install chef-zero
C:\opscode\chef\embedded\bin\chef-zero -d # or run this in another window with out -d
knife cookbook upload -a -c client.rb
C:\Users\vagrant\AppData\local\Temp\kitchen> knife cookbook upload -a -c client.rb -k .\client.pem -s http://localhost:8889 -o .
chef-shell -z -c client.rb -o '<YOUR RECIPE>'