Version information
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
Add this module to your Puppetfile:
mod 'eirikur-dotfiles', '1.1.1'
Learn more about managing modules with a PuppetfileDocumentation
puppet-dotfiles
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
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v1.1.1 - 2020-08-16
Fixed
- Issue with auto deployment fixed
v1.1.0 - 2020-08-16
Added
- Ability to choose between cloning the dotfiles repository using ssh key or via https
- Acceptance tests using Beaker
- Makefile for more plesant development experience
- Automatic Puppet Module publication via Travis CI
Changed
- Moved the package installation from the install manifest to a new package manifest
- Moved the dotfiles installation step from the config manifest to the install manifest
v1.0.0 - 2020-08-11
Added
- Module created with the ability to prepare, clone and install my dotfiles
Dependencies
- puppetlabs/stdlib (4.25.1)
- puppetlabs/vcsrepo (2.3.0)
/* * ------------------------------------------------------------------------------------ * "THE BEER-WARE LICENSE" (Revision 42): * <eirikur.ari@hotmail.com> wrote this file. As long as you retain this notice * you can do whatever you want with this stuff. If we meet some day, and you * think this stuff is worth it, you can buy me a beer in return Eiríkur Ari Pétursson * ------------------------------------------------------------------------------------ */