Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Simplify personal config as hiera-managed params #119

Merged
merged 1 commit into from
Dec 21, 2014

Conversation

dgoodlad
Copy link
Contributor

This is intended to be exposed and used via hiera. Example usage (yaml):

boxen::personal::projects:
  - some_project
  - another_project

boxen::personal::includes:
  - osx::no_network_dsstores
  - osx::global::tap_to_click
  - osx::global::enable_keyboard_control_access
  - osx::global::expand_save_dialog
  - osx::global::expand_print_dialog
  - osx::finder::empty_trash_securely

  - clojure
  - heroku
  - nmap
  - python
  - tmux
  - zsh

boxen::personal::osx_apps:
  - adobe-creative-cloud
  - alfred
  - arq
  - dropbox
  - evernote
  - google-chrome
  - gpgtools
  - hazel
  - istat-menus
  - minecraft
  - omnigraffle
  - playonmac
  - rdio
  - skype
  - slate
  - sonos
  - steam
  - things
  - tiled
  - vlc

boxen::personal::homebrew_packages:
  # Network Tools
  - httpry
  - ipcalc
  - mtr

  # System
  - htop-osx
  - pstree
  - pv
  - spark
  - watch
  - terminal-notifier

  # Dev
  - awscli
  - ctags
  - gist
  - the_silver_searcher
  - jq
  - keybase

  # Mail
  - w3m
  - notmuch
  - urlview
  - contacts
  - msmtp
  - isync

boxen::personal::custom_projects:
  blog:
    source: dgoodlad/d.goodlad.net
    ruby: 1.9.3
  some_other_project
    source: dgoodlad/foo
    ruby: 2.1.2

@rafaelfranca
Copy link
Member

Very good. :shipit:

@tarebyte
Copy link
Member

This looks wonderful ✨. Does this mean that puppet-brewcask is now a permanent dependency of puppet-boxen?

@dgoodlad
Copy link
Contributor Author

@tarebyte It's an optional dependency; if people use the osx_apps option, they'll need puppet-brewcask.

I forked phinze/puppet-brewcask last night into the boxen org, and will add it to the our-boxen Puppetfile once I release this 😁

A big goal of this work is to be able to deprecate about 200 of the 300 or so modules on here which only install an app or a package. They're broadly unmaintained, and a massive overhead for all of us as I'm sure you're acutely aware.

dgoodlad added a commit that referenced this pull request Dec 21, 2014
Simplify personal config as hiera-managed params
@dgoodlad dgoodlad merged commit 332e4bf into master Dec 21, 2014
@dgoodlad dgoodlad deleted the simplified-personal-configs branch December 21, 2014 00:27
@dgoodlad
Copy link
Contributor Author

Released in 3.10.0

@goofansu
Copy link

boxen::personal::osx_apps: has no effect while boxen::personal::casks: has.

It installed the puppet-brewcask, but didn't install any app.

@bpinto
Copy link

bpinto commented Dec 23, 2014

I'm having this error: Error: Execution of 'brew cask install boot2docker --appdir=/Applications' returned 1: Error: Unknown command: cask

Anyone facing the same issue? I have /usr/local/bin on my $PATH. And manually running the commands work.

@dgoodlad
Copy link
Contributor Author

@bpinto Can you open an issue on the boxen-brewcask repo with some more details?

@goofansu I'll see if I can reproduce this

@jamieconnolly
Copy link
Member

@goofansu @dgoodlad — I've encountered the same problem, and was about to fork this repo to issue a PR. The issue is caused by manifests/personal.pp#L58:

# $casks and $osx_apps are synonyms. $osx_apps takes precedence
$_casks = $osx_apps ? {
  undef   => $casks,
  default => $osx_apps
}
# If any casks/osx_apps are specified, declare them as brewcask packages
if count($_casks) > 0 { include brewcask }
ensure_resource('package', $casks, {
  'provider'        => 'brewcask',
  'install_options' => '--appdir=/Applications',
})

ensure_resource('package', $casks, { should be ensure_resource('package', $_casks, {

@dgoodlad
Copy link
Contributor Author

Thanks @jamieconnolly! Fixed in #120, shipped as 3.10.1

@blackjid
Copy link
Member

@dgoodlad can I use this configuration schema for global configuration? for example in the common.yaml file??
How should I do it?

@blackjid
Copy link
Member

I found this boxen/puppet-brewcask#29, there I explain that is not working that approach for me... any idea?

@sebroeder
Copy link
Contributor

Thank you so much for this awesome feature @dgoodlad!

I run into a small problem when I wanted to install Textmate:

boxen::personal::osx_apps:
  - textmate
Error: Execution of 'brew cask install textmate --appdir=/Applications' returned 1: ==> Downloading https://api.textmate.org/downloads/release
==> Symlinking App 'TextMate.app' to '/Applications/TextMate.app'
Error: Permission denied - /usr/local
==> Symlinking Binary 'mate' to '/usr/local/bin/mate'

The Textmate cask tries to symlink a helper binary to /usr/local/bin/mate. Since Boxen does not touch /usr/local by default the permissions are wrong and /usr/local/bin does not even exist.

As far as I can tell, we should install the helper into /opt/boxen/homebrew/bin instead. According to https://github.com/caskroom/homebrew-cask/blob/master/USAGE.md the corresponding brew cask option is --binarydir=/opt/boxen/homebrew/bin.

To test this out I put the following in modules/people/manifests/sebroeder.pp:

class people::sebroeder {
  include brewcask

  package { 'textmate':
    ensure => present,
    provider => brewcask,
    install_options => ['--appdir=/Applications', '--binarydir=/opt/boxen/homebrew/bin'],
  }
}

This worked for me (I did not want to mess with https://github.com/boxen/puppet-boxen/blob/master/manifests/personal.pp#L56-L61 for now).

Could you add the --binarydir option there, please? Let me know it I should open a separate issue or prepare a pull request.

@blackjid
Copy link
Member

blackjid commented Feb 2, 2015

hi @dgoodlad I'm trying to define some homebrew_packages and osx_apps in my user hiera and my common hiera, but I cannot get that working.

# common.yaml
boxen::personal::osx_apps:
  - google-chrome
  - hipchat
# users/blackjid.yaml
boxen::personal::osx_apps:
  - vlc
# config/hiera.yaml
:backends:
  - yaml
:yaml:
  :datadir: "%{::boxen_home}/repo/hiera"
:hierarchy:
  - "users/%{github_login}"
  - common

:merge_behavior: deeper

this is my configuration.... and the results are that only osx_apps defined in the users/blackjid.yaml are getting installed, in this case vlc, apps from common.yml are ignored.

What I have found is that if I don't add the boxen::personal::osx_apps: key in the user file, the common file apps are installed.

It looks like hieras is not using the --array flag to do the merges... do you think that's the problem? or maybe somthing else...

thanks!

@blackjid
Copy link
Member

@dgoodlad sorry, I know this is closed, but could you please help me? thanks!

@blackjid
Copy link
Member

anybody?? please! :)

@tarebyte
Copy link
Member

/cc @seanknox

@seanknox
Copy link
Contributor

@blackjid I assume hiera is properly handling arrays, or else I believe your personal manifest wouldn't have worked (it's just an array with one item). Regarding placement of hiera yaml files:

  • common.yaml: $BOXEN_HOME/repo/hiera
  • user specific: $BOXEN_HOME/repo/hiera/users/[username], e.g. $BOXEN_HOME/repo/hiera/users/seanknox.yaml

@blackjid @sebroeder and anyone still having issues, can you please file an issue if you haven't already?

@blackjid
Copy link
Member

yes, that are the location of my hiera yaml files.

I will open an issue

@blackjid
Copy link
Member

@seanknox I opened a new issue #132 , I also added a info about a few extra tests i did.

jabley added a commit to jabley/our-boxen that referenced this pull request Dec 2, 2015
Based on GDS setup, plus updated to use modern Boxen features.

See boxen/puppet-boxen#119

- Add jabley personal manifest
- Add puppet modules to vendor cache
- Configure SSH
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.

9 participants