This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax=docker/dockerfile:1.6 | |
| ARG BUILD_OS_TAG | |
| FROM alpine:${BUILD_OS_TAG} as build | |
| ARG BUILD_OS_TAG | |
| RUN apk add --no-cache alpine-sdk doas \ | |
| && echo 'permit nopass :wheel' >> /etc/doas.conf | |
| RUN adduser -D build \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ifeq (${MAKELEVEL},0) | |
| export SCRATCH := $(shell mktemp -d ./.tmp_XXXXXXXX) | |
| $(info Launching clean up task for ${SCRATCH}) | |
| $(shell bash -c "set -m ; trap 'rm -rvf ${SCRATCH};' EXIT; lsof -p $$PPID +r 1;" </dev/null >/dev/null 2>/dev/null & disown) | |
| endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rspec/core' | |
| namespace :check do | |
| desc "Check to ensure defined puppet code has been described in spec\n(defaults: coverage=100)" | |
| task :spec_described, [:coverage] do |_task, args| | |
| args.with_defaults(coverage: '100') | |
| def pluralize(string) | |
| string.end_with?('s') ? "#{string}es" : "#{string}s" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| augeas { 'puppetserver-logback-journal': | |
| incl => '/etc/puppetlabs/puppetserver/logback.xml', | |
| lens => 'Xml.lns', | |
| changes => [ | |
| "defnode aref configuration/root/appender-ref[#attribute/ref='STDOUT'] ''", | |
| "set \$aref/#attribute/ref 'STDOUT'", | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #####> BEGIN: script init | |
| set -o pipefail -o errtrace -o errexit -o nounset -o functrace | |
| __traperror() { | |
| local el=${1:=??} ec=${2:=??} lc="$BASH_COMMAND" | |
| printf "ERROR in %s : line %d error %d\\n [%s]\\n" "$0" "$el" "$ec" "$lc" 1>&2 | |
| exit "${2:=1}" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source ENV['GEM_SOURCE'] || 'https://rubygems.org' | |
| def location_for(place_or_version, fake_version = nil) | |
| git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?} | |
| file_url_regex = %r{\Afile:\/\/(?<path>.*)} | |
| if place_or_version && (git_url = place_or_version.match(git_url_regex)) | |
| [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact | |
| elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) | |
| ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # fake provide rpm dependencies | |
| # | |
| # requires stdlib module | |
| # | |
| # @param provide | |
| # what to provide | |
| # @param extras | |
| # extra provides to add to package | |
| # | |
| # @example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # local resolver configuration | |
| require 'resolv' | |
| Facter.add('resolv') do | |
| setcode do | |
| Resolv::DNS::Config.default_config_hash | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TMPFILE=$(mktemp) | |
| finish() { | |
| rm -f "${TMPFILE}" | |
| } | |
| trap 'finish' EXIT | |
| UNIQ_LINES=20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Facter.add('region_tzinfo') do | |
| ec2m = Facter.value(:ec2_metadata) | |
| # aws instances that have not been powercycled in 2+ years | |
| # will not have region in the metadata | |
| aws_zone = ec2m.dig('placement', 'availability-zone') | |
| iana_tz = case aws_zone | |
| when %r{^ap-southeast-1} | |
| 'Asia/Singapore' | |
| when %r{^ap-southeast-2} | |
| 'Australia/Sydney' |