Skip to content
Amy Buck edited this page Apr 24, 2018 · 24 revisions

Puppet

Puppet is a model-driven, open-source configuration management tool which helps in the concept of infrastructure as code. It is written in Ruby DSL which helps convert a complete infrastructure in code format that can be easily managed and configured.

Puppet follows a client-server architecture:

  • The client known as agents are the systems to be configured. Puppet agents communicate with the server and fetch configuration instructions, then apply the configuration on the system and send the status to the server.

  • The server known as master can be used a a standalone application. Puppet can manage any system from scratch, starting from the initial configuration to end-of-life of any particular machine.

NOTE: See Puppet 5.4 Reference Manual for the official documentation.

Dependencies

Setup uses Puppet 5.3.3 on the server, and Puppet 5.3.4 on the agent (OpenSwitch OPX). The sample manifests for the modules use the Puppet resource type reference.

Puppet server and agent setup

Puppet modules overview, setup, and execution

Modules are self-contained bundles of code and data with a specific directory structure. They are written and maintained in server. Modules must have a valid name and must be located in modulepath. An example path in a development environment is opt/puppetlabs/puppet/modules/<mod_name>.

NOTE: See Module fundamentals for more information.

The opx module is a high-level module that has an init.pp Puppet manifest file where you can include the necessary modules to be applied to the Puppet agent. Each feature-specific module contain manifests which is a <feature.pp> Puppet file that has the class definition — this name must match the module name.

Dependent configuration files are placed in the files directory. The code uses the file path structure (such as puppet://modules/lldp/lldpd.conf) which indicates the /opt/puppetlabs/puppet/modules/lldp/files/lldpd.conf path.

The site.pp file is in the manifest path of the Puppet server. An example path in a development environment is /etc/puppetlabs/code/environments/production/manifests which includes the OPX module that has specific features that need to be pushed to the list of agent nodes.

Start Puppet server

puppet master --verbose --no-daemonize

Run Puppet agents

puppet agent -t

Sample OPX Puppet modules

Clone this wiki locally