Code Monkey home page Code Monkey logo

puppet-debugger-demo's Introduction

Table of Contents generated with DocToc

puppet-debugger-demo

A demo repo for showing off the puppet-debugger

Adding new mdoules for this demo

This demo project maintains a librarian-puppet Puppetfile. If you want new modules just add them to the Puppetfile.

  1. Install librarian-puppet gem install 'librarian-puppet'
  2. install modules from the Puppetfile by running librarian-puppet

Setup for the demo

In order to run through this demo you need to setup a few things.

  1. Download this repo git clone https://github.com/nwops/puppet-debugger-demo
  2. Install through one of the methods below (docker, automated or manual)

Note: unless you are using the docker method you will change your puppet.conf file and update some settings to use this project directory as well as install some required gems.

Isolated docker environment

If you just want to try this out without messing anything up. Download docker and then run the docker_it.sh script.

Because the container links the project directory in the container you can write puppet code, change hiera values or install new modules and the container will use the new files.

This is going to be the easiest thing to do without breaking your local environment.

Automated Install on your system

bash setup.sh from this project directory

While this is pretty simple, the setup script will install a few gems, add a local puppet cert and change a few puppet settings to for this demo project. See the manual steps below for a quick summary of what the script does.

Manual Install on your system

Install the required gems

This can be done in a few ways.

  1. run bundle install from base project directory
  2. Install the gems manually
gem install 'puppet-debugger'
gem install 'librarian-puppet'

Setup your puppet config

Edit your puppet config file which can be located by running: puppet config print config

The settings below should point to the puppet-debugger-demo directory. You will need to Swap out the /Users/cosman/github for your path.

[main]
environment = production
environmentpath = /Users/cosman/github/puppet-debugger-demo/environments
basemodulepath = /Users/cosman/github/puppet-debugger-demo/modules
hiera_config = /Users/cosman/github/puppet-debugger-demo/hieradata/hiera.yaml

Additiional Puppet Setup (Optional)

Using the puppet-debugger only requires installation of the gem. However, to maximize the debugger's capabilities you should setup your development environment further to work with puppet.

Create a site.pp

If you want to set topscope variables for use in the debugger you need to define them in your site.pp file. So just edit the following file and define whatever you like. While this is for demo purposes, ideally you already have a site.pp in your puppet source code.

./puppet-debugger-demo/environments/production/manifests/site.pp

Setup hiera

The data directory for hiera for this demo is hard coded so please update to match your system's directory path. There is no manipulation of data going on so this could also point to your real hiera data as well. Please edit ./puppet-debugger-demo/hieradata/hiera.yaml to match your path.

:yaml:
  :datadir: '/Users/cosman/github/puppet-debugger-demo/hieradata/data'

By default this will use the demo hiera data and config. But there is nothing stopping you from using your own hiera config. Change the config in your puppet.conf file to use a different hiera config file and load up real data.

hiera_config = /Users/cosman/github/puppet-debugger-demo/hieradata/hiera.yaml

Puppet Master command for cert setup

If this is your development machine and you need a puppet signed cert you can run puppet cert generate hostname as a hack to quickly create cert. There are only a few use cases for doing this.

Other option would be to run puppet agent and get a signed cert from your master.

None of this is required unless you are using a function like node_encrypt that uses certs and private keys to encrypt data.

Demo Sections

The demo scripts are used to auto run a demo in a container. To use these scripts just run:

bash ./demo_scripts/<name_of_script>.sh

puppet-debugger-demo's People

Contributors

logicminds avatar

Stargazers

Phil Hendren avatar Vladislav Tkatchev avatar

Watchers

 avatar James Cloos avatar

Forkers

shoneslab f33rx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.