Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Add ability to use default homebrew install location by setting a custom fact. #51

Closed
wants to merge 2 commits into from

Conversation

ssgelm
Copy link

@ssgelm ssgelm commented May 4, 2014

If the "use_default_homebrew" fact exists, the module will do the following:

  • Set homebrew directory to /usr/local
  • Remove custom boxen install commands
  • Set the provider to use standard install commands
  • Add a new custom "latest" command to homebrew to get the latest version of a package

This is desirable for many people as discussed at boxen/puppet-boxen#20.

If the "use_default_homebrew" fact exists, the module will do the following:
 * Set homebrew directory to /usr/local
 * Remove custom boxen install commands
 * Set the provider to use standard install commands
 * Add a new custom "latest" command to homebrew to get the latest version of a package
@ssgelm
Copy link
Author

ssgelm commented May 12, 2014

Looks like travis failed for an unrelated reason relating to the gemfile... Can someone try rerunning it?

@tarebyte
Copy link
Member

tarebyte commented Jun 3, 2014

@ssgelm I re-ran the specs for you.

@ssgelm
Copy link
Author

ssgelm commented Jun 4, 2014

@tarebyte Thanks! Puppet lint issues fixed. 😄

@hanjianwei
Copy link
Contributor

Any progress on this?

I would like to have homebrew install in its standard location 👍

@tarebyte
Copy link
Member

This looks ok to me. @rafaelfranca @fromonesrc can I get a second opinion?

@hanjianwei
Copy link
Contributor

Try to make it work on my Mac. I have 2 questions:

  1. puppet-boxen and puppet-homebrew both have params to specify Homebrew location. Which one should I use?
    puppet-boxen uses $homebrewdir while puppet-homebrew uses $installdir to specify Homebrew folder. Why not just use one? e.g. puppet-boxen can use $homebrew::installdir to get Homebrew folder or puppet-homebrew use $boxen::config::homebrewdir as its install location. In this way we can specify only one variable in hiera to specify Homebrew location and it is more consistent.
  2. puppet-boxen hardcodes homebrew path in env.sh.erb.
    We should use $boxen::config::homebrewdir instead of $boxen::config::home to define the paths.

@riveramj
Copy link

I tested this out on a new Boxen install and it worked fine. I created a release based off of the original branch and used

# Setup config for Homebrew
require 'fileutils'

facts_dir = '/opt/boxen/config/facts'
homebrew_json = '{"use_default_homebrew": true}'

FileUtils.mkdir_p facts_dir
File.write "#{facts_dir}/homebrew.json", homebrew_json

in my boxen.rb file.

fwiw 👍 from me!

@dgoodlad
Copy link
Contributor

I'm 👎 on this approach, but 👍 to the goal of having homebrew's install location configurable.

Hardcoding any of these paths seems like a recipe for frustration. I'd much rather generalize the homebrew install directory, and be able to configure its install location with hiera (not facts).

@riveramj
Copy link

👍 to configurable over hardcoded. I'll give it a shot and see if I can open a diff PR with it working.

@kyounger
Copy link

To note, one of the great advantages of having the default install is bottles working properly.

@keo
Copy link

keo commented Dec 16, 2014

I'd love to see homebrew in /usr/local for all the precompiled bottles. I can't install encfs because it doesn't compile because of the non-standard location. It would be compiling in /usr/local (and I'd have a bottle too, anyway)

👍

@dgoodlad
Copy link
Contributor

This is now possible with the latest release, 1.11.2, along with the most recent release of puppet-boxen.

After updating those two modules in your Puppetfile, add a file in your boxen repo, $BOXEN_HOME/repo/facts.d/whatever.yaml:

homebrew_root: /usr/local

@dgoodlad dgoodlad closed this Dec 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants