Created
May 27, 2015 22:49
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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