Skip to content

Instantly share code, notes, and snippets.

@baurmatt
baurmatt / ubuntu-remote-cryptsetup-unlock-via-dropbear.sh
Last active August 3, 2022 11:39
Ubuntu Remote CryptSetup Unlock via Dropbear
sudo apt install dropbear-initramfs
sudo cp $HOME/.ssh/authorized_keys /etc/dropbear/initramfs/authorized_keys
echo "DROPBEAR_OPTIONS='-I 60 -s -c cryptroot-unlock'" | sudo tee -a /etc/dropbear/initramfs/dropbear.conf
sudo update-initramfs -u
sudo systemctl reboot
cat >> $HOME/.ssh/config <<EOL
Host nas01-unlock
Hostname nas01
User root
@baurmatt
baurmatt / crash.log
Last active October 1, 2019 09:51
terraform.openstack_compute_instance_v2.debug.log
2019/10/01 11:49:34 [INFO] Terraform version: 0.12.7
2019/10/01 11:49:34 [INFO] Go runtime version: go1.12.9
2019/10/01 11:49:34 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"}
2019/10/01 11:49:34 [DEBUG] Attempting to open CLI config file: /Users/mbaur/.terraformrc
2019/10/01 11:49:34 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/10/01 11:49:34 [INFO] CLI command args: []string{"plan"}
2019/10/01 11:49:34 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/10/01 11:49:34 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/10/01 11:49:34 [DEBUG] New state was assigned lineage "29119a23-4324-a168-e97a-b56ef498c977"
2019/10/01 11:49:34 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
@baurmatt
baurmatt / gist:86ea02c0fd6dd173efab4a7bb7ddf23e
Created September 25, 2018 07:15
Error: Evaluation Error: Error while evaluating a Function Call, undefined local variable or method `created' for Puppet::Pops::Loader::RubyLegacyFunctionInstantiator:Class
Error: Evaluation Error: Error while evaluating a Function Call, undefined local variable or method `created' for Puppet::Pops::Loader::RubyLegacyFunctionInstantiator:Class
Did you mean? create (file: /tmp/kitchen/modules/sys11mysql/manifests/init.pp, line: 105, column: 30) on node da0373423de9.syseleven.net
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/ruby_legacy_function_instantiator.rb:29:in `create'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/module_loaders.rb:284:in `instantiate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/module_loaders.rb:258:in `find'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:161:in `internal_load'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/base_loader.rb:42:in `load_typed'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/loader/dependency_loader.rb:49:in `block in find'
/opt/puppetlabs/puppet/lib/ruby/ve
@baurmatt
baurmatt / gist:a4b245f080353c64a75852c8da78cda5
Created August 20, 2018 12:44
Puppet rspec error "Could not find the daemon directory" - rspec/Puppet Code
mbaur(2018-08-20 14:43:16) ~/Sources/company-base/modules/fail2ban (pp-5655)
$ cat spec/spec_helper.rb
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts
RSpec.configure do |config|
config.after(:suite) do
RSpec::Puppet::Coverage.report!(100)
end
@baurmatt
baurmatt / config.yaml
Created August 20, 2018 11:34
Puppet rspec error "Could not find the daemon directory" - Gitlab-CI Config
fail2ban-rspec:
image: ruby:2.4
script:
- apt update
- apt -y install make gcc ruby ruby-dev ruby-bundler
- cd modules/fail2ban
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update bundler
@baurmatt
baurmatt / gist:b76e05c1a8d4e693e04a0adea65cacc7
Last active August 20, 2018 11:34
Puppet rspec error "Could not find the daemon directory" - Gitlab-CI Log
Running with gitlab-runner 11.1.0 (081978aa)
on shared_runner_small_multi 547bb737
Using Docker executor with image ruby:2.4 ...
Pulling docker image ruby:2.4 ...
Using docker image sha256:a0ef7ec8476f5f49be26c7630ecc6ae8f9265382a06a6b3b5129a842880e4205 for ruby:2.4 ...
Running on runner-547bb737-project-47-concurrent-0 via runner-547bb737-gitlabci-small-multi-1534500260-0c7648c0...
Fetching changes...
Removing build/
Removing modules/sys11elasticsearch/.kitchen/
HEAD is now at 833295f5 pp-5599 - Delete old nagios/icinga1 stuff
@baurmatt
baurmatt / gist:045e3d9d2fe593df836be4d3387047e6
Created August 15, 2018 08:57
Puppetserver metrics.conf
# settings related to metrics
metrics: {
# a server id that will be used as part of the namespace for metrics produced
# by this server
server-id: "psdev01.puppet.example.org"
registries: {
puppetserver: {
# specify metrics to allow in addition to those in the default list
#metrics-allowed: ["compiler.compile.production"]
mbaur(2018-06-20 13:27:29) ~/Sources/puppetlabs-inifile (master)
$ BEAKER_set=docker/ubuntu-14.04 bundle exec rake beaker
TEST_TIERS env variable not defined. Defaulting to run all tests.
/Users/mbaur/.rvm/rubies/ruby-2.4.3/bin/ruby -I/Users/mbaur/.rvm/gems/ruby-2.4.3@puppetlabs-inifile/gems/rspec-core-3.7.1/lib:/Users/mbaur/.rvm/gems/ruby-2.4.3@puppetlabs-inifile/gems/rspec-support-3.7.1/lib /Users/mbaur/.rvm/gems/ruby-2.4.3@puppetlabs-inifile/gems/rspec-core-3.7.1/exe/rspec spec/acceptance --color
/Users/mbaur/.rvm/gems/ruby-2.4.3@puppetlabs-inifile/gems/beaker-rspec-6.2.3/lib/beaker-rspec/helpers/serverspec.rb:43: warning: already initialized constant Module::VALID_OPTIONS_KEYS
/Users/mbaur/.rvm/gems/ruby-2.4.3@puppetlabs-inifile/gems/specinfra-2.67.3/lib/specinfra/configuration.rb:4: warning: previous definition of VALID_OPTIONS_KEYS was here
Beaker::Hypervisor, found some docker boxes to create
Provisioning docker
provisioning ubuntu-1404-x64
Using docker server at 0.0.0.0
---
version:
config: 1508248331
puppet: 4.10.1
resources:
changed: 0
corrective_change: 2
failed: 0
failed_to_restart: 0
out_of_sync: 4
@baurmatt
baurmatt / puppet-isso.pp
Last active August 29, 2015 14:08
A Puppet recipe for isso
# Needs the following module:
# Apache: https://github.com/puppetlabs/puppetlabs-apache/
# Stdlib: https://github.com/puppetlabs/puppetlabs-stdlib/
# Python: https://github.com/stankevich/puppet-python/
# wget: https://github.com/maestrodev/puppet-wget/
$packages_isso = [ 'python-setuptools', 'sqlite3', 'build-essential', ]
package { $packages_isso: }
##################################################################################