Chef-metal AWS Profile


#1

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because this
is required for the AWS CLI, and boto as well, which also use this file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also didn’t
work. Basically, NOTHING has worked. I keep getting the error above. Where
should I put this?

To make matters more confusing, the gem seems to have been installed to my
home directory under .chefdk. I don’t know why as I use the gem that came
with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


#2

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang doug.garstang@gmail.com
wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because this
is required for the AWS CLI, and boto as well, which also use this file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to my
home directory under .chefdk. I don’t know why as I use the gem that came
with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#3

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it works?
Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <doug.garstang@gmail.com

wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because this
is required for the AWS CLI, and boto as well, which also use this file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to
my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#4

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <doug.garstang@gmail.com

wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to
my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#5

In my ec2 recipe, I set
ENV[‘AWS_CONFIG_FILE’] = ‘/path/to/.aws/config’

prior to the

with_driver(…)

statement, and that’s working for me.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to
my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Justin Dossey
Practice Owner
New Context Services, Inc


#6

It’s not my day. I have the same thing Justin.

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘~/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

~/.aws/config:
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[profile test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

Running ‘chef-client -z simple.rb’ gets me:

Recipe: @recipe_files::/Users/doug/simple.rb

  • machine[mario] action converge[2014-10-14T10:07:23-07:00] INFO:
    Processing machine[mario] action converge
    (@recipe_files::/Users/doug/simple.rb line 14)

================================================================================
Error executing action converge on resource ‘machine[mario]’

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

On Tue, Oct 14, 2014 at 9:56 AM, Justin Dossey <justin.dossey@newcontext.com

wrote:

In my ec2 recipe, I set
ENV[‘AWS_CONFIG_FILE’] = ‘/path/to/.aws/config’

prior to the

with_driver(…)

statement, and that’s working for me.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <doug.garstang@gmail.com

wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed
to my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Justin Dossey
Practice Owner
New Context Services, Inc


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#7

Instead of using ‘~/.aws/config’, try using the fully-qualified path (maybe
’/Users/doug/.aws/config’?). I have come across programs that don’t play
well with '~"

Tom Duffield — Software Development Engineer

651.769.7497 – tom@getchef.com – *my: *Linkedin
http://www.linkedin.com/in/thomasduffield Twitter
http://www.twitter.com/tomduffield
CHEF

GETCHEF.COM http://www.getchef.com/

TM

getchef.com http://www.getchef.com/ Blog
http://www.opscode.com/blog/ Facebook
https://www.facebook.com/getchefdotcom Twitter
https://twitter.com/chef Youtube https://www.youtube.com/getchef

On Tue, Oct 14, 2014 at 10:08 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

It’s not my day. I have the same thing Justin.

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘~/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

~/.aws/config:
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[profile test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

Running ‘chef-client -z simple.rb’ gets me:

Recipe: @recipe_files::/Users/doug/simple.rb

  • machine[mario] action converge[2014-10-14T10:07:23-07:00] INFO:
    Processing machine[mario] action converge
    (@recipe_files::/Users/doug/simple.rb line 14)

================================================================================
Error executing action converge on resource ‘machine[mario]’

================================================================================

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

On Tue, Oct 14, 2014 at 9:56 AM, Justin Dossey <
justin.dossey@newcontext.com> wrote:

In my ec2 recipe, I set
ENV[‘AWS_CONFIG_FILE’] = ‘/path/to/.aws/config’

prior to the

with_driver(…)

statement, and that’s working for me.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com
wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the
simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed
to my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Justin Dossey
Practice Owner
New Context Services, Inc


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#8

A few times you’ve pasted that your config has the entry "[profile test]"
but the output from cat shows only “[test]”, so I’m not sure which is
accurate.

If the output from cat is correct, then the likely issue is that you have
only [test] in the second entry; change it to [profile test] and then
with_driver
’fog:AWS:test’ or export CHEF_DRIVER=“fog:AWS:test:us-east-1” should work.
The AWS config parser looks for the string “profile XXX” in the config
file.

-John

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to
my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#9

This could be just how you’re testing stuff, but I think you need to rename
[test] to [profile test] in your config file. fog:AWS:test:us-east-1
should work; fog:AWS:test is worth a try, though. I would set CHEF_DRIVER
env var and remove stuff from the recipe now until you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see the
value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed to
my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s what
boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#10

Here’s my latest attempt. It’s still not working. I removed the 'profile’
prefix from the profiles in the aws config file, just to test. They need to
stay there however, as the boto library and more importantly, the AWS CLI
require it.

~/.aws/config:
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

simple.rb"
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’
with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}
with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

So, with that I got the same error. I then removed the driver stuff from
simple.rb, so that I had this:

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

machine ‘mario’ do
tag 'itsa_me
converge true
end

and I set CHEF_DRIVER=aws:fog:test. Tried again. Failed again. I’m still
getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

Ran with -l debug. Output is here… http://pastebin.com/EmYFA35x

Doug.

On Tue, Oct 14, 2014 at 10:13 AM, John Keiser jkeiser@getchef.com wrote:

This could be just how you’re testing stuff, but I think you need to
rename [test] to [profile test] in your config file.
fog:AWS:test:us-east-1 should work; fog:AWS:test is worth a try, though.
I would set CHEF_DRIVER env var and remove stuff from the recipe now until
you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <doug.garstang@gmail.com

wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the simple.rb
file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed
to my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#11

I’ve also looked into the get_aws_profile() method in
chef_metal_fog/providers/aws.rb which seems to be where it’s failing.

Now, I know I’m not much of a ruby guy, but I see this…

if compute_options[:aws_access_key_id]
Chef::Log.debug(“Using AWS driver access key options”)
aws_profile = {
:aws_access_key_id => compute_options[:aws_access_key_id],
:aws_secret_access_key =>
compute_options[:aws_secret_access_key],
:aws_security_token => compute_options[:aws_session_token],
:region => compute_options[:region]
}
< a couple of else if statememnts >
elsif ENV[‘AWS_PROFILE’]

I threw a simple puts("FOO’) in there and even though I had the AWS_PROFILE
environment variable set, the puts wasn’t printed. Another puts() at the
start of the method() is displayed. So, I’m a bit confused about what is
going on.

Doug.

On Tue, Oct 14, 2014 at 10:32 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

Here’s my latest attempt. It’s still not working. I removed the 'profile’
prefix from the profiles in the aws config file, just to test. They need to
stay there however, as the boto library and more importantly, the AWS CLI
require it.

~/.aws/config:
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

simple.rb"
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’
with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}
with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

So, with that I got the same error. I then removed the driver stuff from
simple.rb, so that I had this:

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

machine ‘mario’ do
tag 'itsa_me
converge true
end

and I set CHEF_DRIVER=aws:fog:test. Tried again. Failed again. I’m still
getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config or
~/.aws/config?

Ran with -l debug. Output is here… http://pastebin.com/EmYFA35x

Doug.

On Tue, Oct 14, 2014 at 10:13 AM, John Keiser jkeiser@getchef.com wrote:

This could be just how you’re testing stuff, but I think you need to
rename [test] to [profile test] in your config file.
fog:AWS:test:us-east-1 should work; fog:AWS:test is worth a try, though.
I would set CHEF_DRIVER env var and remove stuff from the recipe now until
you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com
wrote:

Looking at your issue, I’m guessing the problem is that it’s looking in
~/.aws/config and you have ~/.aws.config (at least from the mail, maybe it
was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the
simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed
to my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list | grep
chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#12

And, I also just tried this…

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’,
:aws_access_key_id => ‘xxx’,
:aws_secret_access_key => ‘yyy’
}

You guessed it. Didn’t work. Same error, even though the code clearly shows
that it gives setting the creds here the top priority.

Doug.

On Tue, Oct 14, 2014 at 10:38 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

I’ve also looked into the get_aws_profile() method in
chef_metal_fog/providers/aws.rb which seems to be where it’s failing.

Now, I know I’m not much of a ruby guy, but I see this…

if compute_options[:aws_access_key_id]
Chef::Log.debug(“Using AWS driver access key options”)
aws_profile = {
:aws_access_key_id => compute_options[:aws_access_key_id],
:aws_secret_access_key =>
compute_options[:aws_secret_access_key],
:aws_security_token => compute_options[:aws_session_token],
:region => compute_options[:region]
}
< a couple of else if statememnts >
elsif ENV[‘AWS_PROFILE’]

I threw a simple puts("FOO’) in there and even though I had the AWS_PROFILE
environment variable set, the puts wasn’t printed. Another puts() at the
start of the method() is displayed. So, I’m a bit confused about what is
going on.

Doug.

On Tue, Oct 14, 2014 at 10:32 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Here’s my latest attempt. It’s still not working. I removed the 'profile’
prefix from the profiles in the aws config file, just to test. They need to
stay there however, as the boto library and more importantly, the AWS CLI
require it.

~/.aws/config:
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

simple.rb"
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’
with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}
with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

So, with that I got the same error. I then removed the driver stuff from
simple.rb, so that I had this:

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

machine ‘mario’ do
tag 'itsa_me
converge true
end

and I set CHEF_DRIVER=aws:fog:test. Tried again. Failed again. I’m still
getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

Ran with -l debug. Output is here… http://pastebin.com/EmYFA35x

Doug.

On Tue, Oct 14, 2014 at 10:13 AM, John Keiser jkeiser@getchef.com
wrote:

This could be just how you’re testing stuff, but I think you need to
rename [test] to [profile test] in your config file.
fog:AWS:test:us-east-1 should work; fog:AWS:test is worth a try, though.
I would set CHEF_DRIVER env var and remove stuff from the recipe now until
you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com
wrote:

Looking at your issue, I’m guessing the problem is that it’s looking
in ~/.aws/config and you have ~/.aws.config (at least from the mail, maybe
it was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is because
this is required for the AWS CLI, and boto as well, which also use this
file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the
simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That also
didn’t work. Basically, NOTHING has worked. I keep getting the error above.
Where should I put this?

To make matters more confusing, the gem seems to have been installed
to my home directory under .chefdk. I don’t know why as I use the gem that
came with the chef-dk and that normally puts gems in /opt/chefdk/embedded
(except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list |
grep chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#13

And… a puts compute_options shows only this:

{:provider=>“AWS”, :region=>""}

Really confused. :frowning:

Doug.

On Tue, Oct 14, 2014 at 10:43 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

And, I also just tried this…

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’,
:aws_access_key_id => ‘xxx’,
:aws_secret_access_key => ‘yyy’
}

You guessed it. Didn’t work. Same error, even though the code clearly
shows that it gives setting the creds here the top priority.

Doug.

On Tue, Oct 14, 2014 at 10:38 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

I’ve also looked into the get_aws_profile() method in
chef_metal_fog/providers/aws.rb which seems to be where it’s failing.

Now, I know I’m not much of a ruby guy, but I see this…

if compute_options[:aws_access_key_id]
Chef::Log.debug(“Using AWS driver access key options”)
aws_profile = {
:aws_access_key_id => compute_options[:aws_access_key_id],
:aws_secret_access_key =>
compute_options[:aws_secret_access_key],
:aws_security_token => compute_options[:aws_session_token],
:region => compute_options[:region]
}
< a couple of else if statememnts >
elsif ENV[‘AWS_PROFILE’]

I threw a simple puts("FOO’) in there and even though I had the AWS_PROFILE
environment variable set, the puts wasn’t printed. Another puts() at the
start of the method() is displayed. So, I’m a bit confused about what is
going on.

Doug.

On Tue, Oct 14, 2014 at 10:32 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Here’s my latest attempt. It’s still not working. I removed the
’profile’ prefix from the profiles in the aws config file, just to test.
They need to stay there however, as the boto library and more importantly,
the AWS CLI require it.

~/.aws/config:
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

simple.rb"
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’
with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}
with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

So, with that I got the same error. I then removed the driver stuff
from simple.rb, so that I had this:

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

machine ‘mario’ do
tag 'itsa_me
converge true
end

and I set CHEF_DRIVER=aws:fog:test. Tried again. Failed again. I’m still
getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

Ran with -l debug. Output is here… http://pastebin.com/EmYFA35x

Doug.

On Tue, Oct 14, 2014 at 10:13 AM, John Keiser jkeiser@getchef.com
wrote:

This could be just how you’re testing stuff, but I think you need to
rename [test] to [profile test] in your config file.
fog:AWS:test:us-east-1 should work; fog:AWS:test is worth a try, though.
I would set CHEF_DRIVER env var and remove stuff from the recipe now until
you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com
wrote:

Looking at your issue, I’m guessing the problem is that it’s looking
in ~/.aws/config and you have ~/.aws.config (at least from the mail, maybe
it was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced by
something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is
because this is required for the AWS CLI, and boto as well, which also use
this file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I see
the value in the back trace).

I’ve also tried putting variations of the following into the
simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That
also didn’t work. Basically, NOTHING has worked. I keep getting the error
above. Where should I put this?

To make matters more confusing, the gem seems to have been
installed to my home directory under .chefdk. I don’t know why as I use the
gem that came with the chef-dk and that normally puts gems in
/opt/chefdk/embedded (except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list |
grep chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


#14

Per a previous email, it looks like your AWS config file has section
headers that don’t match the parser. It looks like you removed the word
"profile" from your ~/.aws/config file. It will look for [profile XXX] or
use the one marked [default] if you don’t specify a profile.

It should look like the following:

[profile test]

[profile prod]

And then with_driver ‘fog:AWS:test’ or export CHEF_DRIVER=“fog:AWS:test:us-
east-1” should work.

-John

On Tue, Oct 14, 2014 at 10:45 AM, Douglas Garstang doug.garstang@gmail.com
wrote:

And… a puts compute_options shows only this:

{:provider=>“AWS”, :region=>""}

Really confused. :frowning:

Doug.

On Tue, Oct 14, 2014 at 10:43 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

And, I also just tried this…

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’,
:aws_access_key_id => ‘xxx’,
:aws_secret_access_key => ‘yyy’
}

You guessed it. Didn’t work. Same error, even though the code clearly
shows that it gives setting the creds here the top priority.

Doug.

On Tue, Oct 14, 2014 at 10:38 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

I’ve also looked into the get_aws_profile() method in
chef_metal_fog/providers/aws.rb which seems to be where it’s failing.

Now, I know I’m not much of a ruby guy, but I see this…

if compute_options[:aws_access_key_id]
Chef::Log.debug(“Using AWS driver access key options”)
aws_profile = {
:aws_access_key_id => compute_options[:aws_access_key_id],
:aws_secret_access_key =>
compute_options[:aws_secret_access_key],
:aws_security_token => compute_options[:aws_session_token],
:region => compute_options[:region]
}
< a couple of else if statememnts >
elsif ENV[‘AWS_PROFILE’]

I threw a simple puts("FOO’) in there and even though I had the AWS_PROFILE
environment variable set, the puts wasn’t printed. Another puts() at the
start of the method() is displayed. So, I’m a bit confused about what is
going on.

Doug.

On Tue, Oct 14, 2014 at 10:32 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Here’s my latest attempt. It’s still not working. I removed the
’profile’ prefix from the profiles in the aws config file, just to test.
They need to stay there however, as the boto library and more importantly,
the AWS CLI require it.

~/.aws/config:
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

simple.rb"
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’
with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}
with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

So, with that I got the same error. I then removed the driver stuff
from simple.rb, so that I had this:

simple.rb:
require ‘chef_metal’

ENV[‘AWS_CONFIG_FILE’] = ‘/Users/doug/.aws/config’

with_machine_options :bootstrap_options => {
:flavor_id => ‘m3.medium’,
:key_name => ‘ec2-default’,
:groups => [‘slice-default’],
:image_id => ‘ami-fa7dc492’,
:source_key_path =>
’/Users/doug/git/ops-secure/ec2_keypairs/test-ec2-default’
}

machine ‘mario’ do
tag 'itsa_me
converge true
end

and I set CHEF_DRIVER=aws:fog:test. Tried again. Failed again. I’m
still getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef config
or ~/.aws/config?

Ran with -l debug. Output is here… http://pastebin.com/EmYFA35x

Doug.

On Tue, Oct 14, 2014 at 10:13 AM, John Keiser jkeiser@getchef.com
wrote:

This could be just how you’re testing stuff, but I think you need to
rename [test] to [profile test] in your config file.
fog:AWS:test:us-east-1 should work; fog:AWS:test is worth a try, though.
I would set CHEF_DRIVER env var and remove stuff from the recipe now until
you’ve got this debugged.

If it’s still failing after you rename the profile section to [profile
test] in ~/.aws/config, a debug log running chef-client -l debug would
probably be helpful.

On Tue, Oct 14, 2014 at 9:53 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

John,

File is ~/.aws/config. That was a typo in my initial email.

Douglass-MacBook-Pro:~ doug$ cat ~/.aws/config
[profile prod]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

[test]
aws_access_key_id = xxx
aws_secret_access_key = xxx
region = us-east-1

On Tue, Oct 14, 2014 at 9:40 AM, John Keiser jkeiser@getchef.com
wrote:

Looking at your issue, I’m guessing the problem is that it’s looking
in ~/.aws/config and you have ~/.aws.config (at least from the mail, maybe
it was a typo?).

Can you try putting the file at that location and let us know if it
works? Is ~/.aws.config a standard location we should be handling as well?

On Tue, Oct 14, 2014 at 9:35 AM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

No replies. Is chef-metal an active project? Has it been replaced
by something else?

Doug

On Mon, Oct 13, 2014 at 4:47 PM, Douglas Garstang <
doug.garstang@gmail.com> wrote:

Not sure if this the right place to ask a chef-metal question.

Can’t seem to get the AWS profiles to work. I keep getting this:

RuntimeError

No AWS profile specified! Are you missing something in the Chef
config or ~/.aws/config?

My ~/.aws.config contains this:

[profile prod]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

[profile test]
aws_access_key_id = <key_id>
aws_secret_access_key =
region = us-east-1

The reason the profille names have ‘profile’ at the front is
because this is required for the AWS CLI, and boto as well, which also use
this file.

I’ve tried setting these:

export CHEF_DRIVER="fog:AWS:test:us-east-1"
export CHEF_DRIVER=“fog:AWS:profile test:us-east-1”

export CHEF_DRIVER="fog:AWS:<aws account #>:us-east-1"
export CHEF_DRIVER=“fog:AWS:<aws account #> test:us-east-1”

None of those work (although they are being picked up because I
see the value in the back trace).

I’ve also tried putting variations of the following into the
simple.rb file:

with_driver 'fog:AWS:test’
with_driver ‘fog:AWS:profile test’

and so on. Doesn’t work.

I also tried this:

with_driver 'fog:AWS:test’
machine ‘mario’ do
tag 'itsa_me’
converge true
end

Didn’t work. I tried this:

machine ‘mario’ do
tag 'itsa_me’
driver 'fog:AWS:test’
converge true
end

and many many permutations. Also didn’t work.

I then tried to put the settings into my ~/.chef/knife.rb. That
also didn’t work. Basically, NOTHING has worked. I keep getting the error
above. Where should I put this?

To make matters more confusing, the gem seems to have been
installed to my home directory under .chefdk. I don’t know why as I use the
gem that came with the chef-dk and that normally puts gems in
/opt/chefdk/embedded (except for the chef-metal ones and it’s dependancies).

Also,
Douglass-MacBook-Pro:~ doug$ /opt/chefdk/embedded/bin/gem list |
grep chef-metal
chef-metal (0.14.2)
chef-metal-fog (0.9)
chef-metal-vagrant (0.6)

Thanks,
Doug.

I’ve also tried using ‘profile test’ instead of test, since that’s
what boto requi


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627


Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garstang@gmail.com
Cell: +1-805-340-5627