rewite and rework to support puppetserver
Merge branch 'hotfix/1.2.0'