puppet_health_check
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
- , , , , , , , , , ,
Tasks:
- fix_noop
- fix_runinterval
- agent_health
- fix_lockfile
Plans:
- fix_nodes
Start using this module
Add this module to your Puppetfile:
mod 'albatrossflavour-puppet_health_check', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet_health_check
Table of Contents
- Description
- Setup - The basics of getting started with puppet_health_check
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
A set of tasks to carry out health checks on puppet infrastructure. Includes things such as :
- Valiating the puppetmaster/compile masters are reachable from the agent
- The puppet agent is enabled and running
- The run interval is set to the desired value
- The last run was within the run interval
- If the catalog failed to compile
- If any errors were encountered on the last puppet run
Setup
Providing you can run tasks, you should be ok
Beginning with puppet_health_check
puppet task show puppet_health_check::agent_health
should get you going, everything is driven through tasks which can be accessed from the command line or the PE console. When you run the task, you'll see output like:
# puppet task run puppet_health_check::agent_health -q 'inventory[certname] {}'
Starting job ...
Note: The task will run only on permitted nodes.
New job ID: 487
Nodes: 4
Started on puppetmaster.example.com ...
Started on linode-centos-73.example.com ...
Started on win-3ebipmjenlq.example.coexample.com ...
Started on cd4pe.example.com ...
Finished on node cd4pe.example.com
date : 2018-09-04T14:24:55+10:00
state : clean
certname : cd4pe.example.com
Finished on node puppetmaster.example.com
date : 2018-09-04T14:24:55+10:00
state : clean
certname : puppetmaster.example.com
Finished on node linode-centos-73.example.com
date : 2018-09-04T14:24:56+10:00
state : clean
certname : linode-centos-73.example.com
Failed on win-3ebipmjenlq.example.com
Error: Task finished with exit-code 1
date : 2018-09-04T14:26:28+10:00
state : issues found
service : Puppet service not configured to run
certname : win-3ebipmjenlq.example.com
Job completed. 4/4 nodes succeeded.
Duration: 5 sec
Usage
All driven through tasks, either from the CLI, the console or via the API
Limitations
I'm sure there are many, but not found anything obvious yet
Development
Fork, develop, submit a PR
Reference
Table of Contents
Tasks
agent_health
: Check the health of a puppet agentfix_noop
: Set the noop value of a nodefix_runinterval
: Set the runinterval value of a node
Plans
puppet_health_check::fix_nodes
: Plan to carry out automated fixes found by the health_check task
Tasks
agent_health
Check the health of a puppet agent
Supports noop? true
Parameters
target_runinterval
Data type: Optional[Integer]
What should the agent run interval be set to? (Defaults to 1800 seconds)
target_noop_state
Data type: Optional[Boolean]
What should the agent noop state be set to? (Defaults to false)
target_service_enabled
Data type: Optional[Boolean]
Should the puppet service be enabled? (Defaults to true)
target_service_running
Data type: Optional[Variant[Boolean,Enum['running', 'stopped']]]
Should the puppet service be running? (Defaults to 'running')
fix_noop
Set the noop value of a node
Supports noop? false
Parameters
target_state
Data type: Optional[Boolean]
What should the agent noop value be set to? (Defaults to false)
fix_runinterval
Set the runinterval value of a node
Supports noop? false
Parameters
target_state
Data type: Optional[Integer]
What should the runinterval value be set to? (Defaults to 1800)
Plans
puppet_health_check::fix_nodes
Plan to carry out automated fixes found by the health_check task
Parameters
The following parameters are available in the puppet_health_check::fix_nodes
plan.
nodes
Data type: TargetSpec
target_noop_state
Data type: Boolean
Default value: false
target_runinterval
Data type: Integer
Default value: 1800
target_service_enabled
Data type: Boolean
Default value: true
target_service_running
Data type: Boolean
Default value: true
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
fix_lockfile
Remove the agent lock file
What are plans?
Modules can contain plans that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.