0

我正在使用 Puppet spantree/java8模块安装Java 8在 Vagrant机器上。安装时出现以下异常:hashicorp/precise32

==> default: Notice: /Stage[main]/Java8/File[/tmp/java.preseed]/ensure: defined content as '{md5}1b89c67b59fa03a9210a7b22a6b51b92'
==> default: Notice: /Stage[main]/Apache/Package[apache2]/ensure: ensure changed 'purged' to 'present'
==> default: Notice: /Stage[main]/Java8/Apt::Ppa[ppa:webupd8team/java]/Exec[add-apt-repository-ppa:webupd8team/java]/returns: executed successfully
==> default: Notice: /Stage[main]/Java8/File[/etc/profile.d/set_java_home.sh]: Dependency Package[oracle-java8-installer] has failures: true
==> default: Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install oracle-java8-installer' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: E: Unable to locate package oracle-java8-installer
==> default: Error: /Stage[main]/Java8/Package[oracle-java8-installer]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install oracle-java8-installer' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: E: Unable to locate package oracle-java8-installer
==> default: Warning: /Stage[main]/Java8/File[/etc/profile.d/set_java_home.sh]: Skipping because of failed dependencies

我预测第 1行有问题。-文件init.pp中的 48 :

  ubuntu: {
      include apt

      apt::ppa { 'ppa:webupd8team/java': }

      package { 'oracle-java8-installer':
        responsefile => '/tmp/java.preseed',
        require      => [
          Apt::Ppa['ppa:webupd8team/java'],
          File['/tmp/java.preseed']
        ],
      }

知道如何解决吗?

PS:我正在使用从Puppetlibrarian-puppet forge下载spantree/java8模块。

4

1 回答 1

1

通过确保在添加新 ppa 后运行,终于能够通过错误apt-get update- 这是我的更改java8/manifests/init.pp

ubuntu: {
  include apt

  apt::ppa { 'ppa:webupd8team/java': }

  exec { 'apt-update':
      command => "/usr/bin/apt-get update",
      require      => [
        Apt::Ppa['ppa:webupd8team/java']
      ],
  }

  package { 'oracle-java8-installer':
    responsefile => '/tmp/java.preseed',
    require      => [
      Exec['apt-update'],
      File['/tmp/java.preseed']
    ],
  }
}
于 2015-09-17T15:59:41.957 回答