Forge Home

mspackages

A Puppet Module that makes it easy to include Microsoft packages for Linux operating systems.

4,641 downloads

1,283 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

  • 1.0.0 (latest)
  • 0.1.1
  • 0.1.0
released Jul 27th 2021
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 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
  • , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'aitalian-mspackages', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add aitalian-mspackages
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install aitalian-mspackages --version 1.0.0

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

aitalian/mspackages — version 1.0.0 Jul 27th 2021

mspackages

A Puppet Module that makes it easy to include Microsoft packages for Linux operating systems.

Available on PuppetForge.

Table of Contents

  1. Description
  2. Requirements
  3. Usage
  4. Development

Description

This module adds the Linux Software Repository for Microsoft Products based on distribution, and then installs the given package(s) with the environment variable ACCEPT_EULA=Y set.

Installing Microsoft packages introduces an interactive EULA acceptance prompt; since Puppet runs are non-interactive, an environment variable can be set to implicitly accept the EULA and bypass the prompt. This is possible by using a new resource type introduced with this module: mspackages. Traditional usage of Puppet's package resource type does not support passing environment variables (for reference, see PUP-1526 where this request is outstanding).

This module was developed specifically to install the Microsoft ODBC Driver for SQL Server on Linux, which prompts to accept the EULA, however, any package available for the target distribution is supported.

Disclaimer: You are responsible for reviewing the EULA applicable to the software you are agreeing to install.

Requirements

  • Puppet >= 4.1.0 or Puppet Enterprise >= 2016.4.x
  • puppetlabs/stdlib (>= 4.13.0)
  • puppetlabs/apt >= 2.3.0 for Debian-based distributions
  • puppetlabs/yumrepo_core >= 1.0.0 for RedHat-based distributions
  • Linux OS: RedHat, CentOS, Debian, Ubuntu

For complete up-to-date requirements, see metadata.json.

Usage

To begin, you first need to include the module in your Puppetfile and run Bolt, r10k or Code Manager, or, install it manually using the Puppet module tool.

Once installed, you can include packages either by defining resources within a manifest or hiera configuration file, and then apply it.

  1. manifest.pp example:
# Add the required Microsoft Packages Repo and
# Install the Linux Microsoft ODBC Driver for MS SQL Server.
mspackages { 'msodbcsql17':
  ensure => present,
}

or to remove packages:

mspackages { 'msodbcsql17':
  ensure => absent,
}

On a standalone Debian-based system, you can apply this using a local manifest and Puppet Bolt:

$ cat > Puppetfile << EOF
mod 'puppetlabs/stdlib'
mod 'puppetlabs/apt'
mod 'aitalian/mspackages'
EOF

$ cat > manifest.pp << EOF
mspackages { 'msodbcsql17':
  ensure => present,
}
EOF

$ bolt puppetfile install --puppetfile ./Puppetfile

$ puppet apply --modulepath=~/.puppetlabs/bolt/modules manifest.pp
  1. hieradata.yaml example: For node-specific configurations, ensure your manifest.pp includes hiera_include('classes'). You can then update your node configuration as follows:
classes:
  - 'mspackages::install'

mspackages::install::packages:
  - 'msodbcsql17'
  - 'mssql-tools'

or to remove packages:

mspackages::remove::packages:
  - 'mssql-tools'

Development

Pull requests are welcome via GitHub. Additional distribution compatibility can be added in both repository.pp and package.pp. This module was built using the Puppet Development Kit (PDK).