0
votes

I am trying to install pgadmin4 using puppet,

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'
              ]
  }

getting following error

parameter 'source' expects a String value, got Tuple 

How can I pass multiple source?

I am using this as guidance to install pgadmin4 on centos7 install pgAdmin4 with yum

2
We would need to firstly know what the yum::install class is to know what's possible. - Alex Harvey
Yes, I deduced that. My answer below hopefully answers your question. - Alex Harvey

2 Answers

1
votes

I did a bit of checking and have good reason to believe you are using the puppet-yum module. The yum::install class is defined here.

It looks like you would need to declare multiple yum::install resources for each package you want installed.

Something like this might work:

$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
votes

I think you should act according to the error message. The parameter 'source' is expecting a single string value and you are passing a tuple. So, I suggest you pass a single string value in the source parameter.

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'
  }

and pass the next url in next command. I am not sure this will work, but it is worth a try. thank you!