RedHatSatellite / satellite-clone

Utility to assist cloning an existing Satellite 6 server to a new host
GNU General Public License v3.0
37 stars 31 forks source link

BZ#2102825 - detect when /var/lib/pulp is owned by an unknown user #424

Closed evgeni closed 2 years ago

evgeni commented 2 years ago

Sometimes, if you rsync /var/lib/pulp from a different machine, it ends up being owned by a UID/GID that has no mapping on the new system.

Ansible's stat module then doesn't populate the pw_name and gr_name attributes, leading to errors like this:

error while evaluating conditional (pulp_stat.stat.pw_name != 'pulp' or pulp_stat.stat.gr_name != 'pulp'): 'dict object' has no attribute 'pw_name'

Catch those cases and still properly fix the permissions.