Configure a Linux Desktop with Puppet

This article will show you how to setup a basic Linux desktop using CentOS 7 and Puppet 5. Manually configuring software is time-consuming and error-prone. In our example, we will use Puppet to automate this process.

TODO: Add awscli and docker

If you don’t already have puppet, use the following commands to install it:

sudo rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm
sudo yum install puppet-agent -y

To run the manifest without a puppet master, these modules will need to be installed on the local machine.

sudo /opt/puppetlabs/bin/puppet module install puppetlabs-stdlib
sudo /opt/puppetlabs/bin/puppet module install puppetlabs-vcsrepo
cd /etc/puppet/code/environments/production/modules
git clone https://github.com/sbertie/puppet-desktop.git desktop

With a Puppetfile:

mod 'puppetlabs-stdlib', '4.25.0'
mod 'puppetlabs-vcsrepo', '2.3.0'
mod 'desktop',
  :git => 'https://github.com/sbertie/puppet-desktop.git',
  :tag => '0.1.2'

To apply without a Puppetmaster:

sudo /opt/puppetlabs/bin/puppet apply -e "class { 'desktop': user => 'ec2-user', }"

To customized parameters

class { 'desktop':
  user              => 'myusername',
  install_ssh_agent => false,
  install_vim       => true,
  install_i3        => true,
  install_xrdp      => false,
  chrome_bookmarks  => [ 'https://github.com', 'https://aws.amazon.com' ],
}

Parameters

user (string) – installs dot files in this users home directory

install_ssh_agent (boolean) – installs ssh_agent script and adds it to .bashrc

install_vim (boolean) – installs vim-enhanced, plugins, and .vimrc

install_i3 (boolean) – installs minimal window manager i3

install_xrdp (boolean) – installs and enables xrdp service

chrome_bookmarks (array) – list of bookmarks to add

If you are running a firewall you may need to open port 3389 before you can connect with RDP.