Can I install puppet modules through puppet manifest?

后端 未结 5 1518
迷失自我
迷失自我 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:39

    The "Puppet module" type and provider does exactly that:

    module { 'author/mymodule':
      ensure   => present,
    }
    module { 'puppetlabs/stdlib':
      ensure => '2.6.0',
    }
    module { 'puppetlabs/stdlib':
      ensure     => present,
      modulepath => '/etc/puppet/modules',
    }
    

    Recent versions of Puppet also have a puppet module command that allows you to install arbitrary Puppet modules from the Puppet forge, example:

    $ puppet module install rcoleman/puppet_module
    Notice: Preparing to install into /home/anarcat/.puppet/modules ...
    Notice: Created target directory /home/anarcat/.puppet/modules
    Notice: Downloading from https://forgeapi.puppetlabs.com ...
    Notice: Installing -- do not interrupt ...
    /home/anarcat/.puppet/modules
    └── rcoleman-puppet_module (v0.0.3)
    

    Other alternatives include:

    • librarian
    • r10k (cited as a replacement for librarian), supports dynamic environments and much more

    r10k is now part of Puppet Entreprise 2015.03, so it can certainly be considered best practice.

提交回复
热议问题