Administering Red Hat Satellite Red Hat Satellite 6.15 Administer users and permissions, manage organizations and locations, back up and restore Satellite, maintain Satellite, and more Red Hat Satellite Documentation Team satellite-doc-list@redhat.com

Commands:
hostname -f
https:// satellite.example.com /pub
scp /var/www/html/pub/katello-server-ca.crt username@hostname:remotefile
https:// satellite.example.com /
kinit idm_user
hammer auth login negotiate
kdestroy -A
hammer host list
kinit idm_user Password for idm_user@ EXAMPLE.COM :
google-chrome --auth-server-whitelist="*. example.com " --auth-negotiate-delegate-whitelist="*. example.com "
kinit idm_user Password for idm_user@_EXAMPLE.COM :
foreman-rake permissions:reset Reset to user: admin, password: qwJxBptxb7Gfcjj5
vi ~/.hammer/cli.modules.d/foreman.yml
foreman-rake permissions:reset password= new_password
vi ~/.hammer/cli.modules.d/foreman.yml
satellite-maintain service list
satellite-maintain service status
satellite-maintain service stop
satellite-maintain service start
satellite-maintain service restart
satellite-maintain backup offline --skip-pulp-content --assumeyes /var/backup
satellite-maintain service stop satellite-maintain service disable
rsync --archive --partial --progress --compress /var/lib/pulp/ target_server.example.com:/var/lib/pulp/
du -sh /var/lib/pulp/
satellite-maintain backup offline --assumeyes /var/backup
satellite-maintain service stop satellite-maintain service disable
subscription-manager register your_customer_portal_credentials subscription-manager repos --disable=* subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms --enable=rhel-8-for-x86_64-baseos-rpms --enable=satellite-maintenance-6.15-for-rhel-8-x86_64-rpms dnf module enable satellite-maintenance:el8
dnf install satellite-clone
satellite-clone
cp /etc/foreman-installer/custom-hiera.yaml /etc/foreman-installer/custom-hiera.original
satellite-installer --tuning medium
satellite-maintain service status --only postgresql
subscription-manager repos --disable '*' subscription-manager repos --enable=satellite-6.15-for-rhel-8-x86_64-rpms --enable=satellite-maintenance-6.15-for-rhel-8-x86_64-rpms --enable=rhel-8-for-x86_64-baseos-rpms --enable=rhel-8-for-x86_64-appstream-rpms
dnf module enable satellite:el8
dnf install postgresql-server postgresql-evr postgresql-contrib
postgresql-setup initdb
vi /var/lib/pgsql/data/postgresql.conf
listen_addresses = '*'
vi /var/lib/pgsql/data/pg_hba.conf
host all all Satellite_ip /32 md5
systemctl enable --now postgresql
firewall-cmd --add-service=postgresql
firewall-cmd --runtime-to-permanent
su - postgres -c psql
CREATE USER "foreman" WITH PASSWORD ' Foreman_Password '; CREATE USER "candlepin" WITH PASSWORD ' Candlepin_Password '; CREATE USER "pulp" WITH PASSWORD ' Pulpcore_Password '; CREATE DATABASE foreman OWNER foreman; CREATE DATABASE candlepin OWNER candlepin; CREATE DATABASE pulpcore OWNER pulp;
postgres=# \c pulpcore You are now connected to database "pulpcore" as user "postgres".
pulpcore=# CREATE EXTENSION IF NOT EXISTS "hstore"; CREATE EXTENSION
\q
PGPASSWORD=' Foreman_Password ' psql -h postgres.example.com -p 5432 -U foreman -d foreman -c "SELECT 1 as ping" PGPASSWORD=' Candlepin_Password ' psql -h postgres.example.com -p 5432 -U candlepin -d candlepin -c "SELECT 1 as ping" PGPASSWORD=' Pulpcore_Password ' psql -h postgres.example.com -p 5432 -U pulp -d pulpcore -c "SELECT 1 as ping"
satellite-maintain service stop
systemctl start postgresql
satellite-maintain backup online --preserve-directory --skip-pulp-content /var/migration_backup
PGPASSWORD=' Foreman_Password ' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump PGPASSWORD=' Candlepin_Password ' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump PGPASSWORD=' Pulpcore_Password ' pg_restore -h postgres.example.com -U pulp -d pulpcore < /var/migration_backup/pulpcore.dump
satellite-installer --foreman-db-database foreman --foreman-db-host postgres.example.com --foreman-db-manage false --foreman-db-password Foreman_Password --foreman-db-username foreman --foreman-proxy-content-pulpcore-manage-postgresql false --foreman-proxy-content-pulpcore-postgresql-db-name pulpcore --foreman-proxy-content-pulpcore-postgresql-host postgres.example.com --foreman-proxy-content-pulpcore-postgresql-password Pulpcore_Password --foreman-proxy-content-pulpcore-postgresql-user pulp --katello-candlepin-db-host postgres.example.com --katello-candlepin-db-name candlepin --katello-candlepin-db-password Candlepin_Password --katello-candlepin-db-user candlepin --katello-candlepin-manage-db false
satellite-maintain packages install ansible-collection-redhat-satellite
ansible-doc -l redhat.satellite
ansible-doc redhat.satellite.activation_key
hammer organization create --name " My_Organization " --label " My_Organization_Label " --description " My_Organization_Description "
hammer organization update --name " My_Organization " --compute-resource-ids 1
vi 'Default Organization-key-cert.pem'
openssl pkcs12 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -in cert.pem -inkey key.pem -out My_Organization_Label .pfx -name My_Organization
https:// satellite.example.com /pulp/content/
curl -k --cert cert.pem --key key.pem https:// satellite.example.com /pulp/content/ My_Organization_Label /Library/content/dist/rhel/server/7/7Server/x86_64/os/
hammer organization list
hammer organization delete --id Organization_ID
hammer location create --description " My_Location_Description " --name " My_Location " --parent-id " My_Location_Parent_ID "
ORG=" Example Organization " LOCATIONS=" London Munich Boston " for LOC in USD{LOCATIONS} do hammer location create --name "USD{LOC}" hammer location add-organization --name "USD{LOC}" --organization "USD{ORG}" done
hammer host list --location " My_Location "
hammer location list
hammer location delete --id Location ID
hammer user create --auth-source-id My_Authentication_Source --login My_User_Name --mail My_User_Mail --organization-ids My_Organization_ID_1 , My_Organization_ID_2 --password My_User_Password
hammer user add-role --id user_id --role role_name
openssl rand -hex 32
hammer user ssh-keys add --user-id user_id --name key_name --key-file ~/.ssh/id_rsa.pub
hammer user ssh-keys add --user-id user_id --name key_name --key ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNtYAAABBBHHS2KmNyIYa27Qaa7EHp+2l99ucGStx4P77e03ZvE3yVRJEFikpoP3MJtYYfIe8k 1/46MTIZo9CPTX4CYUHeN8= host@user
hammer user ssh-keys delete --id key_id --user-id user_id
hammer user ssh-keys info --id key_id --user-id user_id
hammer user ssh-keys list --user-id user_id
curl https:// satellite.example.com /api/status --user My_Username : My_Personal_Access_Token
satellite_version: 6.15.0
result: ok
status: 200
version: 3.5.1.10
api_version: 2
curl https:// satellite.example.com /api/status --user My_Username : My_Personal_Access_Token
{ "error": {"message":"Unable to authenticate user My_Username "} }
hammer user-group create --name My_User_Group_Name --role-ids My_Role_ID_1 , My_Role_ID_2 --user-ids My_User_ID_1 , My_User_ID_2
hammer role create --name My_Role_Name
hammer filter available-permissions
hammer filter create --permission-ids My_Permission_ID_1 , My_Permission_ID_2 --role My_Role_Name
foreman-rake console
f = File.open('/tmp/table.html', 'w') result = Foreman::AccessControl.permissions {|a,b| a.security_block <=> b.security_block}.collect do |p| actions = p.actions.collect { |a| "<li>#{a}</li>" } "<tr><td>#{p.name}</td><td><ul>#{actions.join('')}</ul></td><td>#{p.resource_type}</td></tr>" end.join("\n") f.write(result)
<table border="1"><tr><td>Permission name</td><td>Actions</td><td>Resource type</td></tr>
</table>
field_name operator value
hammer filter create --permission-ids 91 --search "name ~ ccv*" --role qa-user
hostgroup = host-editors
name ^ (XXXX, Yyyy, zzzz)
Dev
postqueue: warning: Mail system is down -- accessing queue directly -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- BE68482A783 1922 Thu Oct 3 05:13:36 satellite-noreply@example.com
systemctl start postfix
foreman-rake reports:_My_Frequency_
satellite-maintain service stop
satellite-maintain service start
du -sh /var/lib/pgsql/data /var/lib/pulp 100G /var/lib/pgsql/data 100G /var/lib/pulp du -csh /var/lib/tftpboot /etc /root/ssl-build /var/www/html/pub /opt/puppetlabs 16M /var/lib/tftpboot 37M /etc 900K /root/ssl-build 100K /var/www/html/pub 2M /opt/puppetlabs 942M total
satellite-maintain backup offline --help
satellite-maintain backup online --help
satellite-maintain backup snapshot --help
satellite-maintain backup offline /var/satellite-backup
satellite-maintain backup offline /var/foreman-proxy-backup
satellite-maintain backup offline --skip-pulp-content /var/backup_directory
satellite-maintain backup offline /var/backup_directory
satellite-maintain backup offline --incremental /var/backup_directory/full_backup /var/backup_directory
satellite-maintain backup offline --incremental /var/backup_directory/first_incremental_backup /var/backup_directory
satellite-maintain backup offline --incremental /var/backup_directory/full_backup /var/backup_directory
#!/bin/bash -e PATH=/sbin:/bin:/usr/sbin:/usr/bin DESTINATION=/var/backup_directory if [[ USD(date +%w) == 0 ]]; then satellite-maintain backup offline --assumeyes USDDESTINATION else LAST=USD(ls -td -- USDDESTINATION/*/ | head -n 1) satellite-maintain backup offline --assumeyes --incremental "USDLAST" USDDESTINATION fi exit 0
satellite-maintain backup online /var/backup_directory
satellite-maintain backup snapshot -h
satellite-maintain backup snapshot /var/backup_directory
du -sh /var/backup_directory
df -h /var/backup_directory
restorecon -Rv /
satellite-maintain restore /var/backup_directory
satellite-maintain restore /var/backup_directory /FIRST_INCREMENTAL satellite-maintain restore /var/backup_directory /SECOND_INCREMENTAL
satellite-change-hostname new-satellite --username My_Username --password My_Password
satellite-change-hostname new-satellite --username My_Username --password My_Password --custom-cert "/root/ownca/test.com/test.com.crt" --custom-key "/root/ownca/test.com/test.com.key"
satellite-installer --foreman-proxy-foreman-base-url https:// new-satellite.example.com --foreman-proxy-trusted-hosts new-satellite.example.com
hammer capsule list
hammer capsule content synchronize --id My_capsule_ID
capsule-certs-generate --certs-tar /root/ new-capsule.example.com-certs.tar --foreman-proxy-fqdn new-capsule.example.com
scp /root/ new-capsule.example.com-certs.tar root@ capsule.example.com :
satellite-change-hostname new-capsule.example.com --certs-tar /root/ new-capsule.example.com-certs.tar --password My_Password --username My_Username
dnf remove katello-ca-consumer* dnf install http:// new-capsule.example.com /pub/katello-ca-consumer-latest.noarch.rpm subscription-manager register --environment=" My_Lifecycle_Environment " --force --org=" My_Organization " subscription-manager refresh
foreman-rake audits:expire days= Number_Of_Days
foreman-rake audits:anonymize days=7
foreman-rake reports:expire days=7
satellite-installer --foreman-plugin-tasks-cron-line "00 15 * * *"
satellite-installer --foreman-plugin-tasks-automatic-cleanup false
satellite-installer --foreman-plugin-tasks-automatic-cleanup true
foreman-rake foreman_tasks:cleanup TASK_SEARCH='label = Actions::Katello::Repository::Sync' STATES='stopped'
ssh root@satellite.example.com
hammer task info --id My_Task_ID
foreman-rake foreman_tasks:cleanup TASK_SEARCH="id= My_Task_ID "
hammer task info --id My_Task_ID
foreman-rake katello:delete_orphaned_content RAILS_ENV=production
satellite-maintain service stop
satellite-maintain service start
satellite-maintain packages install package_1 package_2
satellite-maintain packages check-update
satellite-maintain packages update
satellite-maintain packages update package_1 package_2
satellite-maintain service stop --exclude postgresql
su - postgres -c 'vacuumdb --full --all'
satellite-maintain service start
foreman-rake katello:delete_orphaned_content
katello-certs-check -t satellite -b /root/ satellite_cert/ca_cert_bundle.pem -c /root/ satellite_cert/satellite_cert.pem -k /root/ satellite_cert/satellite_cert_key.pem
satellite-installer --scenario satellite --certs-server-cert "/root/ satellite_cert/satellite_cert.pem " --certs-server-key "/root/ satellite_cert/satellite_cert_key.pem " --certs-server-ca-cert "/root/ satellite_cert/ca_cert_bundle.pem " --certs-update-server --certs-update-server-ca
katello-certs-check -t capsule -b /root/ capsule_cert/ca_cert_bundle.pem -c /root/ capsule_cert/capsule_cert.pem -k /root/ capsule_cert/capsule_cert_key.pem
capsule-certs-generate --certs-tar " /root/My_Certificates/capsule.example.com-certs.tar " --certs-update-server --foreman-proxy-fqdn " capsule.example.com " --server-ca-cert " /root/My_Certificates/ca_cert_bundle.pem " --server-cert " /root/My_Certificates/capsule_cert.pem " --server-key " /root/My_Certificates/capsule_cert_key.pem "
scp /root/My_Certificates/capsule.example.com-certs.tar user@capsule.example.com :
satellite-installer --scenario capsule --certs-tar-file " /root/My_Certificates/capsule.example.com-certs.tar " --certs-update-server --foreman-proxy-foreman-base-url "https:// satellite.example.com " --foreman-proxy-register-in-foreman "true"
satellite-installer --foreman-logging-level debug
satellite-installer --reset-foreman-logging-level
satellite-installer --full-help | grep logging
:log_level: 'debug'
satellite-installer --foreman-proxy-log-level DEBUG
satellite-installer --reset-foreman-proxy-log-level
satellite-installer --katello-candlepin-loggers log4j.logger.org.candlepin:DEBUG
satellite-installer --katello-candlepin-loggers log4j.logger.org.candlepin:DEBUG --katello-candlepin-loggers log4j.logger.org.candlepin.resource.ConsumerResource:WARN --katello-candlepin-loggers log4j.logger.org.candlepin.resource.HypervisorResource:WARN
satellite-installer --reset-katello-candlepin-loggers
loglevel debug
systemctl restart redis
satellite-installer --verbose-log-level debug
LOGGING = {"dynaconf_merge": True, "loggers": {'': {'handlers': ['console'], 'level': 'DEBUG'}}}
systemctl restart pulpcore-api pulpcore-content pulpcore-resource-manager pulpcore-worker@1 pulpcore-worker@2 redis
satellite-installer --puppet-agent-additional-settings log_level:debug
satellite-installer --puppet-server-additional-settings log_level:debug
satellite-maintain service restart --only puppetserver
hammer admin logging --list
hammer admin logging --all --level-debug satellite-maintain service restart
hammer admin logging --all --level-production satellite-maintain service restart
hammer admin logging --components My_Component --level-debug satellite-maintain service restart
hammer admin logging --help
satellite-installer --foreman-logging-type journald --foreman-proxy-log JOURNAL
satellite-installer --reset-foreman-logging-type --reset-foreman-proxy-log
satellite-installer --foreman-logging-layout json --foreman-logging-type file
cat /var/log/foreman/production.log | jq
satellite-installer --foreman-loggers ldap:true --foreman-loggers sql:true
satellite-installer --reset-foreman-loggers
hammer ping
satellite-maintain service status
satellite-maintain health check
satellite-maintain service restart
awk '/add_loggers/,/^USD/' /usr/share/foreman/config/application.rb
There was an issue with the backend service candlepin: Connection refused - connect(2).
foreman-rake audits:list_attributes
satellite-installer --enable-foreman-plugin-webhooks
satellite-installer --enable-foreman-cli-webhooks
text: job invocation <%= @object.job_invocation_id %> finished with result <%= @object.task.result %>
text: user with login <%= @object.login %> and email <%= @object.mail %> created
satellite-installer --enable-foreman-proxy-plugin-shellhooks
X-Shellhook-Arg-1:  VALUE 
X-Shellhook-Arg-2:  VALUE 
X-Shellhook-Arg-1: <%= @object.content_view_version_id %>
X-Shellhook-Arg-2: <%= @object.content_view_name %>
"X-Shellhook-Arg-1: VALUE " "X-Shellhook-Arg-2: VALUE "
curl -sX POST -H 'Content-Type: text/plain' -H "X-Shellhook-Arg-1: Version 1.0" -H "X-Shellhook-Arg-2: My content view" --data "" https://capsule.example.com:9090/shellhook/My_Script
#!/bin/sh # Prints all arguments to stderr # echo "USD@" >&2
https:// capsule.example.com :9090/shellhook/print_args
X-Shellhook-Arg-1: Hello
X-Shellhook-Arg-2: World!
tail /var/log/foreman-proxy/proxy.log
[I] Started POST /shellhook/print_args [I] Finished POST /shellhook/print_args with 200 (0.33 ms) [I] [3520] Started task /var/lib/foreman-proxy/shellhooks/print_args\ Hello\ World\! [W] [3520] Hello World!
parameter operator value