How to run puppet forge modules in linux ubuntu machine

276 Views Asked by At

I'm new to Puppet. I want to install any package or software on my new linux machine where Ubuntu installed. I have gone through puppet forge modules in their portal.

There are plenty of modules available but I'm not getting how to run them.

Looks like in all puppet forge modules, puppet language script used. I guess we need to install puppet first in linux machine.

I came to know that we have server and client puppet master and puppet agent. Do we need to install both on my linux machine to run puppet forge scripts?

How to install puppet on linux ubuntu machine and where to run puppet forge module scripts among master and agent?

Do we need 2 linux machines each for puppet server and client?

2

There are 2 best solutions below

2
On

Puppet is targeted at managing multi-computer installations. It can be used on an isolated machine (you would install both the master and the agent on that machine), but you are likely to make more work for yourself that way, not less, especially given that you have no prior experience with Puppet.

Looks like in all puppet forge modules, puppet language script used.I guess we need to install puppet first in linux machine.

Pedantically, the Puppet language is not a scripting language. But yes, Puppet modules are written primarily in Puppet's domain-specific language. You need Puppet to use them.

I came to know that we have server and client puppet master and puppet agent.Do we need to install both on my linux machine to run puppet forge scripts.

Unless you want to set up a second machine for the master to run on, yes, you would need to install both the master and the agent on your machine. Puppet used to support a direct-apply mode, but that is no longer an option.

How to install puppet on linux ubuntu machine and where to run puppet forge module scripts among master and agent.

Puppet has extensive online documentation. The section on installing Puppet is here: https://puppet.com/docs/puppet/latest/installing_and_upgrading.html.

Note also that installing the software is not all you would need to do. Puppet modules are not programs. They are somewhat like subroutines. You would also need at least to write some Puppet code of your own to specify just how (using the modules of your choice) you want Puppet to configure your machine.

Do we need 2 linux machines each for puppet server and client.

No. You can run the agent on the machine that hosts the master. Many sites do that, in fact, but it is rare for that to be the only place where the agent runs.

Generally speaking, you need to have several machines under Puppet management to achieve a net win relative to managing your machines directly. It really doesn't sound to me like Puppet would be a good fit for you.

0
On

For your use case, it seems like using Puppet Bolt is the better option.

As stated by John Bollinger, Puppet has very good online documentation on their products, and it's no different with Bolt:

Installing Bolt on Ubuntu

Once Bolt is installed, you can use its built-in package task to manage packages on your machine, e.g. Apache, by running:

bolt task run package action=install name=apache2

(you can find more examples here)

But if you intend to use Puppet Forge Apache module with Bolt, you can start by installing the module, but this is a more advanced use case, as you'd probably would have to write a plan or manifest to actually use the module's full potential, and you'd still have to deal with some limitations.

As you're new to Puppet and Bolt, I'd recommend you start simple and also take this hand-on lab provided by PuppetLabs.

I hope that gets you going!