refactoring steps in puppetmaster into tasks