stns
Version information
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
Add this module to your Puppetfile:
mod 'hfm-stns', '3.0.1'
Learn more about managing modules with a PuppetfileDocumentation
puppet-stns
Table of Contents
- Description
- Setup - The basics of getting started with stns
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The STNS module handles installing, configuring, and running STNS and libnss_stns on stns.jp.
Setup
Setup Requirements
The STNS module requires the following puppet modules:
- puppetlabs-stdlib: version 4.0 or newer.
- puppetlabs-apt: version 2.0 or newer (only Debian-based distributions).
Both puppetlabs-apt is soft dependencies. If you are installing on Debian or RedHat-based systems, you will need to configure appropriate versions of those modules.
Beginning with STNS
To install the STNS server with default parameters, declare the stns::server
class.
include ::stns::server
To install the STNS client (libnss_stns) with default parameters, declare the stns::client
class.
include ::stns::client
Usage
Configuring stns::server
class { '::stns::server':
port => 1104,
user => 'sample',
password => 's@mp1e',
package_ensure => latest,
}
# Configures users and groups
stns::server::users {
'foo':
id => 1001,
group_id => 1001,
directory => '/home/foo',
shell => '/bin/bash';
'bar':
id => 1002,
group_id => 1001,
directory => '/home/bar',
shell => '/bin/bash';
}
stns::server::groups { 'sample':
id => 1001,
users => [
'foo',
'bar',
],
}
Configuring stns::client
class { '::stns::client':
api_end_point => 'http://stns.example.jp:1104',
user => 'sample',
password => 's@mp1e',
wrapper_path => '/usr/local/bin/stns-query-wrapper',
chain_ssh_wrapper => '/usr/libexec/openssh/ssh-ldap-wrapper',
ssl_verify => true,
request_timeout => 3,
http_proxy => 'http://proxy.example.com:1104',
libnss_stns_ensure => latest,
handle_nsswitch => true,
handle_sshd_config => true,
}
Configuring modules from Hiera
---
stns::server::port: 1104
stns::server::user: sample
stns::server::password: s@mp1e
stns::server::package_ensure: latest
stns::client::api_end_point: 'http://stns1.example.jp:1104'
stns::client::user: sample
stns::client::password: s@mp1e
stns::client::wrapper_path: '/usr/local/bin/stns-query-wrapper'
stns::client::chain_ssh_wrapper: null
stns::client::ssl_verify: true
stns::client::request_timeout: 3
stns::client::http_proxy: 'http://proxy.example.com:1104'
stns::client::libnss_stns_ensure: latest
stns::client::handle_nsswitch: true
stns::client::handle_sshd_config: true
Reference
Public Classes
stns::server
: Installs and configures STNS.stns::client
: Installs and configures libnss_stns.
Private Classes
stns::repo
: Setup STNS repository.stns::server::install
: Installs STNS package.stns::server::config
: Configures STNS.stns::server::server
: Manages service.stns::client::install
: Installs packages for libnss_stns.stns::client::config
: Configures
Defined Types
stns::server::users
: Specifies a STNS users configuration file.stns::server::groups
: Specifies a STNS groups configuration file.
Parameters
Class: stns::server
port
: Specifies a listen port listen. Valid options: a number of a port number. Default: 1104.user
: Specifies a user for authentication. Valid options: a string containing a valid username. Default: undef.password
: Specifies a password for authentication. Valid options: a string containing a valid password. Default: undef.package_ensure
: What state the packages should be in.
Class: stns::client
api_end_point
: Valid options: a string containing a valid url. Default: undef.user
: Specifies a user for authentication. Valid options: a string containing a valid username. Default: undef.password
: Specifies a password for authentication. Valid options: a string containing a valid password. Default: undef.wrapper_path
: Valid options: absolute path. Default: '/usr/local/bin/stns-query-wrapper'.chain_ssh_wrapper
: Default: undef.ssl_verify
: Enables SSL verification. Valid options: a boolean. Default: true.request_timeout
: Wrapper Command Timeout. Valid options: a number. Default: 3.http_proxy
: Valid options: a string. Default: undef.uid_shift
: Shift uid. Valid options: a number. Default: 0.gid_shift
: Shift gid. Valid options: a number. Default: 0.libnss_stns_ensure
: What state the libnss-stns package should be in.handle_nsswitch
: Configure nsswitch.conf to use STNS. Valid options: a boolean. Default: false.handle_sshd_config
: Configure sshd_config to use STNS. Valid options: a boolean. Default: false.
Defined Types: stns::server::users
id
: Specifies the user ID. Valid options: a number type. Default: undef.group_id
: Specifies the user's primary group. Valid options: a number type. Default: undef.directory
: Specifies the home directory of the user. Valid options: a string containing a valid path. Default:/home/<resource title>
.shell
: Specifies the user's login shell. Valid options: a string containing a valid path. Default:/bin/bash
.keys
: Specify user attributes in an array of key = value pairs. Valid options: a string containing a valid key = value pairs. Default: undef.link_users
: Valid options: a string containing a valid password. Default: undef.
Defined Types: stns::server::groups
id
: Specifies the group ID. Valid options: a number type. Default: undef.users
: Specifies the members of the group. Valid options: a string containing a valid password. Default: undef.
Parameters
Limitations
This module has been tested on:
- RedHat Enterprise Linux 7
- CentOS 7
- Scientific Linux 7
- Debian 8
- Ubuntu 16.04
Development
Running tests
The STNS puppet module contains tests for both rspec-puppet (unit tests) and beaker-rspec (acceptance tests) to verify functionality. For detailed information on using these tools, please see their respective documentation.
Testing quickstart
- Unit tests:
$ bundle install
$ bundle exec rake
- Acceptance tests:
# Set your DOCKER_HOST variable
$ eval "$(docker-machine env default)"
# List available beaker nodesets
$ bundle exec rake beaker_nodes
centos7
jessie
xenial
# Run beaker acceptance tests
$ BEAKER_set=centos7 bundle exec rake beaker
CHANGELOG
v3.0.1 (2019-04-24)
- needs initial values even though optional #40 (tnmt)
- Fix CI #41 (hfm)
- Hiera #39 (hfm)
- pdk 1.8.0 #38 (hfm)
v3.0.0 (2018-12-13)
Breaking change:
v2.3.0 (2018-10-02)
v2.2.0 (2018-06-07)
v2.1.0 (2017-12-07)
Release 2.0.1 (2017/07/05)
- Fix: remove deprecated function #29
Release 2.0.0 (2017/05/12)
- Change: Update for Puppet 4 data types #30
Release 1.8.0 (2017/05/12)
- Change: Remove upper limit of puppetlabs-concat and puppetlabs-apt versions #29
Release 1.7.2 (2017/01/17)
Release 1.7.1 (2016/11/25)
- Fix: Fix path to stns-query-wrapper #27
Release 1.7.0 (2016/11/20)
- Feature: Add parameter uid_shift and gid_shift #26
Release 1.6.0 (2016/08/08)
Release 1.5.0 (2016/07/29)
- Change: $package_ensure is deprecated and use $libnss_stns_ensure and $libpam_stns_ensure instead. #22
Release 1.4.0 (2016/06/27)
- Feature: Add params
$request_timeout
and$http_proxy
to stns::client class #21
Release 1.3.0 (2016/06/09)
- Feature: Add
$package_latest
option to catch up latest packages in stns::server #19
Release 1.2.0 (2016/06/09)
- Feature: Add
$package_latest
option to catch up latest packages in stns::client #18
Release 1.1.0 (2016/05/03)
- Feature: Install libpam-stns package #12
Release 1.0.0 (2016/03/18)
- Feature: Configure users and groups of STNS server #7
Release 0.3.0 (2016/03/17)
- Handle sshd_config with augeas #6
Release 0.2.0 (2016/03/17)
- Handle nsswitch.conf with augeas #5
Release 0.1.0
Summary
Initial release.
Dependencies
- puppetlabs-stdlib (>= 4.0.0 < 6.0.0)
- puppetlabs-concat (>= 2.0.0 < 6.0.0)
The MIT License (MIT) Copyright (c) 2016 OKUMURA Takahiro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.