0

In the puppet script I inherited there is a class pyenv for pyenv installation

class pyenv(
include ::pyenv
$ensure_repo           = 'present',
$repo_location         = '/usr/local/pyenv',
$repo_revision         = 'v0.4.0-20140404',
$symlink_pyenv         = true,
$symlink_path          = '/usr/local/bin',
$manage_packages       = true,
$ensure_packages       = 'latest',
$python_build_packages = $::pyenv::params::python_build_packages,
)

It does not work well. So, I changed installation to the regular script pyenv installation and would like to exclude calling this class in the following class python.

First, I excluded it by simply commenting out:

class python {
#    class { '::pyenv': } ->
#    pyenv_python { '2.7.9': }

#   exec { 'set-python-global':
#       command => '/usr/local/bin/pyenv global 2.7.9',
#       user    => root,
#       require => Class['::pyenv'],
#   } ->

exec { 'install-boto':
    command => '/root/.pyenv/shims/pip install boto',
    user    => 'root',
    unless  => '/root/.pyenv/shims/pip freeze | grep boto',
} -> 

Is there more intelligent way of excluding? I am thinking that if pyenv is already installed and setting global pyenv version is successful do not call class pyenv? Please, note that pyenv is not now in the /usr/local/bin although I can create a symbolic link.

Alex
  • 7,007
  • 18
  • 69
  • 114
  • Note well that Puppet classes are never installed. They are not install*able*. Their effects may be applied to a node, but afterward that's indistinguishable from the same effects being produced on that node in some other way. – John Bollinger Oct 09 '18 at 00:07
  • 2
    As for a "more intelligent way of excluding", I think you need to couch the question differently. Commenting out or outright deleting the class declaration, as you have done, is the simplest and most universal method for ensuring that the class is not applied. That's what "excluding" means to me. If you want more conditional or more nuanced behavior then you'll need to be clearer about just what you want to achieve. – John Bollinger Oct 09 '18 at 00:11

0 Answers0