This file contains 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 python | |
# This git-hook triggers the Code-Manager per branch and checks for status to be returned | |
# Requirements: This requires the python request module ( sudo yum install python-requests ) | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
import json | |
import sys |
This file contains 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 | |
require "rest-client" | |
require "json" | |
require "rugged" | |
require 'optparse' | |
options = { :verbose => nil, :pretty => nil } | |
parser = OptionParser.new do|opts| | |
opts.banner = "Usage: #{$0} [options]" |
This file contains 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 | |
set -e | |
function stash_create_repo() | |
{ | |
local username="$1" | |
local password="$2" | |
local hostname="$3" | |
local port="$4" | |
local project="$5" |
This file contains 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 bash | |
node_fqdn=$(hostname -f) | |
prettyjson='python -m json.tool' | |
# Generate Token for code-deployer RBAC user (5y Lifetime) | |
token_file_loc='/root/.puppetlabs/code-deployer_token' | |
# Trigger Code-Manager Deployment of ALL environments | |
function trigger_run() { |
This file contains 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
# Reference Commands | |
cmd_list='usermod groupmod find chgrp getent id awk tr wc' | |
# Function to check if referenced command exists | |
cmd_exists() { | |
if [ $# -eq 0 ]; then | |
echo 'WARNING: No command argument was passed to verify exists' | |
fi | |
cmd=${1} |
This file contains 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 bash | |
usage() { | |
cat <<-EOF | |
usage: ${0} -l <login> -u <new uid> [-g <new gid>] | |
-h this help screen | |
-l login account login account name | |
-p primary group for account login | |
-u uid new UID to assign to account | |
-g new GID to assign to account group |
This file contains 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 bash | |
# Find available IP addresses from by using dig -x axfr | |
usage() { | |
cat <<-EOF | |
usage: ${0} <network> | |
example: ${0} 10.1.10 | |
EOF | |
} |
This file contains 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
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" ================ General Config ==================== | |
set number "Line numbers are good | |
set backspace=indent,eol,start "Allow backspace in insert mode | |
set history=1000 "Store lots of :cmdline history |
This file contains 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
$managed_groups = hiera_array(managed_groups) | |
notice ( $managed_groups ) | |
$managed_groups.each | $group | { | |
$g = hiera_hash(accounts::groups).filter | $key, $val | { $key == $group } | |
create_resources('group', $g) | |
} | |
$managed_users = hiera_array(managed_users) |
This file contains 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
## This class requires env_utils, node_manager and stdlib | |
# Array of PE Environment Groups excluding the default 'Agent-specified environment' group | |
$pe_environment_groups = delete(node_groups().filter |$key, $val| { $val["environment_trumps"] == true }.map |$key, $val| { $val["name"] }, 'Agent-specified environment') | |
# Obtain PuppetServer environments and munge to look like PE Classifier environment Groups | |
$puppet_environments = regsubst(capitalize(environments()), '$', ' environment', 'G') | |
# Array of PE Environment Groups that should be removed based | |
# the PuppetServer environment no longer exists |