- you must have a hiera.yaml file in each Puppet environment
- you must set defaults like data_hash in hiera.yaml file
- you must have a single hierarchy entry and use paths parameter
- you must access PuppetDB via https
- Hiera Data must be in directory data within puppet environment
- Clone repo:
cd
git clone git@gitlab.com:example42/hdm.git
cd hdm/
- add required packages
yum install -y gcc-c++ sqlite-devel zlib-devel
-
sqlite database it's just a file, no need to configure any service
-
install gems
/opt/puppetlabs/puppet/bin/gem install bundler
/opt/puppetlabs/puppet/bin/bundle install --path vendor
- install nodejs and yarn
curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash
sudo yum install -y nodejs
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
sudo yum install -y yarn
- yarn updates
/opt/puppetlabs/puppet/bin/bundle exec yarn install --check-files
- generate db content
mkdir puppet
/opt/puppetlabs/puppet/bin/bundle exec rails db:migrate
- run hdm:
export HDM__CONFIG_DIR="/etc/puppetlabs/code"
export HDM__PUPPET_DB__ENABLED=true
# If you are using a self signed certificate, you need to set:
export HDM__PUPPET_DB__SELF_SIGNED_CERT=true
export HDM__PUPPET_DB__SERVER="https://localhost:8081"
export WEBPACKER_DEV_SERVER_HOST=0.0.0.0
export RAILS_ENV=development
/opt/puppetlabs/puppet/bin/bundle exec ./bin/webpack-dev-server &
/opt/puppetlabs/puppet/bin/bundle exec rails s -b 0.0.0.0 &
When using Puppet Enterprise you must create a token:
puppet-access login -l 2y
and add the following environment variable:
export HDM__PUPPET_DB__TOKEN=$(cat ~/.puppetlabs/token)
- access via ip and port 3000
consider opening port 3000 or disable the firewall.
Run the steps from 1 to 7, only how we run HDM will be different
Install passenger as described in https://www.phusionpassenger.com/library/install/nginx/install/oss/stretch/
Install passenger as described in https://www.phusionpassenger.com/library/install/nginx/install/oss/el7/
Configure Nginx, you can use the example as base config.
Rails in production does not compile assets dynamically, needs to precompile all the assets with rails assets:precompile