NOTE: Replace this text with your own description.
This project utilizes Test Kitchen to test puppetcode. You can use this template to write new puppet modules or to enhance existing modules.
Review the upstream documentation to find out how to use it in your own project
It provides the following aspects:
Why do i need that?
cd /tmp
wget https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb
sudo dpkg -i vagrant_*_x86_64.deb
Installation of RVM
Follow the offical installation procedure at https://rvm.io/, i.e.:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
# source this or add this to your .bashrc
source ~/.rvm/scripts/rvm
exec bash
# asks for root password and installs packages like libyaml-dev, libsqlite3-dev, libgdbm-dev, libncurses5-dev, bison, libreadline6-dev
rvm install "ruby-2.4.9"
Configuration of RVM
After the rvm installtion a configuration file (~/.rvmrc) should be created with the following content:
echo "rvm_autoinstall_bundler_flag=1" >> ~/.rvmrc
sudo apt install ruby-dev libgmp-dev
gem install bundler
# Now the automatic invocation of bundler should install all the missing gems
cd ..; cd puppet-kitchen_template
This allows the convinient automatic installation of bundler.
Install Ruby, work with control repositories There are numerous possibilities to work with RVM - we are unsing the Gemfile procedure. see: Gemfile
source 'https://rubygems.org'
#ruby=2.0.0-p645
#ruby-gemset=puppet-testing
(...)
The entries with the leading hashes (#) are not disabled entries. You have to install the configured ruby release in a manual procedure. You will get a notification "Required ruby-2.4.1 is not installed." if this step is missing.
"test-kitchen": Serverspec Test mit Vagrant/Virtualbox/Docker
mkdir -p ~/.kitchen
cd ~/.kitchen
wget https://github.com/MarkBorcherding/test-kitchen-bash-completion/blob/master/kitchen-completion.bash
grep -q kitchen-completion.bash ~/.bashrc || echo "source ~/.kitchen/kitchen-completion.bash" >> ~/.bashrc
exec bash
git clone https://github.com/scoopex/puppet-kitchen_template.git
cd puppet-kitchen_template
kitchen create default-ubuntu20-kitchen-template
kitchen converge default-ubuntu20-kitchen-template
kitchen verify default-ubuntu20-kitchen-template
Review the upstream documentation to find out how to use it in your own project
git clone https://github.com/scoopex/puppet-kitchen_template.git
mv puppet-kitchen_template
kitchen destroy
rm -rf Gemfile.lock Puppetfile.lock .kitchen .librarian/ .tmp/
git init .
vim Puppetfile
vim manifests/*
vim test/integration/default/serverspec/*
kitchen list
kitchen create <instance>
kitchen login <instance>
sudo bash
kitchen converge <instance>
kitchen verify <instance>
kitchen destroy <instance>
kitchen login <instance name>
sudo -i
cd /etc/
git diff
git checkout <file>
Command Description
------------------------------------------------------------------------
kitchen list View all test suites
kitchen create Create the target system (Vagrant)
kitchen create <suite>
kitchen converge <suite> Execute puppet (Puppet)
kitchen login <suite> SSH Login
kitchen verify <suite> Execute test suites (servespec)
kitchen test <suite> Create, test and destroy system
kitchen destroy Destroy all test systems
kitchen destroy <suite> Destroy a certain test system
kitchen verify -l debug Get enhanced debug information
librarian-puppet install --verbose Debug librarian problems
librarian-puppet show --detailed Show librarian dependencies
vagrant box list Show all vargrant boxes
vagrant box remove <box> Remove a vagrant box to fetch
a new release on next
"kitchen create"
------------------------------------------------------------------------