Verification
time is syncronized , satellite and client are on same time?
if there are no dns first add the entries in /etc/hosts on both the satellite and the client
Unregister from old subcription
with classic
yum repolist
yum-config-manager --disable   # was getting errors.  but system was cloned and 2 systems had same id.
rm /etc/sysconfig/rhn/systemid
is the server still in the old satellite?  delete system
with subscription manager
subscription-manager unregister
 
? is the server still in the old satellite?
Remove any rpms from old satellite client
yum remove `rpm -qa | egrep "osad|rhncfg|rhncfg-actions|rhncfg-client|rhn-org-trusted"`
Enable subscription manager
enable must be set to 1 in the following two files:
 /etc/yum/pluginconf.d/subscription-manager.conf
 /etc/yum/pluginconf.d/product-id.conf
 
Service rhsmcertd must be enabled and running
chkconfig rhsmcertd on
service rhsmcertd status
service rhsmcertd start
 
Add the host on the satellite web interface
# if this is not done before than things will fail  like running openscap..
{ Hosts } -> All Hosts [ New Host ]
 
Install the certificate from the new satellite
wget --no-check-certificate https://myserver.mydomain.com/pub/katello-ca-consumer-latest.noarch.rpm
rpm -Uvh katello-ca-consumer-latest.noarch.rpm
 
Subscribe to new satellite with subscription-manager
??vi /etc/sysconfig/rhn/up2date
??vim /etc/rhsm/rhsm.conf and fix the extra s in repo_ca_cert = %(ca_cert_dir)skatello-server-ca.pem
subscription-manager clean
subscription-manager register --org="MyOrg" --activationkey="Key-MyKey"
at this point the server will show on the satellite under { Hosts } -> Content Hosts
Other options
subscription-manager register --org="MyOrg" --activationkey="Key-MyKey" --auto-attach
subscription-manager register --serverurl=myserver.mydomain.com --baseurl= https://myserver.mydomain.com/pulp/repos --org="MyOrg" --activationkey="Key-MyKey"
 
Verify subscription
subscription-manager status 
# should return Overall Status: Current
subscription-manager list
# should return a list of product registered to
subscription-manager list --consumed | grep "Status Details"
   # this will tell us if virt-who as reported the system to satellite yet ( usually runs hourly ) 
   It should say "Subscription is current"
 
Verify repos
yum repolist 
# got error: rhn-plugin: ERROR: can not find RHNS CA file: /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
 vi /etc/sysconfig/rhn/up2date
 and change: 
     sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT to sslCACert=/usr/share/rhn/RHNS-CA-CERT
 and serverURL to 
     serverURL=https://myserver.mydomain.com/pulp/repos
? is the server showing up somewhere in the new satellite?
yum repolist , only rhel-6-server-rpms is enable
subscriptbion-manager repos # are available.
Verify that satellite-tools is enabled (should be provided with the key ): 
yum repolist enabled | grep -i satellite-tools
subscription-manager repos --enable rhel-6-server-satellite-tools-6.1-rpms
 
Intall the Katello Agent ( for errata management ) 
yum install katello-agent
 
Now the installable errata's should show under { Hosts } -> Content Hosts. 
At this point it will not be in { hosts } -> All Hosts , this comes when the puppet client is configured.
Install the puppet agent
yum install puppet
chkconfig puppet on
Configure the puppet agent
  vim /etc/puppet/puppet.conf
    In the agent section add the following lines:
      pluginsync = true
      report = true
      ignoreschedules = true
      daemon = false
      ca_server = myserver.mydomain.com
      server = myserver.mydomain.com
      environment = KT_MyCorp_Project_Dev_Base_for_RHEL_6_2   
      #runinterval =   # defaults to 30 min , whats the format?
      #note: the environments can be found on the satellite server under { Configure } -> Environments
      why is it RHEL_6_2? 
 
run a puppet agent test
puppet agent -t  
 
on the satelitte server 
{ Infrastructure } -> Capsules  click on Certificates 
locate our new server in the Certficate list and click on sign.
 
run a puppet agent test again
puppet agent -t 
...
expect warnings and errors
...
At this point the sever will  be under { Hosts } -> All Hosts  but the Context must be set to Any Organization and Any Location. 
It will not show  under the MyCorp @ MyLocation  ( Organization ) and ( Location ) context. 
Note: The context is the left most in the top menu of the satellite interface.
from here on the line with our new server click [ Edit ] and assign the proper
- Organization ( already selected and greyed out )
- Location ( already selected and greyed out )
- Lifecycle Environment
- Content View
- Puppet environment
- Content source.
note: Organization and location is already set so  why is it not under the respective context then? 
run a puppet agent test again on the new system
puppet agent -t  
Info: Retrieving plugin
Info: Caching catalog for myhost.mydomain.com
Info: Applying configuration version '1006165659'
Notice: Finished catalog run in 0.04 seconds
now the warnings and errors should be gone:
still only showing  under Any Organization @ Any Location context
Troubleshooting
Replace certs on an agent
stop the puppet agent service.
locate puppets ssl directory and delete everything in it.
  cd /var/lip/puppet/ssl
re-start the puppet agent service
 
Fix mapping between "foreman Host" and  "content hosts" 
loggon the satellite as root
Get the host id: hammer host list
Get the content host id (uuid): hammer content-host list --organization-id 1
# substitue the following command with the results from the previous 2 steps
# foreman-rake console 
irb(main):001:0> Katello::System.update_all 'host_id = ', "uuid=''"