Plugins Directory in LittleChef

20 views
Skip to first unread message

chengkai liang

unread,
Jan 13, 2015, 4:02:52 PM1/13/15
to littl...@googlegroups.com
Hi,

So Littlechef supports plugins to extension it.  It looks like the plugins are loaded from plugins directory come with LittleChef.  Is there a way to load plugins from different directory other than itself?

-Chengkai

chengkai liang

unread,
Jan 13, 2015, 4:18:13 PM1/13/15
to littl...@googlegroups.com
I just found out plugins can also be loaded from plugins directory within kitchen.

chengkai liang

unread,
Jan 13, 2015, 5:12:52 PM1/13/15
to littl...@googlegroups.com
So the follow-up question: I created a plugins directory under my kitchen, and create a python script called get_host_ip.py (simply modify save_ip.py the examples directory).  Now I ran fix node:my_node, a chef recipe ran but nothing output from the plugin I wrote.  Here's my python plugin code:

import socket

from fabric.api import env
from littlechef import chef

def execute( node ):
    """
    get an ipv4 by calling gethostbyname socket function
    """
    hostname = node['hostname']
    ipaddress = socket.gethostbyname( hostname )
    print "node {0}, ipaddress {1}".format(hostname, ipaddress)


Anything wrong?

-Chengkai

Miquel Torres

unread,
Jan 14, 2015, 7:52:49 AM1/14/15
to littl...@googlegroups.com
Did you try "fix node:my_node plugin:save_ip" ?
> --
> You received this message because you are subscribed to the Google Groups
> "littlechef" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to littlechef+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

chengkai liang

unread,
Jan 14, 2015, 9:41:29 AM1/14/15
to littl...@googlegroups.com
Thanks for this tip.  I didn't aware plugin: command.

-Chengkai
Reply all
Reply to author
Forward
0 new messages