Forge Home

salt

Installs, configures, and manages the SaltStack ( salt-minion / salt-master / salt-api / salt-syndic / salt-pepper ).

8,240 downloads

644 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.1.4 (latest)
  • 2.1.3
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • 2.0.0
  • 1.1.0
  • 1.0.1
  • 1.0.0
released Feb 27th 2023
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 8.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'joelkle-salt', '2.1.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add joelkle-salt
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install joelkle-salt --version 2.1.4

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

joelkle/salt — version 2.1.4 Feb 27th 2023

PRs are welcome :)

Due to a new job I have only limited posibilities to test this module

Salt Puppet Module

Table of Contents

Module description

The salt module installs, configures, and maintains your SaltStack.

It follows the new Puppet 4 code style guides (no params.pp class -> data dir). Furthermore all parameters are fully configurable over Hiera.

This module is only compatible with Puppet 5.5.8+

Setup

What Salt affects

It can manage

  • salt-minion
  • salt-master
  • salt-api
  • salt-syndic
  • salt-pepper

It will manage

  • salt repo

Usage

For every part to install, minion, master, api, syndic and pepper there is a extra class you'll have to call.

Manage Salt minion / master / api / syndic

The classes for the minion, master, api and syndic are mostly the same.

The following example shows how to manage a Salt master. You can use the same examples to manage the minion, api or syndic. The minion, api and syndic have the same parameters.

Any other parameters are documented in the REFERENCE.md

Basic setup

Include the salt::master class:

include salt::master

Set some configuration parameters:

salt::master::configs:
  log_level: info
  fileserver_backend:
    - roots

You can copy the YAML structure from your existing config file and paste it here. It will paste the YAML as is into the config file.

Per default the deep merging for all hashes is enabled (including the configs hash).

You could also use the salt::master::config::create resource to append some config parameter:

salt::master::config::create { 'append logging config':
  data   => {
    'log_level' => 'info',
  },
}

Install specific Salt version

You can disable the management of the repo:

salt::master::repo_manage: false
Pin to Major release
salt::master::package_release: "major"
salt::master::package_release_version: "3002"
  • Installs the package repo for the release given with salt::master::package_release_version
Pin to Minor release
salt::master::package_release: "minor"
salt::master::package_release_version: "3002.1"
salt::master::package_ensure: "%{lookup('salt::master::package_release')}+ds-1"
  • Installs the package repo for the release given with salt::master::package_release_version
  • Installs the Salt master package in the version given with salt::master::package_ensure

Install additional packages needed for Salt

salt::master::additional_packages:
  - git
  - python3-pygit2

This is for example to use the gitfs backend in the Salt master config.

More information, what you can set in salt::master::additional_packages visit: https://forge.puppet.com/puppetlabs/stdlib/5.2.0/readme#ensure_packages

Manage Salt Pepper

Pepper contains a Python library and CLI scripts for accessing a remote salt-api instance. Official repo ist here

The Pepper Puppet module creates per default the file /etc/profile.d/saltstack-pepper.sh. In this file you can set variables that should be available as exported variables in your login shell. Per default it will set the PEPPERRC environment variable to set the path of the Pepper config file.

salt::pepper::environment_dir: /etc/profile.d
salt::pepper::environment_file: "%{lookup('salt::pepper::environment_dir')}/saltstack-pepper.sh"
salt::pepper::environments:
  - "export PEPPERRC='%{lookup('salt::pepper::config_file')}'"

If you don't want to create and set environment variables, set salt::pepper::environments to undef:

salt::pepper::environments: ~

Per default it will install the Pepper module from pip3 (this is the official recommendation):

salt::pepper::package_ensure: 'latest'
salt::pepper::package_provider: pip3

You can change the provider and the version if needed.

To configure pepper:

salt::pepper::configs:
  main:
    SALTAPI_URL: "https://salt.abc.com/"

The .pepperrc config file needs to be in the INI format.

Reference

See REFERENCE.md

Limitations

Currently this module only works for distros using apt as package manager.

If you want to use this module with any other package manager or any other distro, patch the repo.pp and open a pull request on GitHub.