PyCharm 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:
- Support for the Puppet language syntax, including Puppet 3, Puppet 4+, and the EPP template language.
- Syntax highlighting and formatting code according to the Puppet style guide.
- Code insight features such as completion, rename refactorings , navigation support, finding usages, etc.
The following gems are required to work with Puppet modules and environments:
Opening Puppet Modules and Environments
PyCharm automatically recognizes opened Puppet modules or environments (for instance, by availability of
environment.conf files) and marks them with corresponding icons in the project tree.
After opening a module or environment, you can install its dependencies.
PyCharm allows you to install the module/environment dependencies specified in the following files:
- If the module contains a
.fixtures.ymlfile, PyCharm 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, PyCharm installs dependencies using librarian-puppet into the .dependencies directory (or to modules for environments).
- In case of a project contains
metadata.json, PyCharm installs dependencies using librarian-puppet in the same way as from the
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>.
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.