Code Monkey home page Code Monkey logo

puppet-ohmyzsh's Introduction

puppet-ohmyzsh

Build Status

This is a oh-my-zsh module. It installs oh-my-zsh for a user and can change their shell to zsh. It can install and configure themes and plugins for users.

oh-my-zsh is a community-driven framework for managing your zsh configuration. See https://github.com/robbyrussell/oh-my-zsh for more details.

Usage

# for a single user
ohmyzsh::install { 'user1': }

# for multiple users in one shot and set their shell to zsh
ohmyzsh::install { ['root', 'user1']: set_sh => true }

# install and disable prompt for automatic updates
ohmyzsh::install { 'user2': disable_auto_update => true }

# install a theme for a user
ohmyzsh::fetch::theme { 'root': url => 'http://zanloy.com/files/dotfiles/oh-my-zsh/squared.zsh-theme' }

# set a theme for a user
ohmyzsh::theme { ['root', 'user1']: } # would install 'clean' theme as default

ohmyzsh::theme { ['root', 'user1']: theme => 'robbyrussell' } # specific theme

# activate plugins for a user
ohmyzsh::plugins { 'user1': plugins => ['git', 'github'] }

# upgrade oh-my-zsh for a single user
ohmyzsh::upgrade { 'user1': }

# upgrade oh-my-zsh on a different schedule (only 'daily' is defined, you are responsible for creating additional schedules)
ohmyzsh::upgrade { 'user1': schedule => 'weekly' }

Support

Please log tickets and issues on GitHub

Acknowlegments

This module was originally a fork of acme/ohmyzsh at version 0.1.3

puppet-ohmyzsh's People

Contributors

zanloy avatar acme avatar liquorvicar avatar highb avatar fennnec avatar

Stargazers

Marcin Niemira avatar Jayson Grace avatar

Watchers

Mikael Fridh avatar James Cloos avatar  avatar

puppet-ohmyzsh's Issues

When upgrade set to enabled it DISABLE_AUTO_UPDATE should be set to true

When upgrade enabled for a user like this:

# upgrade oh-my-zsh for a single user
ohmyzsh::upgrade { 'user1': }

It should then be disabled in the user .zshrc file:
Currently it's set like so:

# DISABLE_AUTO_UPDATE="true"

Should be:

DISABLE_AUTO_UPDATE="false"

Otherwise it prompts the user frequently to check for updates even though puppet is managing the updates.

Allow for $home overrides in ohmyzsh::params

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

Add schedule metaparameter support to the "ohmyzsh::git upgrade ${name}" resource

For performance reasons (and other reasons) would be best not to check for upgrades for each user on every puppet run. Therefore one can use the schedule metaparameter to only check for updates once a day. I do this with the Exec override though currently I have to specify the username like so:

    ohmyzsh::upgrade { 'user1': }
    Exec <| title == 'ohmyzsh::git upgrade user1' |> {
      schedule => 'everyday',
    }

Would be nice if could specify the schedule in the ohmyzsh::upgrade class like so:

    ohmyzsh::upgrade { 'user1': }
    frequency => 'everyday',

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.