Chef-provisioning - setting url-endpoint for the fog/AWS driver

Hi.

We have a private cloud solution that has an EC2 compatable API. I’m trying to configure chef-provisioning to use that instead of AWS.

What I’m having problems with is where the configuration is supposed to go to set the endpoint-url for the EC2 API.

I have found the line in the code that does this:
https://github.com/chef/chef-provisioning-fog/blob/c8df0ed605dbb2cf80ddb7c384a79378d3b6d5ab/lib/chef/provisioning/fog_driver/providers/aws.rb#L225?

…but that seems to be using something called compute_options that I’m not sure where to put?

The configuration I currently have for configuring the Fog/AWS driver is this:

require ‘chef/provisioning/fog_driver/driver’

with_machine_options({
:bootstrap_options => {
:flavor_id => ‘t2.medium’,
},
:ssh_username => ‘centos’,
:image_id => ‘ami-96a818fe’
})

so I’m not sure where to put the “ec2_endpoint” configuration in order to point it towards our own EC2 API instead of Amazon.

I know this is a bit silly, but I’m just not quite getting the configuration syntax of chef. So sorry for the silly question :-/

-Kind regards,

Stefan Freyr

Hi,

This has some examples of setting compute_options:

So think you would do:

with_driver 'fog:AWS', :compute_options => { :ec2_endpoint =>
'your_endpoint' }

But I haven't tested this.

Regards,
Christine Draper

On Thu, Apr 9, 2015 at 1:51 PM, Stefán Freyr Stefánsson <
stefan@wuxinextcode.com> wrote:

Hi.

We have a private cloud solution that has an EC2 compatable API. I'm
trying to configure chef-provisioning to use that instead of AWS.

What I'm having problems with is where the configuration is supposed to
go to set the endpoint-url for the EC2 API.

I have found the line in the code that does this:

https://github.com/chef/chef-provisioning-fog/blob/c8df0ed605dbb2cf80ddb7c384a79378d3b6d5ab/lib/chef/provisioning/fog_driver/providers/aws.rb#L225

...but that seems to be using something called compute_options that I'm
not sure where to put?

The configuration I currently have for configuring the Fog/AWS driver is
this:

require 'chef/provisioning/fog_driver/driver'

with_machine_options({
:bootstrap_options => {
:flavor_id => 't2.medium',
},
:ssh_username => 'centos',
:image_id => 'ami-96a818fe'
})

so I'm not sure where to put the "ec2_endpoint" configuration in order
to point it towards our own EC2 API instead of Amazon.

I know this is a bit silly, but I'm just not quite getting the
configuration syntax of chef. So sorry for the silly question :-/

-Kind regards,

Stefan Freyr

Hi Christine and thanks for your answers to both my questions.

Not sure how I managed to miss that example you reference but that looks like it’s exactly what I need.

-Stefan


From: Christine Draper christine_draper@thirdwaveinsights.com
Sent: Friday, April 10, 2015 2:46 AM
To: chef@lists.opscode.com
Subject: [chef] Re: chef-provisioning - setting url-endpoint for the fog/AWS driver.

Hi,

This has some examples of setting compute_options:

So think you would do:

with_driver ‘fog:AWS’, :compute_options => { :ec2_endpoint => ‘your_endpoint’ }

But I haven’t tested this.

Regards,
Christine Draper

On Thu, Apr 9, 2015 at 1:51 PM, Stefán Freyr Stefánsson <stefan@wuxinextcode.commailto:stefan@wuxinextcode.com> wrote:

Hi.

We have a private cloud solution that has an EC2 compatable API. I’m trying to configure chef-provisioning to use that instead of AWS.

What I’m having problems with is where the configuration is supposed to go to set the endpoint-url for the EC2 API.

I have found the line in the code that does this:
https://github.com/chef/chef-provisioning-fog/blob/c8df0ed605dbb2cf80ddb7c384a79378d3b6d5ab/lib/chef/provisioning/fog_driver/providers/aws.rb#L225?

…but that seems to be using something called compute_options that I’m not sure where to put?

The configuration I currently have for configuring the Fog/AWS driver is this:

require ‘chef/provisioning/fog_driver/driver’

with_machine_options({
:bootstrap_options => {
:flavor_id => ‘t2.medium’,
},
:ssh_username => ‘centos’,
:image_id => ‘ami-96a818fe’
})

so I’m not sure where to put the “ec2_endpoint” configuration in order to point it towards our own EC2 API instead of Amazon.

I know this is a bit silly, but I’m just not quite getting the configuration syntax of chef. So sorry for the silly question :-/

-Kind regards,

Stefan Freyr