- From: Peter Norton <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Managing an ec2 instance and security group together with chef?
- Date: Tue, 20 Sep 2011 14:39:12 -0400
>
>
secgroup.save
Great, that may be what I was missing.
>
You can also omit the :ip_permissions => nil, :owner_id => nil parts
Those are placeholders in case I want to add them in the future, but I
understand that since that matches the default arguments they don't
need to be there. If I get this into a state where it's worth
sharing, I may remove that or comment it out until it's needed so that
it doesn't confuse anyone.
-Peter
On Tue, Sep 20, 2011 at 11:15 AM, John E. Vincent (lusis)
<
>
wrote:
>
On Tue, Sep 20, 2011 at 11:03 AM, Peter Norton
>
<
>
>
wrote:
>
>
>
> def run
>
> $stdout.sync = true
>
>
>
> secgroup_def = { :name => config[:name], :description =>
>
> config[:description], :ip_permissions => nil, :owner_id => nil }
>
>
>
>
>
> conn = Fog::Compute.new(
>
> :provider => 'AWS',
>
> :aws_access_key_id => Chef::Config[:knife][:aws_access_key_id],
>
> :aws_secret_access_key =>
>
> Chef::Config[:knife][:aws_secret_access_key],
>
> :region => locate_config_value(:region)
>
> )
>
> # conn = connection.create()
>
> secgroup = conn.security_groups.new(secgroup_def)
>
>
>
>
Works fine for me. The only thing I see you missing is a call to:
>
>
secgroup.save
>
>
You can also omit the :ip_permissions => nil, :owner_id => nil parts
>
>
> Does anyone know of a place I can look for an example of how to do
>
> this? I don't want to spend much more time on this now, and I'm
>
> pretty sure I can do this in python+boto in about an hour, but I'd
>
> prefer to not have to write yet another tool.
>
>
>
> -Peter
>
[chef] Getting my node's ip address, Geoff Meakin Acid, 09/19/2011
Archive powered by MHonArc 2.6.16.