Skip to main content
sberts GitHub

Configure a Desktop with Puppet

i3wm logo

This post will describe how to setup a Linux desktop from a minimal CentOS 7 installation. Manually configuring all the software for a sysadmin is time-consuming and error-prone. We'll be using Puppet 5 to help automate some of this.

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/sberts/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/sberts/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.