GithubHelp home page GithubHelp logo

foreman_hdm's Introduction

ForemanHdm

License Test Release RubyGem Version RubyGem Downloads

Browse hiera data for a given Host using HDM and the HDM smart proxy plugin.

Requirement

You must have a HDM installation running. If you are running with authentication enabled, you need an API user in HDM.

Installation

See How_to_Install_a_Plugin for how to install Foreman plugins

The most simple way is installing from packages (available with Foreman 3.6 and later)

RedHat: dnf install rubygem-foreman_hdm rubygem-smart_proxy_hdm

After installation you must initialize the database: foreman-rake db:migrate

The HDM Smart Proxy must be configured:

# /etc/foreman-proxy/settings.d/hdm.yml
# HDM Smart Proxy
:enabled: https
:hdm_url: 'http://<HDM IP>:<HDM Port>'
:hdm_user: '<HDM API User Email>'
:hdm_password: '<HDM API User Password>'

Next you must restart the smart-proxy: systemctl restart foreman-proxy

Usage

Go to Foreman and Refresh the Smart Proxy features.

Within the nodes or node groups you can now set the HDM Smart Proxy.

When you now select a node, you will see an HDM tab.

TODO

Todo list here

Contributing

Fork and send a Pull Request. Thanks!

Copyright

Copyright (c) 2023 betadots GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Release a new version

To make a new release, please do:

  • update the version in lib/foreman_hdm/version.rb
  • Install gems with bundle install --with release --path .vendor
  • generate the changelog with bundle exec rake changelog
  • Check if the new version matches the closed issues/PRs in the changelog
    • if required, add labels to unlabled PR/issues, regenerate the changelog
  • Create a PR with it
  • After it got merged, push a tag that's prefixed with v. GitHub Actions will do the actual release to Rubygems and GitHub Packages

The Foreman team packages this gem as Debian package (deb) and as RedHat package (rpm). They have a bot that will automatically propose an rpm/deb update at github.com/theforeman/foreman-packaging.

foreman_hdm's People

Contributors

bastelfreak avatar dependabot[bot] avatar oneiros avatar tuxmea avatar

Watchers

 avatar  avatar

Forkers

bastelfreak

foreman_hdm's Issues

Add button to show results

HDM itself can show the returned result.
Foreman HDM should also be able to show the result in a similar way.

Add description on how to use the plugin

Gem based installation:

  1. add gem to Gemfile.local.rb
# /usr/share/foreman/bundler.d/Gemfile.local.rb
gem 'foreman_hdm', '~> 0.1.4'
  1. run db migrate
foreman-rake db:migrate
  1. Restart foreman
systemctl restart foreman.service

Bump version to 1.x.y

Plugin is working as expected.
I would consider bumping major version from 0 to 1

Foreman unable to render site after hdm plugin installation

Adding foreman hdm plugin causes foreman to not be able to start properly.

Logfile shows error:

ActionView::Template::Error (Can't find entry point 'foreman_hdm:global' in webpack manifest):
 1307acc8 |     13:     <%= stylesheet_link_tag *webpack_asset_paths('foreman-vendor', :extension => 'css') %>
 1307acc8 |     14:     <%= stylesheet_link_tag *webpack_asset_paths('bundle', :extension => 'css') %>
 1307acc8 |     15:     <%= stylesheet_link_tag 'application' %>
 1307acc8 |     16:     <%= webpacked_plugins_with_global_css %>
 1307acc8 |     17:     <%= yield(:stylesheets) %>
 1307acc8 |     18:
 1307acc8 |     19:     <%= csrf_meta_tags %>
 1307acc8 |

Foreman HDM does not build on latest foreman version

Build log: https://download.copr.fedorainfracloud.org/results/@theforeman/plugins-nightly-staging-scratch-9f524913-0e80-5852-9375-9969205e107e/rhel-8-x86_64/06975676-rubygem-foreman_hdm/builder-live.log.gz

 WARN  app : You are trying to replace import_subnets from . Adding allowed actions from plugin permissions to the existing one.
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 2)
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/app/models/concerns/belongs_to_proxies.rb:17:in `register_smart_proxy'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/app/models/host.rb:43:in `method_missing'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/app/registries/foreman/plugin.rb:509:in `smart_proxy_for'
/builddir/build/BUILDROOT/rubygem-foreman_hdm-0.1.4-2.fm3_10.el8.x86_64/usr/share/gems/gems/foreman_hdm-0.1.4/lib/foreman_hdm/engine.rb:34:in `block (2 levels) in <class:Engine>'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/app/registries/foreman/plugin.rb:100:in `instance_eval'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/app/registries/foreman/plugin.rb:100:in `register'
/builddir/build/BUILDROOT/rubygem-foreman_hdm-0.1.4-2.fm3_10.el8.x86_64/usr/share/gems/gems/foreman_hdm-0.1.4/lib/foreman_hdm/engine.rb:20:in `block in <class:Engine>'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `instance_exec'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/initializable.rb:32:in `run'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `block in run'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/config/initializers/0_print_time_spent.rb:17:in `benchmark'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/config/initializers/0_print_time_spent.rb:45:in `run'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/initializable.rb:61:in `block in run_initializers'
/usr/share/ruby/tsort.rb:228:in `block in tsort_each'
/usr/share/ruby/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/usr/share/ruby/tsort.rb:431:in `each_strongly_connected_component_from'
/usr/share/ruby/tsort.rb:349:in `block in each_strongly_connected_component'
/usr/share/ruby/tsort.rb:347:in `each'
/usr/share/ruby/tsort.rb:347:in `call'
/usr/share/ruby/tsort.rb:347:in `each_strongly_connected_component'
/usr/share/ruby/tsort.rb:226:in `tsort_each'
/usr/share/ruby/tsort.rb:205:in `tsort_each'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/initializable.rb:60:in `run_initializers'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/application.rb:391:in `initialize!'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
/builddir/build/BUILD/foreman_hdm-0.1.4/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
/usr/share/gems/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
/usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/dependencies.rb:332:in `block in require'
/usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/dependencies.rb:332:in `require'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/application.rb:367:in `require_environment!'
/usr/share/gems/gems/railties-6.1.7.6/lib/rails/application.rb:533:in `block in run_tasks_blocks'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:243:in `block in invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:241:in `invoke_prerequisites'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:218:in `block in invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `synchronize'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/usr/share/gems/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/share/gems/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/usr/bin/rake:23:in `load'
/usr/bin/rake:23:in `<main>'
Tasks: TOP => plugin:assets:precompile => environment

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.