Skip to content

Instantly share code, notes, and snippets.

plan os_patching::patch_node(
TargetSpec $target,
Boolean $downtime_enable = true,
){
## Prevalidation task (
groups:
- name: windows
targets:
- <windows hostname >
config:
transport: winrm
winrm:
user: administrator
password: <replaceme>
ssl: false
@tspeigner
tspeigner / bolt.yaml
Last active July 31, 2019 21:10
bolt.yaml
modulepath: "modules:site-modules"
inventoryfile: ./inventory.yaml
concurrency: 10
format: human
ssh:
host-key-check: false
private-key: ./student.pem
user: centos
connect-timeout: 30
winrm:
[main]
server=puppet
# Use Case 1 - use IP and OS logic to determine which configs to apply to node
# This file should live in your control-repo or on the PE Master at
# /etc/puppetlabs/code/environments/production/site/profile/manifests/platform/baseline.pp
class profile::platform::baseline {
# IP Ranges equate to different environments (DEV, UAT, PROD)
# OS specific configurations based on OS Type.
$plat = $facts.get('os.family') ? {
#If os.family == 'windows' then $plat = 'windows', default is 'linux'
@tspeigner
tspeigner / installwinagent.psi
Created December 6, 2017 16:30
puppet agent install
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; $webClient = New-Object System.Net.WebClient; $webClient.DownloadFile('https://master.inf.puppet.vm:8140/packages/current/install.ps1', 'install.ps1'); .\install.ps1
class profile::linux::baseline {
package { 'unzip':
ensure => installed,
}
# USERS
if $::operatingsystem == 'CentOS' {
user { 'puppetdemo':
ensure => present,
managehome => true,
groups => ['wheel'],
@tspeigner
tspeigner / attempt1 output.txt
Last active May 19, 2017 00:29
PDB External PostgreSQL Troubleshooting - Shottracker
[root@ip-10-98-10-242 ~]# /opt/puppetlabs/puppet/bin/puppet resource service puppet ensure=stopped
Notice: /Service[puppet]/ensure: ensure changed 'running' to 'stopped'
service { 'puppet':
ensure => 'stopped',
}
[root@ip-10-98-10-242 ~]# vi /etc/puppetlabs/code/environments/production/hieradata/common.yaml
[root@ip-10-98-10-242 ~]# vi /etc/puppetlabs/console-services/conf.d/activity-database.conf
[root@ip-10-98-10-242 ~]# vi /etc/puppetlabs/console-services/conf.d/rbac-database.conf
[root@ip-10-98-10-242 ~]# vi /etc/puppetlabs/console-services/conf.d/classifier-database.conf
[root@ip-10-98-10-242 ~]# systemctl restart pe-console-services
@tspeigner
tspeigner / noupdate.txt
Last active May 8, 2017 23:11
Puppet not updating Java version
This file has been truncated, but you can view the full file.
Debug: Applying settings catalog for sections main, agent, ssl
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppetlabs/puppet]{:path=>"/etc/puppetlabs/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Using settings: adding file resource 'codedir': 'File[/etc/puppetlabs/code]{:path=>"/etc/puppetlabs/code", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
{
"ignition": { "version": "2.0.0" },
"storage": {
"disks": [
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [{
"label": "container_storage",
"number": 1,