Skip to content

Instantly share code, notes, and snippets.

## While at Foreman 1.6 / Katello 2.4.0 or other older version of Foreman
# foreman-upgrade-check
1) Task Check:
[ERROR] You have 5 paused tasks that need to be resumed or killed before proceeding with upgrading
2) Version Check:
[ERROR] Your Foreman is at 1.6.3 and needs to be upgraded to 1.11.X before upgrading
## While at 6.1.8
# satellite-upgrade-check
1) Task Check:
[ERROR] You have 5 paused tasks that need to be resumed or killed before proceeding with upgrading to 6.2
2) Version Check:
[ERROR] Your Satellite is at 6.1.8 and needs to be upgraded to 6.1.9 before upgrading to 6.2
# INSTRUCTIONS:
# 1) COPY THIS FILE TO /usr/share/foreman/lib/tasks
# 2) Run as root via:
# foreman-rake katello:reindex_object
# This will list all the model names. To index a specific object run:
# $ foreman-rake katello:reindex_object MODEL=System
# This will reindex all System objects (Content Hosts)
namespace :katello do
From 0e2560e045dad843950461affad51d69c4b9f9d2 Mon Sep 17 00:00:00 2001
From: Randy Barlow <[email protected]>
Date: Wed, 23 Mar 2016 20:58:52 +0000
Subject: [PATCH] Streamer download requests use permanently stored pem files.
This commit begins a shift towards storing repository PEM data (CA
certificates, client certificates, and client keys) on the
filesystem, and passing paths to those certs to Nectar rather than
allowing nectar to write them in temporary files.
# Squid Configuration Fixes
cd /usr/share/katello-installer-base/modules/pulp
wget https://gist.githubusercontent.com/mccun934/db8a0233840c2f329852d81aabb2e2ef/raw/194e9fe8a9ba03e6258e13f393ef6f03e3cfde1f/squid-fix.patch
patch -p1 < squid-fix.patch
foreman-installer
# Patch for Pulp Issue #1771 TBD
From 8b18bf4ccd7589c592e6aa1eb6c40ba20f4c0716 Mon Sep 17 00:00:00 2001
From: David Davis <[email protected]>
Date: Mon, 28 Mar 2016 09:25:57 -0400
Subject: [PATCH] Fixes #14361 - Setting a couple missing squid options
---
manifests/config.pp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/manifests/config.pp b/manifests/config.pp
namespace :katello do
namespace :upgrades do
namespace '2.1' do
task :import_errata => ["environment"] do
def error(exception, host)
message = _("There was an error updating Content Host %{name} with id %{id}") %
{:name =>host.name, :id => host.id}
puts message
Rails.logger.error(message)
1) Load the mongo console
# mongo
use pulp_database
db.repo_importers.update({importer_type_id: 'yum_importer', 'scratchpad.repomd_revision': {'$gt': 0}}, {'$set': {'scratchpad.repomd_revision': 0}}, {multi: true})
db.units_erratum.update({'id':'RHBA-2016:0077'}, {'$set': {'pkglist': []}})
2) Resync all the Satellite Tools repositories
# hammer --debug ping
[ INFO 2016-02-22 13:54:50 Init] Initialization of Hammer CLI (0.1.4.13) has started...
[DEBUG 2016-02-22 13:54:50 Init] Running at ruby 2.0.0-p598
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-02-22 13:54:50 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
#!/bin/bash
pulp-admin login --user admin --password=$(grep default_password /etc/pulp/server.conf |grep -v '\#' | awk '{print $2}')
echo "******* Pulp users before re-creation"
echo ""
pulp-admin auth user list
cd /tmp