Skip to content

Instantly share code, notes, and snippets.

@GeoffWilliams
Created May 27, 2015 22:49
Show Gist options
  • Save GeoffWilliams/01592b9d8745d5b9c935 to your computer and use it in GitHub Desktop.
Save GeoffWilliams/01592b9d8745d5b9c935 to your computer and use it in GitHub Desktop.
Install an apache web server and graphviz, then do a puppet apply and graph the results (assumes a class called ordering::mysql in the node graph)
#!/bin/bash
PUBDIR=$1
FINAL_DIR="/var/www/html/${PUBDIR}"
GRAPH_DIR="/var/opt/lib/pe-puppet/state/graphs/"
puppet apply -e "package {['httpd','graphviz']: ensure => present, }
service { 'httpd': ensure => 'running', }"
echo "publishing to $FINAL_DIR"
mkdir -p $FINAL_DIR
puppet apply --graph -e 'include ordering::mysql' && \
cd $GRAPH_DIR
for i in *.dot ; do
echo "Creating $i.svg"
dot -Tsvg $i -o $i.svg;
done
mv $GRAPH_DIR*.svg $FINAL_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment