Can I install puppet modules through puppet manifest?

后端 未结 5 1537
迷失自我
迷失自我 2021-02-13 03:34

Primary goal is to add all puppet modules automatically, so that all dev-env\'s and prod-env could be started with one command. How can I install puppet modules through puppet m

5条回答
  •  我寻月下人不归
    2021-02-13 03:54

    Here is an example of mine:

      $module_stdlib = 'puppetlabs-stdlib'
      exec { 'puppet_module_stdlib':
        command => "puppet module install ${module_stdlib}",
        unless  => "puppet module list | grep ${module_stdlib}",
        path    => ['/bin', '/opt/puppetlabs/bin']
      }
    

    Where $module_stdlib is a module I whant to install. The /bin path is a path where the grep comes from. And the /opt/puppetlabs/bin is a path where for the puppet binary exists in my installation.

提交回复
热议问题