简体   繁体   中英

puppet cli and list of variables

First time asking long time reading:)

I am trying to write a puppet module with a list of packages to install using a shell command (Cannot use the package module as the packages are installed using conda.

  class deep_learning {
  $deep_learning_package_list = [ 'numpy' , 'pandas' ]

  $deep_learning_package_list.each |$deep_learning_package| {
    command  => '/opt/mambaforge/bin/conda install $deep_learning_package',
    provider => shell,
    }
  } 
}

What am I doing wrong? Thank you friends

I resolved this using one variable and command

  class deep_learning {
  $deep_learning_package_list = "numpy pandas"

  exec { "/opt/mambaforge/bin/conda install -y ${deep_learning_package_list}":
  }
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM