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

Apt::pin, pin package version #596

Closed
vosdev opened this issue Apr 15, 2020 · 1 comment
Closed

Apt::pin, pin package version #596

vosdev opened this issue Apr 15, 2020 · 1 comment

Comments

@vosdev
Copy link

vosdev commented Apr 15, 2020

Use Case

manual apt upgrade installs latest version of docker packages, a puppet run will then overwrite this with the version configured in $docker::version. This makes for two docker daemon restarts and other possible issues. This issue was introduced with issue #424 (PR #425)

Describe the Solution You Would Like

Have the apt::pin in manifests/repos.pp also manage the version of the package if $docker::version is defined.

Describe Alternatives You've Considered

I am currently using a workaround to create a second apt::pin that does configure the version if $docker::version is defined.

Additional Context

My workaround:

apt::pin {
  'docker-ce':
    packages => 'docker-ce*',
    version  => $docker::version ? {
      $docker::version => $docker::version,
      default => '',
    },
}

I have tried patching my workaround in manifests/repos.pp like such:

  apt::pin { 'docker':
    ensure   => $pin_ensure,
    origin   => $repo_host,
    priority => $docker::apt_source_pin_level,
+   packages => 'docker-ce*',
+   version  => $docker::version ? {
+     $docker::version => $docker::version,
+     default          => '',
+   },
  }

but unfortunately that throws me a Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation E rror: Error while evaluating a Function Call, parameters release, origin, and version are mutually exclusive

Solution could be to create a pin for the origin and a pin for the version. (Though you might want to add a $docker::apt_package_pin_level or rename the var to $docker::apt_pin_level)

apt::pin { 'docker-origin':
  ensure   => $pin_ensure,
  origin   => $repo_host,
  priority => $docker::apt_source_pin_level,
}
apt::pin { 'docker-ce':
  ensure   => $pin_ensure,
  priority => $docker::apt_source_pin_level,
  packages => 'docker-ce*',
  version  => $docker::version ? {
    $docker::version => $docker::version,
    default          => '',
  },
}
@github-actions
Copy link

This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.

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

No branches or pull requests

2 participants