Skip to content

Instantly share code, notes, and snippets.

View Magisus's full-sized avatar

Maggie Dreyer Magisus

  • Puppet, Inc.
  • Portland, OR
View GitHub Profile
require 'openssl'
# To use this script to generate a CRL, supply the path to the cert
# PEM file, followed by the key PEM file, followed by the output path
# for the CRL.
#
# Example:
# ruby generate_crl.rb ca_crt.pem ca_key.pem new_crl.pem
#
# The resulting CRL should be concatenated into a file with the other
require 'puppet'
require 'puppet/parser'
require 'json'
require 'google/cloud/bigquery'
require 'zlib'
require 'rubygems/package'
require 'pry'
ENV["BIGQUERY_PROJECT"] = "platform-dujour-dev"
ENV["BIGQUERY_CREDENTIALS"] = "/Users/aileen/code/platform-dujour-dev.json"
@Magisus
Magisus / analytics_test.sh
Last active August 6, 2020 20:29
Test dujour setup
# On a Centos 7 pooler VM
# Install PE
latest_pe=$(curl https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/master/ci-ready/LATEST)
curl -O "https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/master/ci-ready/puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
tar xvf "puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
pushd "puppet-enterprise-${latest_pe}-el-7-x86_64"
# This will prompt you with the normal installer prompts
./puppet-enterprise-installer
#!/usr/bin/bash
# On a centos7 VM from the pooler.
# Install PE
latest_pe=$(curl http://neptune.puppetlabs.lan/2019.1/ci-ready/LATEST)
curl -O "http://neptune.puppetlabs.lan/2019.1/ci-ready/puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
tar xvf "puppet-enterprise-${latest_pe}-el-7-x86_64.tar"
pushd "puppet-enterprise-${latest_pe}-el-7-x86_64"
Ruby 2.5.1 #1
> total: 22.252030 0.735889 22.987919 ( 23.713942)
> avg: 2.225203 0.073589 2.298792 ( 2.371394)
Ruby 2.5.1 #2
> total: 18.067680 0.557513 18.625193 ( 18.682405)
> avg: 1.806768 0.055751 1.862519 ( 1.868240)
Ruby 2.5.1 #3
> total: 18.897436 0.629799 19.527235 ( 19.696831)
@Magisus
Magisus / external-ca
Last active September 10, 2018 23:06
1) Create self-signed root CA cert
2) Create CSR for intermediate CA cert
3) Sign with root
4) Create CRL for root
5) Create CRL for intermediate
6) Concatenate intermediate cert and root cert into one file (e.g. bundle.pem), intermediate first
7) Concatenate intermediate CRL and root CRL into one file (e.g. crls.pem), intermediate first
To import:
puppetserver ca import --cert-bundle bundle.pem --crl-chain crls.pem --private-key intermediate-key.pem
@Magisus
Magisus / puppetserver-build-stacktrace.txt
Created August 11, 2017 20:49
Puppetserver build stacktrace
org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact puppetlabs:puppetserver:jar:5.0.1-master-20170811.202035-167 in snapshots (http://nexus.delivery.puppetlabs.net/content/repositories/snapshots/)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:294)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
- Specific Test Case Status -
Failed Tests Cases:
Test Case ./tests/lookup/v3_config_and_data.rb reported: #<Minitest::Assertion: 4: lookup subcommand didn't exit properly: (1)>
Test line: ./tests/lookup/v3_config_and_data.rb:94:in `block (4 levels) in run_test'
Test Case ./tests/lookup/v4_hieradata_with_v5_configs.rb reported: #<Minitest::Assertion: 1: lookup subcommand didn't exit properly: (1)>
Test line: ./tests/lookup/v4_hieradata_with_v5_configs.rb:88:in `block (4 levels) in run_test'
Errored Tests Cases:
Test Case ./tests/ticket_3360_allow_duplicate_csr_with_option_set.rb reported: #<RuntimeError: PuppetAcceptance::DSL::Helpers.with_puppet_running_on failed (check backtrace for location) because: Host 'xxsovj8gk5bzq0e.delivery.puppetlabs.net' exited with 24 running:
puppet cert --sign --all
Failed Tests Cases:
Test Case ./tests/ensure_puppet-agent_paths.rb reported: #<Beaker::DSL::Outcomes::FailTest:
Failed to find expected binary '/usr/bin/mco.bat' on agent 'q4sfil251ilvy5w.delivery.puppetlabs.net'
>
Test line: ./tests/ensure_puppet-agent_paths.rb:167:in `block (3 levels) in run_test'
Test Case ./tests/language/server_set_facts.rb reported: #<Minitest::Assertion: q4sfil251ilvy5w.delivery.puppetlabs.net: $server_facts should error if overwritten.
Expected /Error.*Attempt to assign to a reserved variable name: 'server_facts'/ to match "C:/cygwin64/lib/ruby/gems/2.4.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbCFTypes.rb:24: warning: constant ::Fixnum is deprecated\n\e[1;33mWarning: Unable to fetch my n
Ruby 2.3.3:
Warning: /opt/puppetlabs/puppet/lib/ruby/2.3.0/openssl/ssl.rb:318:in `post_connection_check' /opt/puppetlabs/puppet/lib/ruby/2.3.0/net/http.rb:944:in `connect' /opt/puppetlabs/puppet/lib/ruby/2.3.0/net/http.rb:863:in `do_start' /opt/puppetlabs/puppet/lib/ruby/2.3.0/net/http.rb:858:in `start' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/pool.rb:83:in `borrow' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/pool.rb:25:in `with_connection' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/connection.rb:217:in `with_connection' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/connection.rb:175:in `block in request_with_redirects' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/connection.rb:172:in `upto' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/connection.rb:172:in `request_with_redirects' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/connection.rb:116:in `put' /opt/puppetlabs/pupp