Skip to content

RyanJarv/puppet-randrust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the puppet side of https://github.com/RyanJarv/randrust. Same as that this was just an interview related project that I spent far too much time on, at best it might serve as a decent example of how to operationalize a simple service.

randrust

Build Status

Table of Contents

  1. Description
  2. Setup - The basics of getting started with randrust
  3. Usage - Configuration options and additional functionality
  4. Reference
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module
  7. 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

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.

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.

The rest is written by RyanJarv and licensed under BSD-2

About

Puppet module for randrust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published