Giter VIP home page Giter VIP logo

hdm's Introduction

HDM

Prerequisites:

  1. you must have a hiera.yaml file in each Puppet environment
  2. you must set defaults like data_hash in hiera.yaml file
  3. you must have a single hierarchy entry and use paths parameter
  4. you must access PuppetDB via https
  5. Hiera Data must be in directory data within puppet environment

Development Setup

  1. Clone repo:
    cd
    git clone [email protected]:example42/hdm.git
    cd hdm/
  1. add required packages
    yum install -y gcc-c++ sqlite-devel zlib-devel
  1. sqlite database it's just a file, no need to configure any service

  2. install gems

    /opt/puppetlabs/puppet/bin/gem install bundler
    /opt/puppetlabs/puppet/bin/bundle install --path vendor
  1. 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
  1. yarn updates
    /opt/puppetlabs/puppet/bin/bundle exec yarn install --check-files
  1. generate db content
    mkdir puppet
    /opt/puppetlabs/puppet/bin/bundle exec rails db:migrate
  1. 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)
  1. access via ip and port 3000

consider opening port 3000 or disable the firewall.

Production Setup

Run the steps from 1 to 7, only how we run HDM will be different

Passenger

Debian

Install passenger as described in https://www.phusionpassenger.com/library/install/nginx/install/oss/stretch/

CentOS

Install passenger as described in https://www.phusionpassenger.com/library/install/nginx/install/oss/el7/

Nginx

Configure Nginx, you can use the example as base config.

Assets

Rails in production does not compile assets dynamically, needs to precompile all the assets with rails assets:precompile

hdm's People

Contributors

dependabot[bot] avatar gguillotte avatar oneiros avatar tuxmea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.