This file contains 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
--- | |
# vim: ts=2 sw=2 ai expandtab | |
- name: Register to Satellite | |
hosts: clients | |
connection: smart | |
gather_facts: true | |
become: true | |
vars_files: | |
- satellite_credentials.yml |
This file contains 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
I, [2023-11-24 16:30:23+0530 #155557] INFO -- : --- Execution step 'Check for Puppet capsules from the database' finished --- | |
I, [2023-11-24 16:30:23+0530 #155557] INFO -- : --- Execution step 'Remove Puppet feature' [puppet-remove-puppet] started --- | |
D, [2023-11-24 16:30:23+0530 #155557] DEBUG -- : Running command rpm -q 'rubygem-foreman_puppet' with stdin nil | |
D, [2023-11-24 16:30:23+0530 #155557] DEBUG -- : output of the command: | |
rubygem-foreman_puppet-5.0.0-1.el8sat.noarch | |
D, [2023-11-24 16:30:23+0530 #155557] DEBUG -- : Running command foreman-rake db:migrate VERSION=0 SCOPE=foreman_puppet with stdin nil | |
D, [2023-11-24 16:30:37+0530 #155557] DEBUG -- : output of the command: | |
== 20220421204325 DropEnvironmentFromHostAndHg: reverting ===================== | |
== 20220421204325 DropEnvironmentFromHostAndHg: reverted (0.0000s) ============ |
This file contains 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
First step, | |
--> Cascade delete two offending tables | |
--> and delete these migrations i.e. 20090905150132 20101121140000 20201125113903 20200803113803 20200722171017 20200803113531 20200803113903 20211111125003 from schema_migration tables | |
Command to do both at once: | |
# cat << EOF |foreman-rake console | |
User.current = User.anonymous_admin | |
ActiveRecord::Base.connection.drop_table(:hostgroup_puppet_facets, if_exists: true, force: :cascade) | |
ActiveRecord::Base.connection.drop_table(:host_puppet_facets, if_exists: true, force: :cascade) |
This file contains 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
** LEAPP Best Practices from RHEL Point of view: https://access.redhat.com/articles/7012979 | |
A) Ensure /var/lib/pgsql/data is empty | |
B) The postgresql data | |
Satellite\Capsule 6.11 on RHEL 7 -> postgres data resides on /var/opt/rh/rh-postgresql12/ | |
Satellite\Capsule 6.11 on RHEL 8 -> postgres data resides on /var/lib/pgsql |
This file contains 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
# ls -ld /etc/pki/product /etc/pki/product-default/ | |
drwxr-xr-x. 2 root root 51 Jun 3 11:02 /etc/pki/product | |
drwxr-xr-x. 2 root root 21 Feb 15 2022 /etc/pki/product-default/ | |
# for i in `ls /etc/pki/product/* /etc/pki/product-default/*`; do ls -l $i; done | |
-rw-r--r--. 1 root root 2183 May 24 19:31 /etc/pki/product/269.pem | |
-rw-r--r--. 1 root root 2139 May 24 19:31 /etc/pki/product/408.pem | |
-rw-r--r--. 1 root root 2171 Jun 3 11:02 /etc/pki/product/479.pem | |
-rw-r--r--. 1 root root 2171 Oct 7 2021 /etc/pki/product-default/479.pem |
This file contains 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
# ls -ld /etc/pki/product /etc/pki/product-default/ | |
drwxr-xr-x. 2 root root 51 Aug 4 02:41 /etc/pki/product | |
drwxr-xr-x. 2 root root 20 Jul 26 06:20 /etc/pki/product-default/ | |
# for i in `ls /etc/pki/product/* /etc/pki/product-default/*`; do ls -l $i; done | |
-rw-r--r--. 1 root root 2183 Aug 4 02:41 /etc/pki/product/201.pem | |
-rw-r--r--. 1 root root 2151 Aug 4 02:41 /etc/pki/product/250.pem | |
-rw-r--r--. 1 root root 2139 Aug 4 02:41 /etc/pki/product/408.pem | |
-rw-r--r--. 1 root root 2159 Dec 2 2020 /etc/pki/product-default/69.pem |
This file contains 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
# Set the prefix to Ctrl+a | |
set -g prefix C-a | |
# Remove the old prefix | |
unbind C-b | |
# Send Ctrl+a to applications by pressing it twice | |
bind C-a send-prefix | |
# use mouse and enable scrolling |
This file contains 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 | |
mongo pulp_database --eval "db.units_docker_blob.find({},{"_id":0, "_storage_path":1}).toArray()" | grep _storage_path|cut -d '"' -f 4 > all_blob_lists_on_db.txt | |
for blobs in $(cat all_blob_lists_on_db.txt); | |
do | |
STATUS=$(sha256sum $blobs 2>&1 || echo "missing file $blobs") | |
CHECKSUM_DB=$(echo $blobs|cut -d ':' -f 2) | |
echo "Processing list : $blobs." | |
if [[ $STATUS == *"missing file"* ]] |
This file contains 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 | |
remote_id=$1 | |
if [ ! -z $remote_id ] | |
then | |
psql_core_remote() { | |
# the trailing sed: we need to replace null value output \N by empty string | |
su - postgres -c "psql pulpcore -c \"COPY (SELECT $1 FROM core_remote WHERE pulp_id = '${remote_id}') TO STDOUT;\"" | sed 's!^\\N$!!1' | |
} |
This file contains 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 | |
NAME="$1" | |
if [ -z "$NAME" ] | |
then | |
echo 'Please pass a valid repository name with quotes. Refer the "hammer repository list" output for the names'. | |
exit 0; | |
fi | |
echo "COPY(select main.id,root.name,main.relative_path from katello_root_repositories root left JOIN katello_repositories main on main.root_id=root.id where main.library_instance_id is null and root.name = '$NAME') TO STDOUT WITH CSV;" | su - postgres -c "psql foreman" > /tmp/library_repos.txt |
NewerOlder