Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new 1.7.x dependencies for director module: ipl / reactbundle / incubator #247

Closed
linuxmail opened this issue Oct 7, 2019 · 4 comments

Comments

@linuxmail
Copy link

@linuxmail linuxmail commented Oct 7, 2019

Hi,

Expected Behavior

Puppet module should automatically install the required modules, if the director module is used. It should also install the latest stable version for them, because the master branch won't work.

Current Behavior

Director module isn't working, because of the missing modules

Possible Solution

@dnsmichi has some lines for Puppet to get the required modules for new Director version. I did the same for me. The question is, what the best way to include the dependencies. Either as seperate manifest, or inside the director ones.
I created for all three a own file:

  • ipl.pp
# == Class: icingaweb2::module::ipl
#
# Install and enable the ipl module.
#
# === Parameters
#
# [*ensure*]
#   Enable or disable module. Defaults to `present`
#
# [*git_repository*]
#   Set a git repository URL. Defaults to github.
#
# [*git_revision*]
#   Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`.
#
class icingaweb2::module::ipl(
  Enum['absent', 'present'] $ensure         = 'present',
  String                    $git_repository = 'https://github.com/Icinga/icingaweb2-module-ipl.git',
  String                    $git_revision   = undef,
){
  icingaweb2::module {'ipl':
    ensure         => $ensure,
    git_repository => $git_repository,
    git_revision   => $git_revision,
  }
}
  • incubator.pp
# == Class: icingaweb2::module::incubator
#
# Install and enable the incubator module.
#
# === Parameters
#
# [*ensure*]
#   Enable or disable module. Defaults to `present`
#
# [*git_repository*]
#   Set a git repository URL. Defaults to github.
#
# [*git_revision*]
#   Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`.
#
class icingaweb2::module::incubator(
  Enum['absent', 'present'] $ensure         = 'present',
  String                    $git_repository = 'https://github.com/Icinga/icingaweb2-module-incubator.git',
  String                    $git_revision   = undef,
){
  icingaweb2::module {'incubator':
    ensure         => $ensure,
    git_repository => $git_repository,
    git_revision   => $git_revision,
  }
}
  • reactbundle.pp
# == Class: icingaweb2::module::reactbundle
#
# Install and enable the reactbundle module.
#
# === Parameters
#
# [*ensure*]
#   Enable or disable module. Defaults to `present`
#
# [*git_repository*]
#   Set a git repository URL. Defaults to github.
#
# [*git_revision*]
#   Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`.
#
class icingaweb2::module::reactbundle(
  Enum['absent', 'present'] $ensure         = 'present',
  String                    $git_repository = 'https://github.com/Icinga/icingaweb2-module-reactbundle.git',
  String                    $git_revision   = undef,
){
  icingaweb2::module {'reactbundle':
    ensure         => $ensure,
    git_repository => $git_repository,
    git_revision   => $git_revision,
  }
}

Its a copy from the cube.pp :-) but I removed the git_revision optional param, because we should not use the master branch.

After then, I add includes to the director.pp

...
  include icingaweb2::module::reactbundle
  include icingaweb2::module::ipl
  include icingaweb2::module::incubator

And choose the version with Hiera like this:

icingaweb2::module::incubator::git_revision: 'v0.5.0'
icingaweb2::module::ipl::git_revision: 'v0.3.0'
icingaweb2::module::reactbundle::git_revision: 'v0.7.0'

May a tag like "stable" or "latest" which is the latest stable one should help to ommit the version.

Steps to Reproduce (for bugs)

Install director module via Puppet and navigate to the Director in Icingaweb2

Your Environment

  • Puppet mdoule list
pro:module denny$ puppet module list --modulepath ~/git/puppet-pug/environments/production
/Users/denny/git/puppet-pug/environments/production/modules
├── alexharvey-firewall_multi (v1.14.0)
├── camptocamp-augeas (v1.8.0)
├── icinga-icinga2 (v2.3.0)
├── icinga-icingaweb2 (v2.3.1)
├── puppetlabs-apache (v5.1.0)
├── puppetlabs-apt (v7.1.0)
├── puppetlabs-concat (v6.1.0)
├── puppetlabs-firewall (v2.0.0)
├── puppetlabs-ntp (v8.0.0)
├── puppetlabs-stdlib (v6.0.0)
├── puppetlabs-translate (v2.0.0)
├── puppetlabs-vcsrepo (v3.0.0)
├── saz-ssh (v6.0.0)
└── saz-sudo (v6.0.0)
  • Puppet Version 6.10.0
  • Debian Buster
@lbetz

This comment has been minimized.

Copy link
Member

@lbetz lbetz commented Oct 9, 2019

Why we didn't get a pull request?

@lbetz

This comment has been minimized.

Copy link
Member

@lbetz lbetz commented Oct 9, 2019

Version you've to handle by yourself. That problem will be solved when we can use packages.

lbetz added a commit that referenced this issue Oct 9, 2019
@lbetz lbetz closed this Oct 9, 2019
@linuxmail

This comment has been minimized.

Copy link
Author

@linuxmail linuxmail commented Oct 11, 2019

Why we didn't get a pull request?

I had already in mind to create a pull request :-) but wasn't sure, if it is the best solution to have individual Puppet Modules for fixed requirement. So my second thought would be, to have it in the main Dircector manifest. In that case, I would borrow the lines from @dnsmichi . Next time I will create the patch request :-)

@dnsmichi

This comment has been minimized.

Copy link
Member

@dnsmichi dnsmichi commented Oct 11, 2019

Agreed, with all the modules we should define a strategy where to put all of them. ipl, reactbundle and others are also required for the reporting module and future Icinga Web modules will also depend on them. Imho the best idea would be to show a ready-to-use profile with the base dependency modules all included. I'm just playing around in the Vagrant Puppet code, it is far from perfect but allows testing things quickly with the speedy development of modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.