Skip to content
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

Only set custom :box & :box_url values for known Bento boxes. #151

Merged
merged 1 commit into from
Mar 23, 2015

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented Mar 23, 2015

The default values for the :box and :box_url attributes were always
implicitly based on the Bento project's base boxes
(https://github.com/chef/bento). This meant that for a small number of
common/known platforms, the box name and URLs could be pre-calculated to
help with initial out-of-the-box experience.

For example, given a platform name of "ubuntu-14.04", a default box
name of "opscode-ubuntu-14.04" and box URL could be computed (but only
for VirtualBox or VMware-based providers). Any custom platform name
would have to explicitly override the default value for at least :box
if not also for :box_url.

This commit makes the implicit default code for Bento boxes explicit. In
other words, if your platform name does not match the pre-defined Bento
box platforms, the default of :box will be the platform name and the
:box_url will be nil. Similarly, if you use a provider other than
VirtualBox or VMware-*, the default of :box will be the platform name
and the :box_url will be nil.

This update allows for less boilerplate configuration, for example:


---
driver:
  name: vagrant

provisioner:
  name: chef_zero

platforms:
  - name: ubuntu-14.04    # a Bento box, config as before
  - name: ubuntu/trusty64 # defaults to the same name for :box
  - name: windows-8.1     # defaults to the sane name for :box
                          # and a box_url of nil as there is no
                          # sharable windows base box

At a time in the near future, the S3 URLs for Bento boxes could move to
Atlas (formerly Vagrant Cloud) box names, but the same defaulting logic
can apply.

The default values for the `:box` and `:box_url` attributes were always
implicitly based on the Bento project's base boxes
(https://github.com/chef/bento). This meant that for a small number of
common/known platforms, the box name and URLs could be pre-calculated to
help with initial out-of-the-box experience.

For example, given a platform name of `"ubuntu-14.04"`, a default box
name of `"opscode-ubuntu-14.04"` and box URL could be computed (but only
for VirtualBox or VMware-based providers). Any custom platform name
would have to explicitly override the default value for at least `:box`
if not also for `:box_url`.

This commit makes the implicit default code for Bento boxes explicit. In
other words, if your platform name does not match the pre-defined Bento
box platforms, the default of `:box` will be the platform name and the
`:box_url` will be `nil`. Similarly, if you use a provider other than
VirtualBox or VMware-*, the default of `:box` will be the platform name
and the `:box_url` will be `nil`.

This update allows for less boilerplate configuration, for example:

    ---
    driver:
      name: vagrant

    provisioner:
      name: chef_zero

    platforms:
      - name: ubuntu-14.04    # a Bento box, config as before
      - name: ubuntu/trusty64 # defaults to the same name for :box
      - name: windows-8.1     # defaults to the sane name for :box
                              # and a box_url of nil as there is no
                              # sharable windows base box

At a time in the near future, the S3 URLs for Bento boxes could move to
Atlas (formerly Vagrant Cloud) box names, but the same defaulting logic
can apply.
fnichol added a commit that referenced this pull request Mar 23, 2015
…ly-for-bento

Only set custom `:box` & `:box_url` values for known Bento boxes.
@fnichol fnichol merged commit c3987b7 into master Mar 23, 2015
@fnichol fnichol deleted the box-and-box-url-defaults-only-for-bento branch March 23, 2015 02:53
@fnichol fnichol mentioned this pull request Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant