Forge Home

dotfiles

Initial setup for my dotfiles

2,178 downloads

1,793 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.1.1 (latest)
  • 1.1.0 (deleted)
  • 1.0.0
released Aug 16th 2020
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2016.4.x
  • Puppet >= 4.10.11 <= 6.0.0
  • , , , Archlinux

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'eirikur-dotfiles', '1.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add eirikur-dotfiles
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install eirikur-dotfiles --version 1.1.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: dotfiles

Documentation

eirikur/dotfiles — version 1.1.1 Aug 16th 2020

puppet-dotfiles

Build Status Puppet Forge

Description

This module installs the latest version of my dotfiles to a Linux machine (Puppet agent). By default the repository will be cloned via HTTPS into the directory /usr/local/share/dotfiles.

Usage

To install the dotfiles package with default values:

include dotfiles

Install via ssh key:

class { 'dotfiles':
  dotfiles_repository_url => 'git@github.com:eirikur-ari/dotfiles.git',
  use_ssh_key             => true,
}

Example using all available custom options:

class { 'dotfiles':
  github_ssh_key            => 'example_rsa_key',
  ssh_known_hosts_file_path => 'example/ssh_known_hosts',
  ssh_config_dir            => 'example/.ssh',
  dotfiles_install_path     => 'example/dotfiles',
  dotfiles_repository_url   => 'git@some.repo:example/dotfiles.git',
  dotfiles_install_script   => 'example.sh',
  use_ssh_key               => true
}

Development

Requirements

Puppet version: 4.10 or later\ Ruby version: 2.5.7

Install dependencies

Create Gemset (Optional)

It is considered a good practice to keep the product Gem dependencies separated from the local Gems. One of the options is to create a new Gem collection (GemSet) using tool such as RVM. See the following command for an example:

rvm use 2.5.7@dotfiles --create

Install Gems

The following command will install all the product Gem dependencies listed in the Gemfile.

bundle install

Alternative option

There is a second option and that is using the make tool. Execute the following to create a new Gem collection and install the Gem dependencies:

make prep

Unit Testing

Run Unit Tests

The following command will install the dependant Puppet Modules as well as create a symlink to the module under development, execute the unit tests and report on the test coverage.

In order to execute the tests, run the following command:

rake test

By default the repository will be cloned via HTTPS into the directory /usr/local/share/dotfiles. Note: After the tests have been executed the command will remove the Puppet Modules from spec/fixtures/modules

Alternative option

As an alternative that will install the dependencies and execute the unit tests by using the make tool. Execute the following:

make test

Acceptance Testing

The project provides Beaker setup to run acceptance tests via Docker. Tests are automatically executed by Travis CI for the following OS:

  • Ubuntu
  • CentOs
  • Fedora

Run manually

The following command will execute acceptance test using the default beaker configuration:

make acceptance

Smoke Testing

The Vagrant configuration provides a multi-machine setup. By default a version of CentOS is started when vagrant up is executed, the configuration makes sure that no other machine is started along with the primary machine (CentOS).

Install the Puppet Module dependencies

In case the dependent Puppet modules are not available in the directory spec/fixtures/modules we need to run the following:

rake spec_prep

Start a Vagrant box

In order to start any Vagrant box other than the primary (CentOS) it is required to add the name of the box configuration as an addition to the vagrant up command. See the following example:

vagrant up ubuntu

The current machine offering is the following:

  • centos
  • fedora
  • archlinux
  • ubuntu

Alternative option

There is a alternative option available that will prepare the required Puppet Module setup and launch the default vagrant box using the make tool. See the following:

make smoke

Apply the Puppet Module

The following command will apply the Puppet Module and refresh the shell.

puppet apply --modulepath=/vagrant/spec/fixtures/modules /vagrant/tests/init.pp && exec $SHELL -l

Note: If installed using default configuration, it is required to be use the root user to apply the Puppet Module