Skip to content

Instantly share code, notes, and snippets.

View logicminds's full-sized avatar

Corey Osman logicminds

View GitHub Profile
@logicminds
logicminds / example.pp
Last active July 31, 2019 17:24
ensure resource example
# declare a resource
user{'corey': ensure => present }
# ensure resource will check if resource exist
ensure_resource('user', 'corey', {'ensure' => 'present'})
# now the oppesite order
reset
ensure_resource('user', 'corey', {'ensure' => 'present'})
user{'corey': ensure => present }
@logicminds
logicminds / gist:c245b05938c031635b5e898fe9fc6e56
Created May 27, 2019 15:37
Example of new feature showing evaluated parameters
include nodejs
# show all resources starting with the word node
ls node
@logicminds
logicminds / r10k_validate.rb
Last active January 29, 2019 20:12
r10k validation
#!/usr/bin/env ruby
# Author: NWOPS, LLC <automation@nwops.io>
# Purpose: Vaiidate the git urls and branches, refs, or tags in the Puppetfile
# Date: 1/14/19
# exits with 1 if Puppetfile is invalid, 0 otherwise
# Usage: ./check_puppetfile.rb [path_to_puppetfile]
# Example Output
#
# NAME | URL | REF | STATUS
# ---------|-----------------------------------------------|--------------------------------|-------
@logicminds
logicminds / serverless_catalog_consumer.rb
Created September 25, 2018 19:59
Code to consume a a catalog form a puppet serverless catalog compiler
#!/usr/bin/env ruby
require 'puppet'
require 'json'
require 'tmpdir'
require 'net/http'
require 'uri'
require 'puppet/configurer'
def retrieve_catalog
@logicminds
logicminds / data.json
Created September 20, 2018 19:24
about me for puppet podcast
{
"title": "DevOps Consultant",
"bio": "Corey Osman is a longtime DevOps advocate and is the founder of a nimble software consulting company called NWOPS, LLC.\n Their mission is to forge tools and apps to help automate infrastructure, developer workflows and teach devops culture to large organizations. More recently Corey has invested time and money into the world of crypto currency by automating and writing tools where needed. \nIn his free time, Corey enjoys being temporarily trapped in a warm cabin on Mount Hood with plenty of food, beer, and snow.",
"links": [
"https://www.nwops.io", "https://www.puppet-debugger.com", "https://logicminds.github.io", "http://www.blockops.party/"
]
}
@logicminds
logicminds / Dockerfile
Last active August 1, 2018 17:40
dockerfiile for truffle ruby
FROM ubuntu:18.04
ARG GRAALVM_VERSION=1.0.0-rc4
RUN DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y make gcc tzdata readline-common libreadline-dev locales llvm clang curl zlib1g-dev libssl-dev tree vim && \
curl -Ls https://github.com/oracle/truffleruby/releases/download/vm-${GRAALVM_VERSION}/ruby-installable-ce-${GRAALVM_VERSION}-linux-amd64.jar -o /tmp/ruby-installable-ce-${GRAALVM_VERSION}-linux-amd64.jar && \
curl -Ls "https://github.com/oracle/graal/releases/download/vm-${GRAALVM_VERSION}/graalvm-ce-${GRAALVM_VERSION}-linux-amd64.tar.gz" -o /usr/local/graalvm-ce-${GRAALVM_VERSION}-linux-amd64.tar.gz
RUN tar -zxf /usr/local/graalvm-ce-${GRAALVM_VERSION}-linux-amd64.tar.gz -C /usr/local && \
@logicminds
logicminds / curl_bash_mineros.sh
Last active February 5, 2018 19:33
mineros installer
apt-get update
apt-get install -y curl wget git
if [[ ! -f /tmp/mineros_0.0.1-1_amd64.deb ]]; then
curl -o /tmp/mineros_0.0.1-1_amd64.deb https://s3.amazonaws.com/nwops-omnibus/ubuntu/14.04/x86_64/mineros_0.0.1-1_amd64.deb/mineros_0.0.1-1_amd64.deb
fi
dpkg -i /tmp/mineros_0.0.1-1_amd64.deb
#!/usr/bin/env bash
breed=$PT_breed
if [[ $EUID -ne 0 ]]; then
pre_command='sudo '
else
pre_command=''
fi
which tput >/dev/null 2>&1
@logicminds
logicminds / pp
Last active December 18, 2017 01:29
puppet map bug?
$rvalue = [1,2,3].map |$key| { ["${key}blah"] }
$rvalue[0] =~ Array[String]
@logicminds
logicminds / common.yaml
Created October 20, 2017 22:09
complex hiera lookups
foo_complex_alias: "%{alias('foo_complex')}"
foo_complex:
- "%{alias('complex_type1')}"
- "%{alias('complex_type2')}"
- "%{alias('complex_type3')}"
- "%{alias('complex_type4')}"
- "%{alias('complex_type5')}"
foo_complex2: