Ensure a lock isn't left behind

Currently we might set a lock and then exit if the circumstances aren't right.
This commit ensures the lock is only set if we pass all checks, and that we
don't potentially leave a lock file behind if we exit early.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Remove automatic repo creation after shipping to distribution server

We need to decouple this to that we can more safely queue repo creation rather
than risk collisions from multiple simultaneous builds.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Don't attempt to create rpm repo configs if there are none

We don't want to try to create rpm repo configs from a file that is
non-existent in the case that no rpms exist. This commit updates the task to
just exit if no rpm repos exist to create configs for. It also updates the task
to check for "repodata", which is a much better indicator of whether repos
exist than just "rpms".

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>