modules/roles_profiles/manifests/roles
modules/roles_profiles/manifests/profiles
Roles and profiles are both types of Puppet modules.
- Roles specify everything a machine type needs to fufill a role.
- Profiles provide an OS-independent interface to functionality provided by roles.
Vagrant is useful for testing the full masterless bootstrapping process.
Vagrant mounts this directory at /vagrant.
gem install bundler
bundle install --gemfile .gemfile
vagrant up bionic-bare
vagrant ssh bionic-bare
sudo /vagrant/provisioners/linux/bootstrap_bitbar_devicepool.sh
kitchen-puppet provides infrastructure to automate running convergence and serverspec tests for each role.
Uses kitchen-puppet.
gem install bundler
bundle install --gemfile .gemfile
kitchen converge
# run spec tests
kitchen verify
New test suites can be added in .kitchen.yaml
.
serverspec tests live in tests/integration/SUITE/*_spec.rb
.
-
Edit
.kitchen.yml
. Set the appropriate details. -
Create a new manifest dir for the suite.
cd manifests-kitchen mkdir <suite_name> cd <suite_name> ln -s ../../manifests/site.pp . touch z-<suite_name>.pp vim z-<suite_name>.pp
We need our pp file to be run after the site.pp, that's why it starts with a z.
-
Include your desired role
In the recently created
z-<suite_name>.pp
:include roles_profiles::roles::your_favorite_role
-
(optional) Write spec tests.
See
tests/integration
.