Skip to content

Instantly share code, notes, and snippets.

Ewoud Kohl van Wijngaarden ekohl

Block or report user

Report or block ekohl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:808d9ce707d1a1e0ed868da4a1589a6b
$ cat modules/puppet-*/metadata.json | jq '.operatingsystem_support[].operatingsystem' | sort | uniq -c | sort -h
jq: error (at <stdin>:120): Cannot iterate over null (null)
jq: error (at <stdin>:1725): Cannot iterate over null (null)
jq: error (at <stdin>:2048): Cannot iterate over null (null)
jq: error (at <stdin>:5360): Cannot iterate over null (null)
1 "CloudLinux"
1 "Darwin"
1 "DragonFly"
1 "NetBSD"
1 "PCS"
View module_versions.rb
#!/usr/bin/env ruby
require 'librarian/puppet'
librarian_environment = Librarian::Puppet::Environment.new(pwd: 'Puppetfile.lock')
librarian_environment.lock.manifests.sort_by { |manifest| manifest.name.split('-').last }.each do |manifest|
puts "#{manifest.name.split('-').last} #{manifest.version}"
end
View defaults.json
{
"username": "admin",
"password": "changeme",
"name": "Admin User"
}
@ekohl
ekohl / tiers.py
Last active Jun 13, 2019
A script to determine tiers
View tiers.py
#!/usr/bin/env python3
# Requires Python 3.7 for dataclasses
import argparse
import json
from dataclasses import dataclass
@dataclass(eq=True, frozen=True, order=True)
@ekohl
ekohl / fp-curl
Created May 17, 2019
A script that wraps curl with the right connection details
View fp-curl
#!/usr/bin/env ruby
#
# This script wraps curl with the right connection details so you don't need to
# care about it.
#
# The first argument is the path on the host, including the first slash:
#
# ./fp-curl /features
# ./fp-curl /v2/features | jq .
# ./fp-curl /puppet/ca/host.example.com -X DELETE
@ekohl
ekohl / module-versions
Created Apr 2, 2019
Show puppet module versions
View module-versions
#!/usr/bin/env ruby
require 'librarian/puppet'
librarian_environment = Librarian::Puppet::Environment.new(pwd: 'Puppetfile.lock')
librarian_environment.lock.manifests.sort_by { |manifest| manifest.name.split('-').last }.each do |manifest|
author, name = manifest.name.split('-')
if ['theforeman', 'katello'].include?(author)
branch = "#{manifest.version.to_s.split('.')[0..1].join('.')}-stable"
puts "puppet-#{name} #{branch} #{manifest.version}"
View nightly.sh
#!/bin/bash -e
PACKAGE="$1"
SOURCE_DIR="${2:-${HOME}/dev/${PACKAGE}}"
if [[ -z $PACKAGE ]] ; then
echo "Usage: $0 PACKAGE"
exit 1
fi
@ekohl
ekohl / example
Last active Apr 10, 2019
get_package_names
View example
$ ./get_package_names foreman-release
foreman-nightly-nonscl-rhel7 foreman-release-1.22.0-0.1.develop.el7
foreman-client-nightly-rhel5 foreman-release-1.22.0-0.1.develop.el5
foreman-client-nightly-rhel6 foreman-release-1.22.0-0.1.develop.el6
foreman-client-nightly-fedora27 foreman-release-1.22.0-0.1.develop.fc27
foreman-client-nightly-fedora28 foreman-release-1.22.0-0.1.develop.fc28
$ ./get_package_names --dist el7 foreman-release
foreman-nightly-nonscl-rhel7 foreman-release-1.22.0-0.1.develop.el7
$ ./get_package_names foreman-release rubygem-foreman_templates
@ekohl
ekohl / graph.py
Last active Dec 27, 2018
Foreman Installer dependencies
View graph.py
#!/usr/bin/env python3
import argparse
import json
def normalize_name(module):
full_name = module.replace('-', '/', 1).lower()
author, name = full_name.split('/', 1)
return name if author in ('theforeman', 'katello') else full_name
View module-deps
Checking modules/puppet-allknowingdns/metadata.json
Checking modules/puppet-alternatives/metadata.json
Checking modules/puppet-amanda/metadata.json
Checking modules/puppet-appd_db_agent/metadata.json
puppet/archive (>= 1.1.2 <3.0.0) doesn't match 3.1.1
Checking modules/puppet-archive/metadata.json
Checking modules/puppet-autofs/metadata.json
Checking modules/puppet-bird/metadata.json
Checking modules/puppet-boolean/metadata.json
Checking modules/puppet-cassandra/metadata.json
You can’t perform that action at this time.