Forge Home


Puppet module to add Linux machines to a Windows domain using Winbind


4,501 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

  • 0.5.1 (latest)
  • 0.5.0
  • 0.4.2
  • 0.4.1
  • 0.4.0
  • 0.3.0
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.0
released May 23rd 2019
This version is compatible with:
  • Puppet Enterprise 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 < 7.0.0

Start using this module

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

Add this module to your Puppetfile:

mod 'jgazeley-winbind', '0.5.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add jgazeley-winbind
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install jgazeley-winbind --version 0.5.1

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.

Tags: samba, winbind


jgazeley/winbind — version 0.5.1 May 23rd 2019


Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module


Puppet module to add Linux machines to a Windows domain using Winbind. It installs the bare minimum needed to achieve this, and notably does not install or configure the Samba server.

Module Description

Puppet module to add Linux machines to a Windows Active Directory domain using Winbind. As this module fiddles with smb.conf it is not compatible with any other module that affects Samba operations, unless a non default location for smb.conf is specified as a parameter.

This module installs the following facts:

  • ads_domain - the name of the domain the system is currently joined to
  • winbind_version - the version of winbind currently installed on the system
  • netbiosname - a suggested default value for the Netbios name


Usage of this module is quite straightforward. A minimal example which accepts most defaults is:

class { 'winbind':
  domainadminuser => 'admin',
  domainadminpw   => 'password',
  domain          => 'MYCOMPANY',
  realm           => '',

This example is more extensive and shows every possible option:

class { 'winbind':
  domainadminuser                => 'admin',
  domainadminpw                  => 'password',
  domain                         => 'MYCOMPANY',
  realm                          => '',
  createcomputer                 => 'Computers/BusinessUnit/Department/Servers',
  netbiosname                    => 'MYWORKSTATION',
  winbind_max_domain_connections => 8,
  winbind_max_clients            => 500,
  osdata                         => false,
  machine_password_timeout       => 0,
  smbconf_file                   => '/etc/samba/custom-smb.conf'
  winbind_use_default_domain     => 'no',
  winbind_offline_logon          => 'false',
  template_shell                 => '/bin/false',
  template_homedir               => '/home/%U',
  uidrange                       => '16777216-33554431',
  winbind_clients_package        => 'samba-winbind-clients',
  samba_client_package           => 'samba-client',
  samba_winbind_package          => 'samba-winbind',


Username of Windows domain admin with sufficient rights to add machines to AD. Required.


Password of Windows domain admin with sufficient rights to add machines to AD. Required.


NT4-style domain name of your site, e.g. MYCOMPANY. Required.


Realm of your site, e.g. Required.


OU to create the machine account in. Optional.


Netbios name of the local machine. Optional, max 15 chars, defaults to $::netbiosname.


Specify a custom disk location for the smb.conf file. Useful if another module is managing samba shares in the default configuration file.


Specify the maximum number of simultaneous connections that the winbindd daemon should open to the domain controller of one domain. Setting this parameter to a value greater than 1 can improve scalability with many simultaneous winbind requests, some of which might be slow. Default: 1


Specify the maximum number of clients the winbindd daemon can connect with. Default: 200.


If true, provide values for osName and osVer (e.g. CentOS and 7). Default: false.


This parameter specifies how often machine password will be changed, in seconds. The default is one week (expressed in seconds), the same as a Windows NT Domain member server. Default: 604800.


Causes winbind to treat any username that isn't qualified with a domain name as a username in the domain to which winbind is joined. Default: no


Allow offline logon with cached credentials Default: false


Default user shell. Default: /bin/false


Default location of user's home directory. Default: /home/%U


Range of UIDs that can be allocated. Default: 16777216-33554431


Package name of Winbind client tools. Default: samba-winbind-clients


Package name of Samba client. Default: samba-client


Package name of Winbind libraries. Default: samba-winbind


Written for CentOS 5 and 6 with Samba 3.x. not tested on other platforms. If your distro is not in the list but you know it works, let me know and I'll update the list. If the module needs some extra work to enable support for your distro, send a patch!

This module is not compatible with any other Samba/Winbind modules which touch smb.conf or handle Winbind packages.


Pull requests and issues welcome. No guarantees of fixes, but I'll do my best.

There are lots of additional options for Winbind that can be specified in smb.conf. If you're feeling keen, edit the template, manifest and README and add these options to the module as parameters.