implemented most of puppet-bootstrap.sh