Skip to content

Syntax for specifying flavor/image? #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cstewart87 opened this issue Mar 3, 2014 · 3 comments
Closed

Syntax for specifying flavor/image? #10

cstewart87 opened this issue Mar 3, 2014 · 3 comments

Comments

@cstewart87
Copy link
Contributor

Unless I missed an obvious example (which is very possible), I'm not sure how to specify these options.

machine 'test'
  recipe 'apt'
  provisioner_options(
    :flavor_ref => 2,
    :image_ref => 67,
    :name => 'chef_test'
  )
end

Error:

ArgumentError
-------------
flavor_ref and name are required for this operation
@jkeiser
Copy link
Contributor

jkeiser commented Mar 5, 2014

Is this for DigitalOcean or EC2?

@jkeiser
Copy link
Contributor

jkeiser commented Mar 5, 2014

If it's DigitalOcean, you do it like this:

machine 'test'
  recipe 'apt'
  provisioner_options :bootstrap_options => {
    :flavor_id => 2,
    :image_id => 67
  }
}

Or better yet, outside the machine (separate your logical from your physical):

with_provisioner_options :bootstrap_options => {
    :flavor_id => 2,
    :image_id => 67
  }
}

# This (and any other machines) will pick up the above provisioner options
machine 'test' do
  recipe 'apt'
end

bootstrap_options is the set of options you normally pass to Fog's bootstrap method.

Metal also supports flavor_name and image_name, btw, in which case it will look up the id for you. For example, :flavor_name => '512MB' and image_name => 'CentOS 6.4 x32'. region_name => 'San Francisco 1' works too.

@jkeiser
Copy link
Contributor

jkeiser commented Mar 12, 2014

Closing as answered--please reopen if it really isn't :)

@jkeiser jkeiser closed this as completed Mar 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants