Skip to content

Instantly share code, notes, and snippets.

@mccun934
mccun934 / task-cleanup-61.bash
Last active December 11, 2017 17:15
Cleanup tasks older than 5 days on Satellite 6.1
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# This will delete all tasks and associated task data from anything older than
# the number of days specified below defaulting to 120 days.
#DAYS_AGO=120
DAYS_AGO=16
echo ""
echo "DELETING All tasks and associated data from [$DAYS_AGO] days ago"
@mccun934
mccun934 / gencerts.sh
Created November 14, 2017 20:10 — forked from JacobCallahan/gencerts.sh
Satellite certificate generator script
#! /bin/bash
git clone https://github.com/iNecas/ownca.git
cd ownca
yes "" | ./generate-ca.sh
yes | ./generate-crt.sh $(hostname)
certdir="$(pwd)/$(hostname)/"
cp cacert.crt $(hostname)/
cd $(hostname)
katello-certs-check -c "$(hostname).crt" -k "$(hostname).key" -r "$(hostname).crt.req" -b cacert.crt
@mccun934
mccun934 / debugging_errata.md
Created November 8, 2017 14:38 — forked from jlsherrill/debugging_errata.md
debugging errata issues

Run all of these in 'foreman-rake console'

Check the event queue:

Katello::Event.count

Check 'bound repositories' known to katello

Please update router settings on Satellite and each Capsule as follows:
(1) In /etc/qpid-dispatch/qdrouterd.conf add the 2 new entries for helloInterval and helloMaxAge:
router {
mode: interior
router-id: satellite.example.com
helloInterval: 10
helloMaxAge: 30
}
@mccun934
mccun934 / gist:9812bd11fa985582bb63e7e7f06fc442
Created October 25, 2017 18:35
increase qpid dispatch timeout
Please update router settings on Satellite and each Capsule as follows:
In /etc/qpid-dispatch/qdrouterd.conf :
router {
mode: interior
router-id: satellite.example.com
helloInterval: 10
helloMaxAge: 30
@mccun934
mccun934 / gist:3558d3506938880cbbc0b8fe18267d93
Last active October 11, 2017 18:41
bulk resync all library repos via hammer
echo "select id from katello_repositories where url is not null" | sudo -u postgres psql -t -d foreman | | xargs -n1 -I arg1 -P 3 hammer repository synchronize --validate-contents yes --id arg1
@mccun934
mccun934 / gist:c8e9510168cc4646ee61d63dd922613f
Created October 2, 2017 14:25
dispatch router hello timeout qpid
Please update router settings on Satellite and each Capsule as follows:
In /etc/qpid-dispatch/qdrouterd.conf :
router {
mode: interior
router-id: sat.example.redhat.com
helloInterval: 10
helloMaxAge: 30
@mccun934
mccun934 / delete-pulp-queues.bash
Created September 20, 2017 16:59
delete all pulp.agent queues
#!/bin/bash
# grab uuids of queues, delete queues
for uuid in $(qpid-stat --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b "amqps://localhost:5671" -q | grep pulp.agent | cut -c14- | awk '{ print $1 }'); do
echo "Deleting pulp.agent.$uuid"
qpid-config --ssl-certificate=/etc/pki/katello/qpid_client_striped.crt -b amqps://localhost:5671 del queue pulp.agent.$uuid --force
done
#!/bin/bash
# Show output of commands
set -x
ORGID=9
for i in {1..10};
do
hammer repository create --name demo-$i --organization-id 9 --product demo --url https://mmccune.fedorapeople.org/repos/demo/repo-$i --content-type yum;
1) run katello-backup on the original capsule - this backs up the client puppet certificates and answers file with no hostname info
2) generate capsule certs on main katello server with hostname of the machine that will be the new capsule
3) install capsule on blank VM/machine
4) copy backup onto capsule and run katello-restore
5) Sync capsule to make sure all content and functionality is restored
6) shut down original capsule , change hostname to original capsule hostname
6) run katello-change-hostname --scenario foreman-proxy-content hostname.example.com