Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

How to use an array as argument to check for installed packages together with if defined function

$
0
0
Hi, is it possible to check if an array of packages is already installed before installing them or do I have to check them one by one like: if ( ! defined ( Package['packagename'] ) ) { package { 'packagename': ensure => present; } } I would like to do something like: $array_of_packages = ['packagename1','packagename2','packagename3'] if ( ! defined ( Package [ $array_of_packages ] ) ) { package { $array_of_packages: ensure => present } } If this is not supported is there a recommended way to check it (except one by one checking)? Thanks in advance

Viewing all articles
Browse latest Browse all 6104

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>