Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 7.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'jarv-randrust', '0.1.1'
Learn more about managing modules with a PuppetfileDocumentation
randrust
Table of Contents
- Description
- Setup - The basics of getting started with randrust
- Usage - Configuration options and additional functionality
- Reference
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Contributor's/Reference's
Description
Puppet module for installing and configuring randrust a rust web app that returns a random base64 encoded string of a given length.
After the app is setup it will respond to requests at the endpoint /key/(int) where int is the plaintext length.
Only ubuntu 16.04, 18.04 and debian 9 are tested and supported currently.
Setup
What randrust affects
- Setups up an additional apt repository for https://packagecloud.io/jarv/test.
- Installs the randrust package from the above repo.
Usage
This module will work with the default settings so all that is needed is to include the randrust class.
include randrust
If you just want to test this repo out you can use this module as is to configure a local node with vagrant. See Developing section for more info.
Reference
See REFERENCE
Limitations
OS support
- Ubuntu 18.04
- Ubuntu 16.04
- Debian 9
Future Supported Parameters
The following parameters or are not usefull in practice currently. This will change if/when the randrust package adds support for them.
- service_provider
- service_name
Development
This module uses kitchen terraform for testing. To set this up the following things need to be installed.
- VirtualBox
- Vagrant
- Ruby (Preferably a somewhat recent version)
- Bundler
OSx Install Example
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install virtualbox
brew cask install vagrant
brew cask install ruby
gem install bundler
# Setup ruby path each time you need it
export PATH="/usr/local/opt/ruby/bin:$PATH
# Or add it to your profile and open a new terminal window
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
git clone https://github.com/RyanJarv/puppet-randrust.git
cd puppet-randrust
bundle install --path vendor/bundle
Unit tests
Runs on your local machine, faster then Test Kitchen or acceptance tests.
./scripts/unit_tests.sh
Test Kitchen
This converges and runs serverspec tests against a local VirtualBox VM.
Initial setup is slower then unit tests but subsequent runs are about the same.
Before any kitchen commands run make sure to run the following at least once.
bundle exec librarian-puppet install
List all nodes
bundle exec kitchen list
Instance Driver Provisioner Verifier Transport Last Action Last Error
base-ubuntu18-randrust Vagrant PuppetApply Busser Sftp <Not Created> <None>
base-ubuntu16-randrust Vagrant PuppetApply Busser Sftp <Not Created> <None>
base-debian-randrust Vagrant PuppetApply Busser Sftp <Not Created> <None>
Converge and run serverspec's against a specific node
This can be rerun as you make changes untill it succeeds.
bundle exec librarian-puppet install
bundle exec kitchen verify base-ubuntu18-randrust
-----> Starting Kitchen (v2.3.3)
-----> Creating <base-ubuntu18-randrust>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/bionic64'...
==> default: Matching MAC address for NAT networking...
...
Once your done use bundle exec kitchen destroy
to shutdown the VM's.
Acceptance tests
Will run the destroy/create/test/destroy process for all machines. Run this at least once before you make a PR.
bundle exec librarian-puppet install
bundle exec kitchen test
Afterwards if all nodes show as not created in bundle exec kitchen list
then the run succeeded.
Generating REFERENCE.md
This uses (puppet-strings)[https://puppet.com/docs/puppet/5.5/puppet_strings.html#reference-4095] to create the reference file.
./scripts/generate_references.sh
Files: 4
Modules: 0 ( 0 undocumented)
Classes: 0 ( 0 undocumented)
Constants: 0 ( 0 undocumented)
Attributes: 0 ( 0 undocumented)
Methods: 0 ( 0 undocumented)
Puppet Defined Types: 0 ( 0 undocumented)
Puppet Functions: 0 ( 0 undocumented)
Puppet Data Types: 0 ( 0 undocumented)
Puppet Data Type Aliases: 0 ( 0 undocumented)
Puppet Tasks: 0 ( 0 undocumented)
Puppet Types: 0 ( 0 undocumented)
Puppet Providers: 0 ( 0 undocumented)
Puppet Plans: 0 ( 0 undocumented)
Puppet Classes: 4 ( 0 undocumented)
100.00% documented
Contributor's/Reference's
Code used as reference for this module is listed here along with the license of the project.
- scoopex/puppet-kitchen_template
- Reference for implementing Test Kitchen in a puppet module (typically this is used with chef).
- BSD-2
- puppetlabs/puppetlabs-ntp
- Reference for implementing a typical service in puppet.
- Apache-2.0
- Puppet Development Kit
- Scaffolding for module, manifests and unit tests.
- Apache-2.0
Reference
Table of Contents
Classes
Public Classes
randrust
: Installs, configures and run's randrust.
Private Classes
randrust::config
: This class handles the configuration file.randrust::install
: This class handles the randrust package.randrust::service
: This class handles the randrust service.
Classes
randrust
Installs, configures and run's randrust.
Examples
include randrust
$randrust::listen_port = 8080
$randrust::package_manage = false
include randrust
Parameters
The following parameters are available in the randrust
class.
package_name
Data type: Array[String]
Specifies the randrust package to manage. Default value: ['randrust'].
package_manage
Data type: Boolean
Whether to manage the randrust package. Default value: true.
package_ensure
Data type: String
Whether to install the randrust package, and what version to install. Values: 'present', 'latest', or a specific version number. Default value: 'present'.
config_epp
Data type: Optional[String]
Specifies an absolute or relative file path to an EPP template for the config file. Example value: 'randrust/randrust.epp'.
listen_port
Data type: Optional[Integer[0, 65535]]
Specifies the listen port for randrust to serve traffic from.
interface
Data type: Optional[String]
Specifies the interface to listen on. Default: '0.0.0.0'.
package_ensure
Whether to install the randrust package, and what version to install. Values: 'present', 'latest', or a specific version number. Default value: 'present'.
service_manage
Data type: Boolean
Whether to manage the randrust service. Default value: true.
service_enable
Data type: Boolean
Whether to enable the randrust service at boot. Default value: true.
service_ensure
Data type: Enum['running', 'stopped']
Whether the randrust service should be running. Default value: 'running'.
service_provider
Data type: Optional[String]
NOTE: Only the default is supported currently.
Which service provider to use for randrust. Default value: 'undef'.
service_name
Data type: String
NOTE: Only the default is suppored currently.
The name of the randrust service to manage.
Dependencies
- puppetlabs/stdlib (>= 5.0.0 < 8.0.0)
- puppetlabs/apt (>= 6.0.0 < 9.0.0)
BSD 2-Clause License Copyright (c) 2017, Ryan Gerstenkorn All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.