Hi Denis
I don't know what kind of template you are using for this here is mine
<% if @host.params['kt_activation_keys'] %>
add subscription manager
rm -rf /etc/yum.repos.d/*
rpm -ivh <%= subscription_manager_configuration_url(@host) %>
echo "Registering the System"
subscription-manager register --org="<%= @host.rhsm_organization_label %>"
–name="<%= @host.name %>" --activationkey="<%=
@host.params['kt_activation_keys'] %>"
echo "Installing Katello Agent"
yum -t -y -e 0 install katello-agent
chkconfig goferd on
<% end %>
also i download the latest subscription manager packages from this repo
http://repos.fedorapeople.org/repos/candlepin/subscription-manager/epel-subscription-manager.repo
Next step
i added the subscription manager packages into the Centos Repo on katello and change the kickstart in the packages section to include the subscription manager
%packages --ignoremissing
yum
dhclient
ntp
wget
subscription-manager
@Core
<%= section_end -%>
this is my complete kickstart for centos
<%#
kind: provision
name: Verifone Kickstart Default
oses:
- CentOS 5
- CentOS 6
- CentOS 7
- RedHat 5
- RedHat 6
- RedHat 7
- Fedora 19
- Fedora 20
%>
<%
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
os_major = @host.operatingsystem.major.to_i
safemode renderer does not support unary negation
pm_set = @host.puppetmaster.empty? ? false : true
puppet_enabled = pm_set || @host.params['force-puppet']
salt_enabled = @host.params['salt_master'] ? true : false
section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'
%>
install
<%= @mediapath %>
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx
<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>
network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select(&:present?).join(',')}" %> --hostname <%= @host %><%= os_major >= 6 ? " --device=#{@host.mac}" : '' -%>
rootpw --iscrypted <%= root_pass %>
firewall --<%= os_major >= 6 ? 'service=' : '' %>ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone --utc <%= @host.params['time-zone'] || 'UTC' %>
<% if @host.operatingsystem.name == 'Fedora' and os_major <= 16 -%>
Bootloader exception for Fedora 16:
bootloader --append="nofb quiet splash=quiet <%=ks_console%>" <%= grub_pass %>
part biosboot --fstype=biosboot --size=1
<% else -%>
bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %>
<% end -%>
<% if os_major == 5 -%>
key --skip
<% end -%>
<% if @dynamic -%>
%include /tmp/diskpart.cfg
<% else -%>
<%= @host.diskLayout %>
<% end -%>
text
reboot
%packages --ignoremissing
yum
dhclient
ntp
wget
subscription-manager
@Core
<%= section_end -%>
<% if @dynamic -%>
%pre
<%= @host.diskLayout %>
<%= section_end -%>
<% end -%>
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on…
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
<%= section_end -%>
%post
logger "Starting anaconda <%= @host %> postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on…
/usr/bin/chvt 3
(
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<%= snippet 'kickstart_networking_setup' %>
<% end -%>
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '172.25.176.37' %>
/usr/sbin/hwclock --systohc
<%= snippet "registration" %>
#Push sshkeys for foreman-proxy
<% if @host.respond_to?(:realm) && @host.otp && @host.realm && @host.realm.realm_type == "FreeIPA" -%>
<%= snippet "freeipa_register" %>
<% end -%>
update all the base packages from the updates repository
yum -t -y -e 0 update
<% if salt_enabled %>
yum -t -y -e 0 install salt-minion
cat > /etc/salt/minion << EOF
<%= snippet 'saltstack_minion' %>
EOF
Setup salt-minion to run on system reboot
/sbin/chkconfig --level 345 salt-minion on
Running salt-call to trigger key signing
salt-call --no-color --grains >/dev/null
<% end -%>
<% if puppet_enabled %>
and add the puppet package
yum -t -y -e 0 install puppet
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
<%= snippet 'puppet.conf' %>
EOF
Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag <%= @host.puppetmaster.blank? ? '' : "–server #{@host.puppetmaster}" %> --no-daemonize
<% end -%>
#provisioning SSH Remote Execution
<%= snippet "remote_execution_ssh_keys" %>
#Provisioning Security Agents
<%= snippet "netjoin" %>
<%= snippet "hs" %>
sync
<% if @provisioning_type == nil || @provisioning_type == 'host' -%>
Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
<% end -%>
) 2>&1 | tee /root/install.post.log
exit 0
<%= section_end -%>
Here the snippet used
##registration snippet##
<% if @host.params['kt_activation_keys'] %>
add subscription manager
rm -rf /etc/yum.repos.d/*
rpm -ivh <%= subscription_manager_configuration_url(@host) %>
echo "Registering the System"
subscription-manager register --org="<%= @host.rhsm_organization_label %>" --name="<%= @host.name %>" --activationkey="<%= @host.params['kt_activation_keys'] %>"
echo "Installing Katello Agent"
yum -t -y -e 0 install katello-agent
chkconfig goferd on
<% end %>
###puppet.conf##
<%#
kind: snippet
name: puppet.conf
%>
[main]
<% if @host.operatingsystem.name == 'FreeBSD' -%>
vardir = /var/puppet
logdir = $vardir/log
<% else -%>
vardir = /var/lib/puppet
logdir = /var/log/puppet
<% end -%>
rundir = /var/run/puppet
ssldir = $vardir/ssl
[agent]
pluginsync = true
report = true
ignoreschedules = true
daemon = false
<%- if @host.puppet_ca_server.strip -%>
ca_server = <%= @host.puppet_ca_server %>
<%- end -%>
certname = <%= @host.certname %>
environment = <%= @host.environment %>
server = <%= @host.puppetmaster %>
And you need to create a hostgroup or when you create you host with centos use activation key as you can see in my kickstart the registration is only trigger if you have activation key if no is going to try to subscribe via rehdhat possible this is the issue you are presenting right now just make sure to have an activation key to trigger the installation of the consumer