For FreeBSD
-
pkg install -y puppet8 puppetserver8 rubygem-hiera rubygem-hiera-eyaml rubygem-hiera-file git rubygem-psych
-
puppetserver gem install hiera-eyaml eyaml
and/or:
gem install hiera
gem install hiera-eyaml
!notes! if you get an error `LoadError: no such file to load -- /usr/local/lib/ruby/gems/3.0/gems/psych-5.0.2/lib/psych_jars, please checkout work-around from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261141#c7:
cat > /usr/local/lib/ruby/gems/3.0/gems/psych-5.0.2/lib/psych_jars.rb <<EOF
require 'psych.jar'
require 'jar-dependencies'
require_jar('org.yaml', 'snakeyaml', Psych::DEFAULT_SNAKEYAML_VERSION)
EOF
-
restore 'puppet' owner for /var/puppet/server/data/puppetserver dir:
chown puppet /var/puppet/server/data/puppetserver
after previous step, because you will get an error when starting puppetserver (File[/var/puppet/server/data/puppetserver/locales]: change from 'absent' to 'directory' failed: Could not set 'directory' on ensure: Permission denied - /var/puppet/server/data/puppetserver/locales
) -
echo '127.0.0.1 puppet' >> /etc/hosts
-
mv /usr/local/etc/puppet /usr/local/etc/puppet-o
-
git clone https://github.com/olevole/puppet-empty.git /usr/local/etc/puppet
-
rm -rf /usr/local/etc/puppet/.git
-
chown -R puppet:puppet /var/puppet
-
service puppetserver enable
-
service puppetserver start
-
// wait for java/puppetservice process fully started ( ~10-15 sec: check when CPU consumption by process will be low )
-
check puppetserver/puppet agent:
puppet agent -t
-
drop 'code/modules' dir into /usr/local/etc/puppet/ e.g: https://forge.puppet.com/zleslie/pkgng
puppet module install zleslie-pkgng
ln -sf /usr/local/etc/puppet/modules /usr/local/etc/puppet/code/environments/modules
- Use /usr/local/etc/puppet/code/environments/production/data/nodes directory to assign role per host
- Use /usr/local/etc/puppet/code/environments/production/data/role directory to describe role