我正在尝试使用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的指导
发布于 2018-09-07 08:06:39
我做了一些检查,有充分的理由相信您正在使用puppet-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,
}
}发布于 2018-09-07 06:59:36
我认为您应该根据错误消息执行操作。参数'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'
}并在next命令中传递下一个url。我不确定这是否会奏效,但值得一试。谢谢!
https://stackoverflow.com/questions/52213007
复制相似问题