Created
April 23, 2011 06:27
-
-
Save jtimberman/938399 to your computer and use it in GitHub Desktop.
Knife Plugin to list out Ubuntu EC2 AMIs provided by Canonical
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 'chef/knife' | |
| module KnifePlugins | |
| class Ec2AmisUbuntu < Chef::Knife | |
| deps do | |
| begin | |
| require 'ubuntu_ami' | |
| rescue LoadError | |
| Chef::Log.error("Could not load Ubuntu AMI library.") | |
| end | |
| end | |
| banner "knife ec2 amis ubuntu DISTRO [TYPE]" | |
| def run | |
| distro = name_args[0] | |
| type = name_args[1] | |
| ami_list = UbuntuAmi.new(distro).run[type] || UbuntuAmi.new(distro).run | |
| output(format_for_display(ami_list)) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment