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 | |
require 'yaml' | |
require 'optparse' | |
options = { | |
file: File.expand_path('masters.yaml'), | |
type: nil, | |
environment: nil | |
} |
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
# A fact that uses CIDR network ranges to determine a node's datacenter. | |
# | |
# gist url: https://gist.github.com/natemccurdy/b434e0b24401f5bb1decf394fbe1d503 | |
# | |
require 'ipaddr' | |
Facter.add(:datacenter) do | |
setcode do | |
# This hash defines the map of network segments to datacenters. | |
# NOTE: To extend this fact, modify this hash with your segments and datacenters. | |
datacenter_map = { |
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 | |
# | |
# A note on logging: | |
# This script's stderr and stdout are only shown at the DEBUG level | |
# of the master's logs. This means you won't see the error messages | |
# in puppetserver.log by default. All you'll see is the exit code. | |
# | |
# https://docs.puppet.com/puppet/latest/ssl_autosign.html#policy-executable-api | |
# | |
# Exit Codes: |
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
<%- | String $client_source, | |
String $argument_list | |
| -%> | |
$ClientSource = "<%= $client_source %>" | |
$TempDir = Join-Path "C:\Windows\Temp" "ccm_client" | |
$CCMSetup = Join-Path $TempDir "ccmsetup.exe" | |
if (-not (Test-Path $CCMSetup)) { | |
Try { | |
Write-Output "Copying $ClientSource to $TempDir" |
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
# Custom fact that shows the current name of the Administrator and | |
# Guest accounts based on well-known SID's. | |
# | |
# http://support.microsoft.com/kb/243330 | |
# | |
require 'puppet' | |
Facter.add(:account_names) do | |
confine osfamily: :windows |
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
# This will disable UAC on Windows nodes. | |
# | |
# Requires: puppetlabs/registry | |
# | |
class profile::windows::disable_uac { | |
registry::value { 'Disable UAC': | |
key => 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System', | |
value => 'EnableLUA', | |
data => '0', | |
type => 'dword', |
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
pihole: | |
image: diginc/pi-hole | |
ports: | |
- "53:53/tcp" | |
- "53:53/udp" | |
- "80:80/tcp" | |
cap_add: | |
- NET_ADMIN | |
environment: | |
ServerIP: 10.72.0.5 |
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 | |
require 'json' | |
require 'socket' | |
compile_master = Socket.gethostname | |
environmentpath = ARGV[0] | |
environment = ARGV[1] | |
# Get the short SHA1 commit ID from the control repository. | |
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.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
$service_accounts = { | |
'larry' => { | |
gid => '1111', | |
tag => 'group_a', | |
}, | |
'moe' => { | |
gid => '2222', | |
tag => 'group_b', | |
}, | |
'curly' => { |
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
# This class is meant to solve the problem of synchronizing pe_repo agent | |
# packages to compile masters when there is no internet access. | |
# | |
# This profile assumes that the Puppet MoM (master of masters) is able to reach | |
# the internet to download the needed packages, or they've been sneaker-netted to the MoM. | |
# | |
class pe_repo_packages { | |
# Generate an array of puppet-agent pe_repo package names. | |
# 1. Searches PuppetDB for all pe_repo::platform classess added to the MoM. |