Skip to content

Instantly share code, notes, and snippets.

View jeremylenz's full-sized avatar

Jeremy Lenz jeremylenz

  • New York, NY
View GitHub Profile
params = { format: 'html', template_id: 138, input_values: { '23' => { value: '180' } } }
# OR params = { format: 'html', template_id: '138-Subscription%20-%20Entitlement%20Report', input_values: { '23' => { value: '180' }
composer = ReportComposer.new(params)
composer.valid?
# => true
job = composer.schedule_rendering
# #<TemplateRenderJob:0x000000001131fbf8
# @arguments=[{"format"=>"html", "template_id"=>138, "input_values"=>{"23"=>{"value"=>"180"}}}, {:user_id=>2}],
# @executions=0,
# @job_id="c69d83ef-5432-49e3-9e3b-1fd93be6ccb2",
// redux index.js
// allow stack trace in Redux devtools for any Redux action
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace: true}) || compose;
# Change Foreman's logging gem settings to log the full logger name instead of just the first 3 characters
# config/logging.yaml#L94
:pattern: "%d [%.1l|%c|%.8X{request}] %m\n"
# Log the line, file, and method that calls logger.debug (useless because it's always method_missing):
log_trace: true # can also use %F, %L, %M in the pattern now
katello-enabled-repos-upload --force
# enabled = 1 means it's enabled; enabled = 0 means disabled
cat /etc/yum.repos.d/redhat.repo
# make a new product from an existing custom product
# and attach an existing pool
def make_new_product(product, pool, ak)
new_prod = product.dup
new_prod.name += ' ' + SecureRandom.uuid
new_prod.label = new_prod.name.gsub(/ /, '_').gsub(/[()]/, '_')
new_prod.save!
new_prod.pools << pool
# ak.products << new_prod
openssl x509 -noout -text -in /etc/rhsm/ca/katello-server-ca.pem | grep Public-Key

Technically, a more correct name for an SSL certificate is a "PKI (public key infrastructure) certificate using the TLS protocol"

On a Satellite,

  • /etc/pki/katello/certs contains all of the Katello's certs, including server and CA
  • /etc/rhsm/ca/katello-server-ca.pem can be ignored - this is on the system if it is a client of another katello #KatelloInception

On a Katello client,

  • /etc/rhsm/ca/katello-default-ca.pem contains the pki certificate from Katello downloaded with
rpm -ql tfm-rubygem-katello | head -n 1
@jeremylenz
jeremylenz / dynflow_task_progress.rb
Created November 11, 2020 15:17
methods for tracking dynflow task progress example
module Actions
module Candlepin
module Owner
class UpstreamUpdate < Candlepin::Abstract
input_format do
param :organization_id
param :upstream
end
def run