Skip to content

Instantly share code, notes, and snippets.

@iroller
iroller / gist:1583983
Created January 9, 2012 17:21
knife search
$ knife exec -E 'search(:node, "addresses:10.10.0.80").each {|node| puts node[:fqdn]}'
<0 results>
$ knife search node 'addresses:10.10.0.80'
<0 results>
$ knife search node 'network_interfaces_*_addresses:10.10.0.80'
1 items found
WHY?!
for some other nodes it works ok:
#!/usr/bin/env knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
[2014-02-11T13:46:50+00:00] DEBUG: Loading cookbook users's providers from /tmp/kitchen/cache/cookbooks/users/providers/manage.rb
[2014-02-11T13:46:50+00:00] DEBUG: Loaded contents of /tmp/kitchen/cache/cookbooks/users/providers/manage.rb into a provider named users_manage defined in Chef::Provider::UsersManage
[2014-02-11T13:46:50+00:00] DEBUG: Loading cookbook users's resources from /tmp/kitchen/cache/cookbooks/users/resources/manage.rb
[2014-02-11T13:46:50+00:00] DEBUG: Loaded contents of /tmp/kitchen/cache/cookbooks/users/resources/manage.rb into a resource named users_manage defined in Chef::Resource::UsersManage
[2014-02-11T14:09:37+00:00] INFO: Starting chef-zero on port 8889 with repository at repository at /tmp/kitchen
One version per cookbook
[2014-02-11T14:09:37+00:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 11.10.0
[2014-02-11T14:09:37+00:00] INFO: *** Chef 11.10.0 ***
[2014-02-11T14:09:37+00:00] INFO: Chef-client pid: 3733
[2014-02-11T14:09:37+00:00] INFO: Setting the run_list to ["recipe[my-users::default]"] from JSON
[2014-02-11T14:09:37+00:00] INFO: Run List is [recipe[my-users::default]]
[2014-02-11T14:09:37+00:00] INFO: Run List expands to [my-users::default]
@iroller
iroller / chef_conf_2014_public_notes.md
Last active August 29, 2015 13:59
ChefConf2014 notes
@iroller
iroller / RBResizer.swift
Last active January 8, 2020 14:06 — forked from HamptonMakes/RBResizer.swift
Swift Image Resizer
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit