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

Repo release and version logic broken? #187

Open
jacksgt opened this issue Dec 4, 2018 · 2 comments
Open

Repo release and version logic broken? #187

jacksgt opened this issue Dec 4, 2018 · 2 comments

Comments

@jacksgt
Copy link
Contributor

jacksgt commented Dec 4, 2018

Hello,

maybe I'm just not getting the logic of this module (if so please correct me!), but I think there is an error in the way this module handles the repository version (at least for Debian systems).

Starting in init.pp, I can specify two parameters concerning the package version number to be installed: release and version. (BTW: at the top of the file only one of them is documented)

class gluster (

But init.pp itself passes only version onto ::gluster::install:

class { '::gluster::install':
    server         => $server,
    server_package => $server_package,
    client         => $client,
    client_package => $client_package,
    version        => $version,
    repo           => $repo,
}

Because install.pp can only handle version, but not release.
This makes sense as ::gluster::install deals with installing the packages, but not setting up the repositories.

However, the availability of the release parameter in init.pp lead me to assume I can configure both the packages and the repository through the main package (because enabling or disabling the repository is also possible through init.pp), like so:

  class { '::gluster':
    server                 => true,
    client                 => true,
    repo                   => true,
    release                => '4.1',
    version                => '4.1',
  }

This will simply lead to the creation of the file /etc/apt/sources.list.d/glusterfs-4.1.list:

# This file is managed by Puppet. DO NOT EDIT.
# glusterfs-4.1
deb [arch=amd64] http://download.gluster.org/pub/gluster/glusterfs/3.12/LATEST/Debian/stretch/amd64/apt/ stretch main

Which is obviously not what I wanted (the URL points to gluster 3.12).

This happens because install.pp includes repo.pp (if that has not already been done), but only passes the version parameter onto repo.pp.

  if $repo {
    # install the correct repo
    if ! defined ( Class['::gluster::repo'] ) {
      class { '::gluster::repo':
        version => $version,
      }
    }
}

Since repo.pp does then not know about the release parameter I specified in init.pp, it simply uses the default from params.pp:

$release = '3.12'


Can someone please confirm or deny this observation?

I'd be happy to discuss and submit a PR.

@jacksgt
Copy link
Contributor Author

jacksgt commented Dec 4, 2018

Also I don't understand why gluster::repo only passes on version to Debian repositories, how are you supposed to select the release number then?

https://github.com/voxpupuli/puppet-gluster/blob/master/manifests/repo.pp

jacksgt added a commit to vision-it/vision-gluster that referenced this issue Dec 4, 2018
@deric
Copy link

deric commented Jun 21, 2019

Yes, it's weird 😕

For Debian repositories you need to explicitly set the release

gluster::repo::apt::release: '5'

as the variable gluster::repo::release is not passed to class gluster::repo::apt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants