Introduction As a professional services engineer specializing in Puppet, I have repeatedly seen workflows with inconsistent code that make reading, maintenance, and migrations difficult. The root of many problems is often the development environment or the absence of a standardized one. At Q2BSTUDIO, a custom software and application development company, we know that establishing good practices improves speed, reduces technical debt, and facilitates the onboarding of new collaborators.
Objective This article explains how to configure a productive Puppet development environment with Visual Studio Code, PDK, Git, and the Puppet extension for VS Code. The concepts and tools described are cross-platform and suitable for both small teams and organizations that require custom software solutions and AWS and Azure cloud services.
Requirements You will need to have Visual Studio Code and Git installed. Additionally, a basic understanding of Puppet modules, manifests, and Git repositories is recommended. All mentioned tools work on Windows, macOS, and Linux, including ARM architectures, which facilitates heterogeneous environments in custom software and application development projects.
Installing essential components First install Puppet Development Kit PDK before adding the Puppet extension in VS Code. PDK provides the managed Ruby environment, core Puppet libraries, testing tools, and command-line utilities used by the extension. After installing PDK, install the official Puppet extension from the VS Code marketplace. Open a manifest file with the pp extension and verify that the extension detects the Puppet version provided by PDK and that syntax highlighting, warnings, and linting appear.
Workspace configuration Many Puppet environments use multiple Git repos such as the control repo, custom module repos, and separate Hiera data. Clone the repos on your machine and create a VS Code workspace by adding each folder to the workspace and saving the workspace file. A multi-root workspace allows you to manage each repository separately in the source control panel and apply consistent settings across the entire project, avoiding Git confusion and facilitating per-repository commits.
Practical use of PDK PDK streamlines common tasks such as creating new modules, validating static code, running unit tests, and managing Ruby dependencies. In practice, PDK is used to validate syntax and style rules, run RSpec tests when they exist, and use pdk bundle to run tools like rubocop or rake. PDK standardizes the development environment for teams that develop custom software and artificial intelligence solutions integrated into infrastructure.
The Puppet extension in VS Code The extension adds language support for pp, epp, and YAML files, including highlighting, automatic formatting, autocompletion, hover information, inline linting, diagnostics, and navigation between definitions and references. It also offers integrated tasks to run pdk validate and pdk test from the command palette, improving productivity and helping to detect errors while writing code.
Git integration and workflow VS Code includes Git support that works very well with Puppet projects. It is advisable to make commits per repository from the source control panel, view diffs, and manage branches in the interface. Extensions like GitLens add history and annotations. Keep .gitignore and .editorconfig files in each repo to standardize formatting and avoid unwanted files in commits, which is key when delivering custom software projects to clients.
Best practices Enable autosave to avoid losing changes between test runs. Use workspace settings to enforce tab width, line endings, and removal of trailing spaces. Add an editorconfig file to repositories and recommend extensions such as YAML support, GitLens, and Markdown preview. If you are migrating from Vim, you can install the Vim extension to keep shortcuts. Take advantage of command palette shortcuts to run PDK tasks without switching to the terminal.
Troubleshooting If the Puppet version does not appear in the status bar, verify that PDK was installed before the extension. If syntax highlighting is missing, make sure you are editing a pp file within a workspace with PDK configured. When pdk validate reports missing gems, run pdk bundle install in the module directory. If the Puppet language server fails, try reloading the VS Code window or reinstalling the extension. For legacy modules, use pdk convert to migrate them to the PDK-managed structure.
Added value of Q2BSTUDIO At Q2BSTUDIO, we are specialists in custom software and application development, artificial intelligence, cybersecurity, AWS and Azure cloud services, business intelligence services, and implementation of Power BI solutions. We help integrate AI for businesses, design AI agents, and optimize deployment pipelines with infrastructure-as-code practices using tools like Puppet. Our approach combines technical expertise and consulting to deliver secure and scalable custom software.
Conclusion A correct configuration of VS Code, PDK, and the Puppet extension turns development into a faster, safer, and more collaborative activity. Investing time in the environment pays off in maintenance, quality, and delivery speed. If you need support implementing these practices or developing custom solutions with artificial intelligence and cybersecurity, contact Q2BSTUDIO to explore how we can help you take your projects to the next level.



