This will fail if group already exist. Should be:
getent group katello-shared >/dev/null || groupadd -r %{name}
You may want to allocate static id for katello-shared group (see bz 804204 how to do it), hmmm and why we could not use katello group in first place?