- Description
- Setup - The basics of getting started with libnss_mysql
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
This Module manage libnss-mysql.
- /etc/nsswitch.conf
- nscd service (TODO)
class {'libnss-mysql': }
######################################################################
# 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})
}
class {'libnss_mysql':
config_manage => true,
}
class {'libnss_mysql::config':
username => 'foo',
password => 'bar',
}
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
- libnss_mysql: Main class, includes all other classes.
- libnss_mysql::install: Handles the packages.
- libnss_mysql::config: Handles configuration and cron files.
- libnss_mysql::params: default values.
- Tested with RedHat OS Family only
- Add "mysql" to nsswitch.conf isn't very nice for preexisting values