Skip to content

Instantly share code, notes, and snippets.

View vinyar's full-sized avatar

Mr. Pacman vinyar

  • Launch Consulting
  • Seattle
View GitHub Profile
@vinyar
vinyar / check.md
Created November 14, 2015 01:37 — forked from kwilczynski/check.md
Recipe / Role check in Chef

If you want to check whether a node run_list includes a specific role (upon expansion), then you could use role? method on the Node object:

node.role?('name')

Alternatively, you can see whether either would work for you:

node.roles.include?('name')

node.run_list?('role[name]')

same run in debug mode (pem/id/etc.. scrubbed)
Please let me know if you need a specific ID inside XML
```ruby
INFO: Using configuration from D:/base/.chef/knife.rb
INFO: validating...
DEBUG: Looking for key azure_mgmt_cert and found value
DEBUG: Looking for key azure_publish_settings_file and found value D:\base\.chef\myazure.publishsettings
DEBUG: Looking for key azure_publish_settings_file and found value D:\base\.chef\myazure.publishsettings
DEBUG: Looking for key azure_subscription_id and found value 11111111-660b-4165-9bff-11111111111
@vinyar
vinyar / gitconfig.sh
Created October 28, 2015 18:38
Git config file
# set your user tokens as environment variables, such as ~/.secrets
# See the README for examples.
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@vinyar
vinyar / chef-shell output.rb
Last active August 26, 2015 18:00
chef-shell output
alex was here
Last login: Mon Aug 17 17:51:24 on ttys004
alexvinyar@seavinyar02 ~ $ chef-shell
loading configuration: none (standalone session)
Session type: standalone
Loading.......done.
This is the chef-shell.
Chef Version: 12.3.0
@vinyar
vinyar / 1 - pega parser.rb
Last active August 29, 2015 14:27
Pulling out pega space requirements via ruby
require 'nokogiri'
file = File.open('/pega_cookbook/files/default/prpcUtils.xml')
doc = Nokogiri::XML(f)
needed = doc.xpath("//pega:hasenoughspace/@needed").text
@vinyar
vinyar / output.rb
Created July 2, 2015 22:23
post bootstrap first run error - Error connecting to https://s3-external-1.amazonaws.com/opscode-platform-product
login as: chef
[email protected]'s password:
Last login: Tue Jun 2 10:54:38 2015 from 38.104.1.242
_______________
/ ___/ __/_ __/
/ (_ / _/ / /
\___/___/ /_/
_______ ___________
/ __/ _ \/ __/ __/ _ \
_\ \/ ___/ _// _// // /
@vinyar
vinyar / Cookbook dependency reverse lookup.rb
Last active September 5, 2015 21:31
cookbook reverse dependency lookup
Its a cookbook class that we use to abstract cookbooks and their
dependencies. The key method to look at is dependency_hash which creates
a hash based on the dependencies of the cookbook.
We do not explicitly do a reverse dependency lookup but we can use this
hash to infer a change in dependencies from a change in any cookbook in
an environment. So the flow is:
1. I change cookbook A and it gets sent to the chef server and indexed
in berks.
@vinyar
vinyar / Bootstrapping chef client behind firewall
Created June 25, 2015 18:24
Bootstrapping chef client behind firewall
https://docs.chef.io/knife_bootstrap.html#custom-templates
https://docs.chef.io/install_bootstrap.html
https://docs.chef.io/knife_bootstrap.html
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb
Blog:
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/
http://www.tomduffield.com/bootstrapping-without-the-internet/
@vinyar
vinyar / waffle.io
Created June 25, 2015 18:06
waffle.io
waffle.io
can put kanban on top of github.
can also roll up multiple github repos.
can do milestones based on lables or tags.
chet/test-driven-infrastructure
seems like a much better way of capturing of exactly what we're working on.
{"ssl": {"verify": false}}