work in progress, refactoring for ansible 1.2