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

Allow for $home overrides in ohmyzsh::params #7

Open
mikedevita opened this issue Aug 21, 2017 · 0 comments
Open

Allow for $home overrides in ohmyzsh::params #7

mikedevita opened this issue Aug 21, 2017 · 0 comments

Comments

@mikedevita
Copy link

mikedevita commented Aug 21, 2017

Currently none of the params are exposed so you can't override them with an ENC like foreman. I propose to extend this module to allow $home to be overridden, you can do this by exposing the $home as a class parameter in the manifests/params.pp.

Something like this should suffice for now:

manifests/init.pp

# View README.md for full documentation.
#
# === Authors
#
# Leon Brocard <[email protected]>
# Zan Loy <[email protected]>
#
# === Copyright
#
# Copyright 2014
#
class ohmyzsh (
  $home = $::ohmyzsh::params::homedir
) inherits ::ohmyzsh::params {}

manifests/params.pp

# Parameters class for ohmyzsh
class ohmyzsh::params (
  $homedir = '/home'
) {
  case $::osfamily {
    'Redhat': {
      $zsh = '/bin/zsh'
    }
    default: {
      $zsh = '/usr/bin/zsh'
    }
  }

  $home = $homedir

}

I will submit a PR for this if you like (although I am still fairly new to puppet), I also was thinking about creating a wrapper for this module so you can use an ENC via hiera/yaml to define something like the following:

users:
  root:
    set_sh: true
    disable_auto_update: true
    homedir: /root
    theme: 'robyrussell'  
  mike:
    set_sh: true
    disable_auto_update: true
    homedir: /mnt/home/mike
    theme: 'robyrussell'
    plugins:
      - git
      - github
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

No branches or pull requests

1 participant