Skip to content

Instantly share code, notes, and snippets.

View turbodog's full-sized avatar

Lindsey Smith turbodog

View GitHub Profile
@turbodog
turbodog / Rolling Stone Former 500.csv
Last active October 30, 2024 15:44
Songs that once were on the Rolling Stone 500 Best Albums but are no longer on the current list. Source data from https://liveduq-my.sharepoint.com/:x:/g/personal/longr3_duq_edu/EWRasWlT_81ArS8f_AEa8AMBxC28wGf8s25zFefsVcceUw?rtime=T2JwRBL23Eg
Artist Album 2003 Rank 2012 Rank Release Year
The Beatles Please Please Me 39 39 1963
Captain Beefheart & His Magic Band Trout Mask Replica 58 60 1969
Creedence Clearwater Revival Green River 95 1969
Cream Fresh Cream 101 102 1966
Rolling Stones Out of Our Heads 114 116 1965
Moby Grape Moby Grape 121 124 1967
The Byrds Younger Than Yesterday 124 127 1967
The Stooges Raw Power 125 128 1973
The Mamas and the Papas If You Can Believe Your Eyes and Ears 127 112 1966
@turbodog
turbodog / site.pp
Created March 28, 2019 21:43
Example of fetching and setting a Deferred value
node /secret-[a,l,w].*/ {
notify { title: message => "I am a secret agent." }
# Fetch a secret
# $secret = Deferred("azure_key_vault::secret", ['turbodog-keyvault', 'foo', {
# metadata_api_version => '2018-02-01',
# vault_api_version => '2016-10-01',
# }])
@turbodog
turbodog / deferred_func_example.md
Last active August 31, 2018 00:17 — forked from tvpartytonight/deferred_func_example.md
deferred function example

Quick-start documentation for building support for Puppet agents fetching from secret stores

Intro

New in Puppet 6 is a capability called the Deferred type that allows agents to execute a Puppet function to resolve a data value at the time of catalog application.

When compiling catalogs, functions are normally executed on the puppet master with results entered into the catalog directly. The complete and fully resolved catalog is then sent to the agent for application. Starting in Puppet 6, functions can now be deferred until the agent applies the catalog, meaning the agent executes the function on the agent instead of the master. The upshot of this is that agents can use a function to fetch data like secrets directly rather than having the Puppet master act as an intermediary. Builds with this functionality are now available from the puppet6 nightly repos.

Using a deferred function

curl -X POST https://localhost:4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/master.pem --key /etc/puppetlabs/puppet/ssl/private_keys/master.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" -d '
{
"name": "Group 04",
"environment": "production",
"parent": "00000000-0000-4000-8000-000000000000",
"classes": {},
"rule": [
"or",
["=", "name", "agent004000"],
["=", "name", "agent004001"],
curl -X POST https://localhost:4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/master.pem --key /etc/puppetlabs/puppet/ssl/private_keys/master.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" -d '
{
"name": "Group 03",
"environment": "production",
"parent": "00000000-0000-4000-8000-000000000000",
"classes": {},
"rule": [
"or",
["=", "name", "agent003000"],
["=", "name", "agent003001"],
curl -X POST https://localhost:4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/master.pem --key /etc/puppetlabs/puppet/ssl/private_keys/master.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" -d '
{
"name": "Group 02",
"environment": "production",
"parent": "00000000-0000-4000-8000-000000000000",
"classes": {},
"rule": [
"or",
["=", "name", "agent002000"],
["=", "name", "agent002001"],
curl -X POST https://localhost:4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/master.pem --key /etc/puppetlabs/puppet/ssl/private_keys/master.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" -d '
{
"name": "Group 01",
"environment": "production",
"parent": "00000000-0000-4000-8000-000000000000",
"classes": {},
"rule": [
"or",
["=", "name", "agent001000"],
["=", "name", "agent001001"],
curl -X POST https://localhost:4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/master.pem --key /etc/puppetlabs/puppet/ssl/private_keys/master.pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" -d '
{
"name": "Group 00",
"environment": "production",
"parent": "00000000-0000-4000-8000-000000000000",
"classes": {},
"rule": [
"or",
["=", "name", "agent000000"],
["=", "name", "agent000001"],