#!/bin/sh
apt-get update && apt-get install puppet-agent -y
cat > /etc/puppet/puppet.conf <<-EOF
[main]

[agent]
pluginsync      = true
report          = true
ignoreschedules = true
ca_server       = puppetserver-service.default.svc.k8s.digiworks.se
environment     = production
server          = puppetserver-service.default.svc.k8s.digiworks.se
EOF
puppet agent -t --waitforcert 5
