Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 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
- Puppet >= 7.0.0 < 9.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'treydock-nhc', '6.0.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-module-nhc
Table of Contents
- Overview
- Usage - Configuration options
- Reference - Parameter and detailed reference to all options
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
This module manages the installation and configuration of LBNL Node Health CHeck (NHC).
Usage
Class: nhc
Configure a host with NHC.
include nhc
This is an example of using Hiera to define the default checks installed with NHC.
nhc::checks:
- 'check_fs_mount_rw /tmp'
- 'check_fs_mount_rw /'
- 'check_fs_mount_rw /dev/pts '/(none|devpts)/' devpts'
- 'check_ps_daemon sshd root'
- 'check_ps_daemon provisiond root'
- 'check_ps_daemon wulfd root'
- 'check_ps_unauth_users log syslog'
- 'check_ps_userproc_lineage log syslog'
- 'check_ps_kswapd 1800000 100 log syslog'
- 'check_hw_cpuinfo 2 8 8'
- 'check_hw_physmem 1024 1073741824'
- 'check_hw_swap 1 1073741824'
- 'check_hw_mem 1024 1073741824'
- 'check_hw_physmem_free 1'
- 'check_hw_swap_free 1'
- 'check_hw_mem_free 1'
- 'check_hw_ib 40'
- 'check_hw_gm myri0'
- 'check_hw_eth eth1'
A Hash can also be used to define checks
nhc::checks:
'*':
- 'check_fs_mount_rw /tmp'
- 'check_fs_mount_rw /'
- 'check_fs_mount_rw /dev/pts '/(none|devpts)/' devpts'
'foo.baz':
- 'check_ps_daemon sshd root'
- 'check_ps_daemon provisiond root'
- 'check_ps_daemon wulfd root'
- 'check_ps_unauth_users log syslog'
- 'check_ps_userproc_lineage log syslog'
- 'check_ps_kswapd 1800000 100 log syslog'
'foo.bar':
- 'check_hw_cpuinfo 2 8 8'
- 'check_hw_physmem 1024 1073741824'
- 'check_hw_swap 1 1073741824'
- 'check_hw_mem 1024 1073741824'
- 'check_hw_physmem_free 1'
- 'check_hw_swap_free 1'
- 'check_hw_mem_free 1'
- 'check_hw_ib 40'
- 'check_hw_gm myri0'
- 'check_hw_eth eth1'
Defining settings that are for all hosts and a specific host:
nhc::settings:
DF_FLAGS: '"-Tkal -xgpfs -xfuse"'
DFI_FLAGS: '"-Tkal -xgpfs -xfuse"'
MAX_SYS_UID: '999'
NHC_RM: 'slurm'
nhc::settings_host:
'c0001':
PATH: '"$PATH:/some/other/sbin"'
This is an example of using a local yum repository to install NHC.
nhc::install_method: repo
nhc::repo_name: local-repo
This is an other example of using a custom package URL.
nhc::install_method: package
nhc::package_url: "https://example.com/lbnl-nhc-1.4.3-1.el7.custom.noarch.rpm"
nhc::package_name: "lbnl-nhc-1.4.3-1.el7.custom.noarch.rpm"
It's possible to install from source (this is default behavior for all but RedHat based systems):
nhc::install_method: source
Reference
Reference
Table of Contents
Classes
nhc
: Manage Node Health Check (NHC)nhc::config
: private classnhc::install
: private class
Defined types
nhc::conf
: Manage NHC configurationsnhc::custom_check
: Add NHC custom check file
Classes
nhc
Manage Node Health Check (NHC)
Examples
include ::nhc
Parameters
The following parameters are available in the nhc
class:
ensure
install_method
package_ensure
version
package_release
install_source
package_name
repo_name
source_dependencies
libexec_dir
checks
settings
settings_host
config_overrides
detached_mode
detached_mode_fail_nodata
program_name
conf_dir
conf_file
include_dir
log_file
sysconfig_path
manage_logrotate
log_rotate_every
custom_checks
ensure
Data type: Enum['present', 'absent']
State of NHC resources
Default value: 'present'
install_method
Data type: Enum['repo','package','source']
The method used to install NHC.
Using repo
will require the Yumrepo
resource if repo_name
is defined.
Default value: 'source'
package_ensure
Data type: Optional[String]
The ensure state of package if using install_method
of repo
or package
.
Default value: undef
version
Data type: String
The version of NHC to install.
Default value: '1.4.3'
package_release
Data type: String
The package release NHC to install. Not used if install_method
is source
.
Default value: '1'
install_source
Data type: Optional[Variant[Stdlib::HTTPUrl,Stdlib::HTTPSUrl]]
The source of install.
For install_method
of package
this is URL to package
For install_method
of source
this is git source URL
Default value: undef
package_name
Data type: Optional[String]
Name of the NHC package, not used with install_method
of source
.
Default value: undef
repo_name
Data type: Optional[String]
The repo name for NHC, only used with install_method
of repo
.
Default value: undef
source_dependencies
Data type: Array
The package dependencies for source install.
Default value: ['automake','make']
libexec_dir
Data type: Stdlib::Absolutepath
Location for libexec directory, OS dependent.
Default value: '/usr/libexec'
checks
Data type: Variant[Hash, Array]
NHC checks for nhc.conf
Default value: []
settings
Data type: Hash
Settings to add to nhc.conf
Default value: {}
settings_host
Data type: Hash
Host specific settings for nhc.conf
Default value: {}
config_overrides
Data type: Hash
Settings to add to /etc/sysconfig/nhc
Default value: {}
detached_mode
Data type: Boolean
Value for DETACHED_MODE
Default value: false
detached_mode_fail_nodata
Data type: Boolean
Value for DETACHED_MODE_FAIL_NODATA
Default value: false
program_name
Data type: String
Value for NAME
Default value: 'nhc'
conf_dir
Data type: Stdlib::Absolutepath
Path to NHC configuration directry
Default value: '/etc/nhc'
conf_file
Data type: Stdlib::Absolutepath
Path for this configuration file
Default value: '/etc/nhc/nhc.conf'
include_dir
Data type: Stdlib::Absolutepath
Path to directory containing NHC checks
Default value: '/etc/nhc/scripts'
log_file
Data type: Stdlib::Absolutepath
Path to log file
Default value: '/var/log/nhc.log'
sysconfig_path
Data type: Stdlib::Absolutepath
Path to sysconfig file
Default value: '/etc/sysconfig/nhc'
manage_logrotate
Data type: Boolean
Boolean that sets if logrotate resources should be managed
Default value: true
log_rotate_every
Data type: String
Frequency of logrotation
Default value: 'weekly'
custom_checks
Data type: Hash
Hash passed to nhc::custom_check
Default value: {}
nhc::config
private class
nhc::install
private class
Defined types
nhc::conf
Manage NHC configurations
Examples
Define additional NHC configuration
nhc::conf { 'nhc-cron':
settings => { 'NHC_RM' => 'slurm' },
settings_host => { 'c0001' => { 'FOO' => 'bar' }},
checks => { '*' => ['check_fs_free /tmp 10%'] },
config_overrides => { 'HOSTNAME' => '"$HOSTNAME_S"' },
}
Parameters
The following parameters are available in the nhc::conf
defined type:
ensure
checks
settings
settings_host
config_overrides
detached_mode
detached_mode_fail_nodata
program_name
conf_dir
conf_file
include_dir
sysconfig_path
log_file
ensure
Data type: Enum['present', 'absent']
State of nhc::conf
Default value: 'present'
checks
Data type: Variant[Hash, Array]
Checks to add to the configuration file
Default value: []
settings
Data type: Hash
Settings to add to the configuration file
Default value: {}
settings_host
Data type: Hash
Settings specific to a hosts to add to the configuration file
Default value: {}
config_overrides
Data type: Hash
Overrides for configuration in /etc/sysconfig/$name
Default value: {}
detached_mode
Data type: Boolean
Value for DETACHED_MODE
Default value: false
detached_mode_fail_nodata
Data type: Boolean
Value for DETACHED_MODE_FAIL_NODATA
Default value: false
program_name
Data type: String
Value for NAME
Default value: $name
conf_dir
Data type: Optional[Stdlib::Absolutepath]
Path to NHC configuration directry. Defaults to /etc/nhc
Default value: undef
conf_file
Data type: Optional[Stdlib::Absolutepath]
Path for this configuration file. Defaults to /etc/nhc/$name.conf
Default value: undef
include_dir
Data type: Optional[Stdlib::Absolutepath]
Path to directory containing NHC checks. Defaults to /etc/nhc/scripts
Default value: undef
sysconfig_path
Data type: Optional[Stdlib::Absolutepath]
Path to sysconfig file. Defaults to /etc/sysconfig/$name
Default value: undef
log_file
Data type: Optional[Stdlib::Absolutepath]
Path to log file. Defaults to /var/log/$name.log
Default value: undef
nhc::custom_check
Add NHC custom check file
Examples
Define custom NHC check file
nhc::custom_check { 'osc_gpfs':
source => 'puppet:///modules/profile/nhc/osc_gpfs.nhc',
}
Parameters
The following parameters are available in the nhc::custom_check
defined type:
source
Data type: Optional[String]
The source of the custom check
Default value: undef
Change log
All notable changes to this project will be documented in this file. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
v6.0.0 (2024-10-14)
UNCATEGORIZED PRS; GO LABEL THEM
v5.0.0 (2023-08-21)
Changed
Added
v4.0.0 (2022-04-13)
Changed
Added
v3.1.0 (2021-10-04)
Added
v3.0.0 (2021-09-24)
Changed
- Update module dependencies and version ranges for OS and Puppet #18 (treydock)
- Remove EL6 support, Remove Puppet 5 support, Add Puppet 7 support, Update module dependency ranges #17 (treydock)
Added
- Improved source install handling #21 (treydock)
- Support Debian and Ubuntu - default to source install except for EL7 #20 (treydock)
- Support EL8 #19 (treydock)
v2.0.3 (2019-12-16)
Fixed
v2.0.2 (2019-10-10)
Fixed
v2.0.1 (2019-10-08)
Fixed
- Remove LOGFILE from sysconfig files by default as it prevents log redirection to stdout #13 (treydock)
v2.0.0 (2019-09-27)
Changed
Added
- Update module and puppet dependencies #12 (treydock)
- Improve docs #11 (treydock)
- Use yum module to install NHC RPM #9 (treydock)
- Set LOGFILE #8 (treydock)
- Improve #7 (treydock)
- Convert module to PDK #4 (treydock)
Fixed
1.1.0 (2017-10-30)
1.0.3 (2017-10-30)
1.0.2 (2017-10-30)
1.0.1 (2017-10-29)
1.0.0 (2017-10-29)
0.0.1 (2017-06-21)
Added
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 9.0.0 <10.0.0)
- puppetlabs/vcsrepo (>= 1.0.0 <7.0.0)
- puppet/logrotate (>= 2.0.0 <8.0.0)
- puppet/yum (>= 1.0.0 <8.0.0)
Copyright (C) 2015 Trey Dockendorf treydock@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.