Extract common tasks logic into Foreman tasks gem