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

Fix for apt-transport-https #1014

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions manifests/package/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#
# This class file is not called directly
class nginx::package::debian (
$manage_repo = true,
$package_name = 'nginx',
$package_source = 'nginx',
$package_ensure = 'present',
$passenger_package_ensure = 'present'
) {
$manage_repo = true,
$package_name = 'nginx',
$package_source = 'nginx',
$package_ensure = 'present',
$passenger_package_ensure = 'present'
) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right -- it's fine to switch things to the new convention in how we're calling classes, but if I'm not mistaken, I think this is just hard-coding everything. So I think it either needs to be passed in from https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/package.pp or else using nginx::foo directly. https://github.com/voxpupuli/puppet-nginx/blob/master/manifests/config.pp I think kind of shows how I've been doing that in newer stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I misread this one, it's just indentation, so just fix that back to the original indentation and squash the commit.


$distro = downcase($::operatingsystem)

Expand All @@ -32,6 +32,10 @@
include '::apt'
Exec['apt_update'] -> Package['nginx']

ensure_packages([ 'apt-transport-https', 'ca-certificates' ])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe should only ensure it when manage_repo is true, since there's still the use-case where the user is managing repos separately or using the vendor package.

I've been meaning to rework package management in general, as described in #938 (or possibly a replacement for it) but not sure when I'll have the time. I got some helpful input from @hunner but somehow the notes didn't seem to make it into the PR comments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, you're right, I didn't catch that this was inside

  if $manage_repo {

already, so this should be fine... it just wasn't clear from context.
However, there still should probably be some tests in classes/nginx_spec.rb
in line 191, where there are tests for manage_repo=false, you can add a test for the absence of the package, e.g.,

        it { is_expected.not_to contain_package('apt-transport-https') }

and in the section starting at line 155, an equivalent test for its presence.


Package['apt-transport-https','ca-certificates'] -> Apt::Source['nginx']

case $package_source {
'nginx', 'nginx-stable': {
apt::source { 'nginx':
Expand All @@ -54,10 +58,6 @@
key => '16378A33A6EF16762922526E561F9B9CAC40B2F7',
}

ensure_packages([ 'apt-transport-https', 'ca-certificates' ])

Package['apt-transport-https','ca-certificates'] -> Apt::Source['nginx']

package { 'passenger':
ensure => $passenger_package_ensure,
require => Exec['apt_update'],
Expand Down