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

Split package installation in multiple classes #670

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

smortex
Copy link
Member

@smortex smortex commented Sep 15, 2023

Install python packages from dedicated classes of the module.

This allow to use a single python profile in a control-repo that does not enforce installation / removal of these packages and still allow modules to require them.

# module foo
class foo {
  include python
  include python::install::dev

  # ...
}

# module bar
class bar {
  include python
  include python::install::venv

  # ...
}

# control repo
class profile::python {
  class { 'python':
    dev                 => 'present',
    pip                 => 'present',
    venv                => 'present',
    manage_dev_package  => false,
    manage_pip_package  => false,
    manage_venv_package => false,

    # ... site specific config
  }
}

class profile::foo {
  include profile::python

  class { 'foo':
  }
}

class profile::bar {
  include profile::python

  class { 'bar':
  }
}

If a node is classified profile::foo, the python-dev package will be installed. If a node is classified profile::bar, the python-venv package will be installed. Other python-* packages are not managed.

This is part 2/3 of #668 and does not introduce functional change. However it permits new usages and therefore is labelled enhancement.

Part 3/3 will be backwards-incompatible in order to change the defaults of the python class to match those in the above example.


Also include:

@kenyon kenyon added the enhancement New feature or request label Sep 15, 2023
@smortex smortex marked this pull request as ready for review September 15, 2023 22:14
@smortex smortex marked this pull request as draft October 9, 2023 02:53
@smortex smortex force-pushed the split-packages branch 2 times, most recently from 451d089 to 3fa9f1e Compare October 9, 2023 03:37
manifests/install.pp Outdated Show resolved Hide resolved
@smortex smortex force-pushed the split-packages branch 10 times, most recently from 66c1b78 to 52c3355 Compare December 15, 2023 00:16
@smortex smortex marked this pull request as ready for review December 15, 2023 00:22
@smortex smortex marked this pull request as draft December 15, 2023 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants