November 18

Linux: Satellite – Content host error Could not calculate errata status

When re registering a Red HAt server into Satellite Katello does not always want to update properly. Below is the fix. After forcing the katello upload it can take 10 to 15 minutes for the updating process to complete:
On Red Hat Satellite 6 Web UI, Content host error Could not calculate errata status, ensure host is registered and katello-agent is installedSolution Verified – Updated July 26 2018 at 4:48 PM – EnglishEnvironment
    Red Hat Satellite 6.x
Issue
    Katello Agent status says Could not calculate errata status, ensure host is registered and katello-agent is installed
Resolution
    Make sure the katello-agent package is installed from Red Hat Satellite 6.x Tools for RHEL Server RPMS repository.
Raw
# yum info katello-agent  | grep -i repo  
# repoquery -i katello-agent | grep -i repository
    Verify if port #5647 of Satellite is reachable from the content host. Also verify if the goferd service is running, we can also restart it.
Raw
# telnet satellite.example.com 5647
# service goferd status
# service goferd restart
    If the above requirements are all fulfilled, run one-time package upload task to calculate the errata.
Raw
# katello-package-upload -f
    Running the above command will create a package profile update task on Red Hat Satellite Web UI.
    Check it from Satellite Web UI -> Monitor -> Tasks, search using “label ~ Actions::Katello::Host::UploadPackageProfile”
Root Cause
    katello-agent was installed from rhel-7-server-optional-rpms repository.

Category: Linux | Comments Off on Linux: Satellite – Content host error Could not calculate errata status
November 18

Linux: Satellite – fixing issue with more licenses being shown in use then actually are being used

foreman-rake katello:clean_backend_objects
The following changes will not actually be performed.  Rerun with COMMIT=true to apply the changes2 orphaned consumer id(s) found in candlepin.0 orphaned consumer id(s) found in pulp.
foreman-rake katello:clean_backend_objects COMMIT=true

Category: Linux | Comments Off on Linux: Satellite – fixing issue with more licenses being shown in use then actually are being used
November 18

Linux: Satellite upgrade notes

Installation:Document used: https://access.redhat.com/documentation/en-us/red_hat_satellite/6.3/html/upgrading_and_updating_red_hat_satellite/upgrading_red_hat_satellite
In general the Red Hat directions work the biggest caveat came when running the health check: [root@ServerName ~]# foreman-maintain upgrade check –target-version 6.3
It kept failing on Satellite due to running tasks background.
foreman-maintain upgrade check –target-version 6.3 Running Checks before upgrading to Satellite 6.3Example output:

Check for paused tasks: [OK] Check whether all services are running using hammer ping: [OK] Check to validate candlepin database: [OK] Check for running tasks: [FAIL] There are 11 active task(s) in the system. Please wait for these to complete or cancel them from the Monitor tab.There are multiple steps to proceed:1) Fetch tasks status and wait till they finish2) Investigate the tasks via UISelect step to continue, [n(next), q(quit)]

The fix was to get into Postgres and disable the jobs manually.
This will list running jobs from postgres:su – postgres -c “psql -d foreman -c ‘select label,count(label),state from foreman_tasks_tasks where state <> ‘\”stopped’\” group by label,state;'”

Example output:
Actions::RemoteExecution::RunHostsJob | 79 | scheduledActions::RemoteExecution::RunHostJob | 11 | runningActions::Katello::EventQueue::Monitor | 1 | runningActions::Insights::EmailPoller | 1 | scheduledActions::Candlepin::ListenOnCandlepinEvents | 1 | running(5 rows)

Notice RunHostsJob is listed as scheduled and RunHostJob is listed as running.  Both of these will cause the health check to fail.
To stop these do run the following command:foreman-rake foreman_tasks:cleanup TASK_SEARCH=’label = Actions::RemoteExecution::RunHostsJob’ STATES=’running,pending,planned,paused,scheduled,planning’ VERBOSE=trueforeman-rake foreman_tasks:cleanup TASK_SEARCH=’label = Actions::RemoteExecution::RunHostJob’ STATES=’running,pending,planned,paused,scheduled,planning’ VERBOSE=true
Now the health check will work.

After pushing out the agent
There is some clean up that needs to take place for yum to work properly on the Red Hat servers connected to Satellite.1. Go to Content View2. Select a view3. Select the Yum Content tab 4. Click Repositories5. Remove the old Satellite Repository by selecting the old one and clicking Remove Repositories6. Click add, find the new Satellite repository and click Add Repositories7. Click the Versions tab8. Go through the process of Publishing a new version and Promoting each Environment.
Once this is complete the client servers will see the new Satellite repository files and work properly.

Category: Linux | Comments Off on Linux: Satellite upgrade notes
November 18

Linux: Registering Server with Satellite

Use the following procedure to register (or re-register) a RedHat (v6 or v7) with our corporate Satellite server (ServerName)
    Open a SSH (Putty) Terminal or VMWare console to the VM.
*NOTE: If you use Putty you can copy and paste the below commands into the shell for quick and easy setup.
    ###For a brand new server, Restart the virt-who service on ServerName###
 * systemctl stop virt-who * virt-who –one-shot  * systemctl start virt-who 
    ###CLEAN THE SUBSCRIPTION-MANAGER CACHE###
 subscription-manager clean
    ###SUBSCRIPTION MANAGER SETUP###
rpm -ivh http://ServerName/pub/katello-ca-consumer-latest.noarch.rpm
    ###REGISTER WITH SATELLITE###    -DEV-
subscription-manager register –org=”companyname” –activationkey=”RHEL7Dev”subscription-manager register –org=”companyname” –activationkey=”RHELD6ev”
    -QA-
subscription-manager register –org=”companyname” –activationkey=”RHEL7QA”subscription-manager register –org=”companyname” –activationkey=”RHEL6QA”
    -PRD-
subscription-manager register –org=”companyname” –activationkey=”RHEL7PRD”subscription-manager register –org=”companyname” –activationkey=”RHEL6PRD”
    ###SUBSRIBE###
subscription-manager subscribe –auto
    ###INSTALL COTELLO AND PUPPET AGENT###
yum install katello-agent puppet -y
    ###INSTALL PUPPET AGENT###
puppet agent -t –server servername.domain.com
    ### APPEND SERVER NAME TO puppet.conf###    RHEL 7
* echo “server = servername.domain.com” >> /etc/puppet/puppet.conf;systemctl enable puppet;systemctl restart puppet;systemctl status puppet
    RHEL 6
* echo “server = servername.domain.com” >> /etc/puppet/puppet.conf;chkconfig puppet on;service puppet restart;service puppet status
    ###RUN YUM UPDATE###
* yum update -y
RHEL7:
systemctl enable puppetsystemctl start puppetsystemctl status puppet (should see green output)
RHEL6:
chkconfig puppet onservice puppet startservice puppet status
We also need to ensure that the /etc/puppet/puppet.conf file has this as it’s last line (in the “Agent” section:
server = servername.domain.com
    ###REMOTE EXECUTION SSH KEY SETUP###
Run this command from the root shell on the satellite:
* ssh-copy-id -i ~foreman-proxy/.ssh/id_rsa_foreman_proxy.pub root@<name-of-host>

* ###IF ERRORS DURING YUM INSTALL###yum clean allrm -rf /var/cache/yum* Then start from the beginning

Category: Linux | Comments Off on Linux: Registering Server with Satellite
November 18

Linux: Puppet syncing and certificate issues

If puppet cannot be updated due to a certificate issue.  Look in the subfolders of/etc/puppetlabs/puppet/ssl to determine if their are pem files with other server names verses the actual name of the server.
If there are delete them with the following:find /etc/puppetlabs/puppet/ssl -name offendingservername.domainname.com.pem -delete

To completely start over with new keys do the following:find /etc/puppetlabs/puppet/ssl -name actualservername.domainname.com.pem -delete
Then goto the satellie server and delete the offending certificate.puppet cert clean actualservername.domainname.com
Go back to the server and run:puppet agent -tv
Goback to the Satellite server and accept all certificates:puppet cert sign –all
Go back to the server and run:puppet agent -tv

Category: Linux | Comments Off on Linux: Puppet syncing and certificate issues