IntelliJ IDEA 2018.2 Help

Puppet

IntelliJ IDEA supports the Puppet language syntax and allows you to work with Puppet modules and environments. These capabilities are implemented by utilizing the Puppet Support plugin.

The main supported features are:

Prerequisites

The following gems are required to work with Puppet modules and environments:

Creating a Puppet Module

To create a new Puppet module

  1. Choose File | New Project… on the main menu.

  2. In the New Project dialog, choose Puppet Module on the left.

    puppet new project dialog plugin

  3. Then, select the required Ruby SDK. If the puppet gem is not installed in the selected SDK, IntelliJ IDEA will suggest you do this.

    puppet new project install gem plugin

  4. Finally, specify the Author username, Module name and click Next. On the next page, specify the project name, location and click Finish. The created project comprises the Puppet module structure.

    puppet new project structure plugin
    You can learn how to create Puppet modules from the corresponding documentation.

Opening Puppet Modules and Environments

IntelliJ IDEA automatically recognizes opened Puppet modules or environments (for instance, by availability of metadata.json or environment.conf files) and marks them with corresponding icons in the project tree.

puppet open module structure

After opening a module or environment, you can install its dependencies.

Installing Dependencies

IntelliJ IDEA allows you to install the module/environment dependencies specified in the following files:

  • If the module contains a .fixtures.yml file, IntelliJ IDEA will install dependencies using rake tasks into the spec/fixtures/modules directory. In this case, the IDE does not check next sources.

  • If there is a Puppetfile, IntelliJ IDEA installs dependencies using librarian-puppet into the .dependencies directory (or to modules for environments).

  • In case of a project contains metadata.json, IntelliJ IDEA installs dependencies using librarian-puppet in the same way as from the Puppetfile.

To install the module/environment dependencies, right-click the module in the Project tool window and select Install dependencies for module <name> or Install dependencies for environment <name>.

If the project’s SDK does not have the librarian-puppet gem installed, IntelliJ IDEA will suggest you do this.

puppet librarian warning

Configuring Puppet-related Settings

The Settings/Preferences dialog (Ctrl+Alt+S) allows you to configure the following settings related to Puppet:

  • The Language and Frameworks | Puppet page allows you to configure the Puppet language version and the path to librarian-puppet.

  • Editor | Code Style | Puppet contains code style settings for the Puppet language.

  • Editor | Inspections allows you to configure inspection settings.

  • On the Editor | Live templates page, you can create custom live templates for the Puppet language in the same way as for other languages.

    puppet live templates

Last modified: 20 November 2018

See Also