使用puppet安装pgadmin4

问题描述 投票:0回答:2

我正在尝试使用puppet安装pgadmin4,

yum::install { 'pgadmin4':
    ensure => 'present',
    source => ['https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm',
               'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm'
              ]
  }

得到以下错误

parameter 'source' expects a String value, got Tuple 

我怎样才能通过多个来源?

我使用它作为指导在centos7 install pgAdmin4 with yum上安装pgadmin4

puppet pgadmin-4
2个回答
1
投票

我做了一些检查,并有充分的理由相信你正在使用puppet-yum模块。 yum :: install类定义为here

看起来您需要为要安装的每个包声明多个yum :: install资源。

像这样的东西可能会起作用:

$pkgs = {
  'epel-release' => 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm',
  'pgadmin4' => 'https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm',
}

$pkgs.each |$pkg, $source| {
  yum::install { $pkg:
    ensure => present,
    source => $source,
  }
}

0
投票

我认为你应该根据错误信息行事。参数'source'需要一个字符串值,并且您正在传递一个元组。所以,我建议你在source参数中传递一个字符串值。

yum::install { 'pgadmin4':
    ensure => 'present',
    source => 'https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm'
  }

并在下一个命令中传递下一个url。我不确定这会有效,但值得一试。谢谢!

© www.soinside.com 2019 - 2024. All rights reserved.