Forge Home

libnss_mysql

Managing libnss-mysql

5,515 downloads

5,515 latest version

4.7 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.1.0 (latest)
released May 9th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.0.0

Start using this module

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

Add this module to your Puppetfile:

mod 'bcbjoern-libnss_mysql', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add bcbjoern-libnss_mysql
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install bcbjoern-libnss_mysql --version 0.1.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

bcbjoern/libnss_mysql — version 0.1.0 May 9th 2018

libnss_mysql

Table of Contents

  1. Description
  2. Setup - The basics of getting started with libnss_mysql
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.

Description

This Module manage libnss-mysql.

Setup

What libnss_mysql affects optionaly

  • /etc/nsswitch.conf
  • nscd service (TODO)

Beginning with libnss_mysql

  class {'libnss-mysql': }

Profile Example

######################################################################
# Class: profile::libnss_mysql                                       #
######################################################################
class profile::libnss_mysql(
  Hash $libnss_mysql_settings = hiera('libnss_mysql')
) inherits profile {

  create_resources('class', { '::libnss_mysql' => $libnss_mysql_settings})
}

Usage

class {'libnss_mysql':
  config_manage => true,
}

class {'libnss_mysql::config':
  username => 'foo',
  password => 'bar',
}

Hiera Examples

libnss_mysql:
  config_manage: true
  config_parameters:
    username: 'proftp'
    password: "%{hiera('mysql_password')}"
    host: '192.168.0.5'
    database: 'ftp'
    getpwnam: "SELECT username,'x',uid,gid,'MySQL User', home,shell FROM users WHERE username='%1$s' LIMIT 1"
    getpwuid: "SELECT username,'x',uid,gid,'MySQL User', home,shell FROM users WHERE uid='%1$u' LIMIT 1"
    getspnam: "SELECT username,passwd,'1','0','99999','0','0','-1','0' FROM users WHERE username='%1$s' LIMIT 1"
    getpwent: "SELECT username,'x',uid,gid,'MySQL User', home,shell FROM users"
    getspent: "SELECT username,passwd,'1','0','99999','0','0','-1','0' FROM users"
    getgrnam: "SELECT groupname,'x',gid FROM groups WHERE groupname='%1$s' LIMIT 1"
    getgrgid: "SELECT groupname,'x',gid FROM groups WHERE gid='%1$u' LIMIT 1"
    getgrent: "SELECT groupname,'x',gid FROM groups"
    memsbygid: "SELECT u.username FROM users_groups ug, users u, groups g WHERE g.id = ug.groups_id and u.id = ug.users_id and g.gid='%1$u'"
    gidsbymem: "SELECT g.gid FROM users_groups ug, users u, groups g WHERE g.id = ug.groups_id and u.id = ug.users_id and u.username='%1$s'"
    nsswitch_manage: true

Reference

Classes

Public Classes

  • libnss_mysql: Main class, includes all other classes.

Private Classes

  • libnss_mysql::install: Handles the packages.
  • libnss_mysql::config: Handles configuration and cron files.
  • libnss_mysql::params: default values.

Limitations

  • Tested with RedHat OS Family only
  • Add "mysql" to nsswitch.conf isn't very nice for preexisting values