Forge Home

golang

Simple yet flexible Go installations. Allows automatic updates, multiple installations, and may be run as non-root.

25,001 downloads

109 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.2.7 (latest)
  • 1.2.6
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.7
  • 1.0.6
  • 1.0.5 (deleted)
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.1.0
released Feb 29th 2024
This version is compatible with:
  • Puppet Enterprise 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
  • Puppet >= 5.5.8
  • , , , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'dp-golang', '1.2.7'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dp-golang
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dp-golang --version 1.2.7

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
Tags: go, golang

Documentation

dp/golang — version 1.2.7 Feb 29th 2024

Simple yet flexible Go installations

This Puppet module has sane defaults to keep a standard installation simple, but is flexible enough to support automatic updates, multiple installations of diferent versions, and running Puppet as a non-root user.

Usage

Standard, single install

The golang class installs Go under /usr/local/go/, and symlinks the binaries into /usr/local/bin/.

include golang

By default it installs the latest version but never upgrades it after the initial installation. You can set it to automatically upgrade by passing latest to ensure, either with hiera (golang::ensure: latest), or with a class declaration:

class { 'golang':
  ensure => latest,
}

You may force it to install a specific version by passing it to ensure:

class { 'golang':
  ensure => '1.19.1',
}

Of course, you can also use ensure to uninstall Go:

class { 'golang':
  ensure => absent,
}

Multiple installs

You can install Go in other places and as other users using the golang::installation defined type, and you can link its binaries into a bin directory with golang::linked_binaries:

golang::installation { '/home/user/go-1.19.1':
  ensure => '1.19.1',
  owner  => 'user',
  group  => 'user',
}

golang::linked_binaries { '/home/user/go-1.19.1':
  into_bin => '/home/user/bin',
}

To install the latest version, set ensure => latest on golang::installation. To remove the installation or symlinks, just use ensure => absent.

Running Puppet as a non-root user

You can use the defined types to install Go even when running as a non-root user. owner and group default to the user and group running Puppet:

golang::installation { '/home/me/go':
  ensure => latest,
}

golang::linked_binaries { '/home/me/go':
  into_bin => '/home/me/bin',
}

Limitations

This does not support Windows.

Development status

This is stable. I have no features planned for the future, though I’m open to suggestions.

I will occasionally make 0.0.1 releases to keep this updated with the latest version of PDK.

Reference

There is specific documentation for individual parameters in REFERENCE.md. That file is generated with:

pdk bundle exec puppet strings generate --format markdown