Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 7.0.0
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'call-workstation', '0.1.72'
Learn more about managing modules with a PuppetfileDocumentation
workstation
This module is under active development and should not be considered production-ready at this time.
Table of Contents
- Description
- Setup - The basics of getting started with workstation
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The workstation module manages tools and config for developer workstations, allowing developers to define, share, and combine workstation configurations in Hiera yaml.
This module is designed to provide a simple way to bootstrap a workstation with developer config. No prior experience with Puppet should be needed to use this module, only a working understanding of YAML. The workstation module is intended to be used via a puppet apply
one-liner. However, this module can also be used in a master-agent setup, given an appropriate Hiera hierachy and hieradata in the control repo.
Currently this module only supports macOS, but Linux support will be added soon.
Setup
What workstation affects
This module manages settings for developer workstations. Initially it is focused on ensuring package installation, tool version installation, and dotfile configuration.
Current features:
- macOS Command Line Tools installation
- macOS package installation via
brew
, with full tap/cask support - macOS tool version management via
asdf
(should also support Linux, currently untested) - Basic macOS and Linux primary user shell configuration
- Basic macOS and Linux primary user dotfile management
Setup Requirements
Puppet installed locally via puppet-agent
package or puppet
gem.
Beginning with workstation
1) Ensure Puppet is installed. If you don't already have the Puppet Agent package installed, the easiest way to get Puppet is sudo gem install puppet --no-ri --no-doc
.
2) Install this module locally, as root: sudo puppet module install call-workstation
3) Run puppet apply
by copy-pasting one of the example one-liners below, depending on your shell. This will apply the configuration to the current user. Without additional hieradata, only the most basic user configuration will be applied (user shell, default packages).
Bash:
sudo puppet apply -e "class {'workstation': user => $(whoami)}"
Zsh:
sudo puppet apply -e "class {'workstation': user => $(whoami), shell => 'zsh'}"
Fish:
sudo puppet apply -e "class {'workstation': user => "(whoami)", shell => 'fish'}"
4) To supply your own config data, use the --hiera_config
flag to point to your custom hiera.yaml. See the 'Usage' section for more details. For example, for bash shell the command will look something like:
sudo puppet apply -e "class {'workstation': user => $(whoami)}" --hiera_config /path/to/workstation-hieradata/hiera.yaml
Be sure to replace /path/to/workstation-hieradata
with the real path to your Hiera directory that contains a hiera.yaml config file.
Usage
In order to take full advantage of this module, you'll want to create a repository with your custom configuration data. To get started quickly, you can fork and modify the example at call/workstation-hieradata.
Importantly, in the call/workstation-hieradata example, data/common.yaml
contains settings to perform deep merges on package lookups, combined with a glob (*) for the lookup path. This pattern allows you to provide multiple yaml files in a single directory, which may have some overlapping package configuration, while avoiding the problem of duplicate resource declaration in Puppet. You may find it useful to provide a yaml file per application, per team, or based on some other grouping that requires a specific set of config.
Hiera directory structure and lookup behavior is highly configurable. See the Puppet docs on hiera.yaml to learn more.
Limitations
This module currently only supports macOS. Support will be expanded to Linux workstations in the near future.
Development
Fork, improve, and PR!
Dependencies
- puppetlabs-vcsrepo (>= 1.0.0 < 3.0.0)
- thekevjames-homebrew (>= 1.8.3 < 2.0.0)
- call-xcode_cli_tools (>= 0.0.1 < 2.0.0)