Skip to content
Advertisement

Puppet-Apt fails to install package because of verification

Environment:

Running CentOs 7.2 Server in a virtual machine, which has a local proxy set up with CNTLM. I have installed vagrant version 1.8.1. In addition i installed the vagrant-proxyconf plugin.

Goal:

Set up a virtual machine on the CentOs 7.2 Server with vagrant.

Yes: A virtual machine in a virtual machine.

Status quo:

A snippet of the Vagrantfile:

...
config.proxy.http = http://10.0.2.2:3128
config.proxy.https = http://10.0.2.2:3128
config.proxy.no_proxy = localhost, 127.0.0.*, 10.0.2.*
...

# puppet config
config.vm.provision :puppet, :module_path => "../puppet/modules" do |puppet|
  puppet.manifests_path = "../puppet/manifests"
  puppet.manifest_file  = "base.pp"
  # In facts are the proxy settings with host and port. 
  puppet.facter = facts
end

A snippet of my puppet manifest:

class box-configuration {
  ...
  class { 'apt':
   always_apt_update => true;
  } 

  # Always a apt-key update before installing packages 
  exec { 'apt-key_update':
   command => "/usr/bin/apt-key update && /usr/bin/apt-get update",
   require => Class['apt'],
  }
  apt::ppa { 'ppa:openjdk-r/ppa': }

  package { ["unzip", "curl", "openjdk-8-jdk"]:
    ensure => present,
    require => [Class['apt'], Exec['apt-key_update']],
  }
...
}

Problem:

When i’m running vagrant up in the terminal, i get the following error for the package openjdk-8-jdk: enter image description here

All other packages could be installed successfully.

After the failure, i connected to the virtual machine with vagrant ssh to install this package manually with sudo apt-get install openjdk-8-jdk and then i got the following prompt:

 Install these packages without verification [y/N]? 

apt-get install openjdk-8-jdk wants a verification for downloading the package from the recently added repository in base.pp.

What should i do for this? I already add the Exec['apt-key_update'] requirement…

EDIT: When i connect to the virtual machine with vagrant ssh to make manually the update apt-key update && apt-get update i get the following output:

apt-key update apt-get update

Advertisement

Answer

The problem here was CNTLM with the version 0.92.3.. They have some problems in this version with the proxy tunneling. They recommend to install the 0.93beta5 version, and this solved my problem… But you can’t get the beta version from SourceForge.. I download the beta version from this repository.

Otherwise check the answer of @Frédéric Henri, this could solve your problem, when everything with CNTLM is ok.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement