/
lab.yaml
177 lines (157 loc) · 5.5 KB
/
lab.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
# Monitoring with Icinga and sensu
psick::pre::linux_classes:
puppet: 'psick::puppet::pe_agent'
hosts: 'psick::hosts::file'
psick::base::linux_classes:
icinga: 'psick::icinga2'
monitor_plugins: 'psick::monitor::nagiosplugins'
sensu: 'psick::sensu'
ansible: 'psick::ansible'
bolt: 'psick::bolt'
dns: '' # In lab we leave DNS unmanaged
psick::puppet::pe_agent::manage_environment: true
# Disabled updating host entry by psick::hostname
psick::hostname::update_host_entry: false
# Hosts file managed via file resource
psick::hosts::file::extra_hosts:
- '10.42.43.101 puppet puppet.lab.psick.io'
- '10.42.43.102 git git.lab.psick.io'
- '10.42.43.103 cirunner cirunner.lab.psick.io'
- '10.42.43.104 manageiq manageiq.lab.psick.io'
- '10.42.43.105 rundeck rundeck.lab.psick.io'
- '10.42.43.106 build build.lab.psick.io'
- '10.42.43.107 docker docker.lab.psick.io'
- '10.42.43.116 lamp lamp.lab.psick.io'
# Enable automatic updates on lab nodes and set schedule:
psick::update::cron_schedule: '42 4 * * *'
# Monitoring defaults:
psick::monitor:
interface: 'eth1'
psick::icinga2::master: 'icinga.lab.psick.io'
psick::icinga2::is_client: true
psick::icinga2::install_cli: true
psick::sensu::is_client: true
psick::sensu::rabbitmq_host: 'sensu.lab.psick.io'
psick::sensu::rabbitmq_password: 'hiera_encrypt_in_the_real_world'
psick::sensu::rabbitmq_vhost: '/sensu'
psick::sensu::api_user: 'admin'
psick::sensu::api_password: 'sensu' # In real world encrypt with hiera eyaml
#sensu::client_http_socket:
# bind: "%{facts.networking.ip}"
# port: 3031
# user: sensu
# password: sensu
#sensu::client_servicenow:
# configuration_item:
# name: "%{::role} server"
# os_version: "%{facts.os.release.full}"
#sensu::client_puppet:
# nodename: "%{facts.networking.fqdn}"
#sensu::client_chef:
# nodename: "%{facts.networking.fqdn}"
#sensu::client_ec2:
# instance-id: "%{facts.networking.fqdn}"
sensu::client_register: true
sensu::client_registration:
handler: 'servicenow'
psick::sensu::checks_params_hash:
handlers:
- 'graphite'
- 'mailer'
standalone: false
subscribers: 'base'
psick::sensu::checks_hash:
'check_cpu':
command: '/opt/sensu/embedded/bin/check-cpu.rb'
'check_cron':
command: '/opt/sensu/embedded/bin/check-process.rb -p cron -C 1'
'check_disk':
command: '/opt/sensu/embedded/bin/check-disk-usage.rb -w 90 -c 95'
interval: 3600
'check_dns':
command: "/opt/sensu/embedded/bin/check-dns.rb -d %{facts.networking.domain} -s 8.8.8.8 "
'check_journal':
command: '/opt/sensu/embedded/bin/check-journal.rb -q fail --since=-60minutes -c 1'
interval: 3600
'check_mem':
command: '/opt/sensu/embedded/bin/check-memory-percent.rb -p -c 95 -w 90'
'check_last_puppet_run':
command: "/opt/sensu/embedded/bin/check-mtime.rb -f /opt/puppetlabs/puppet/cache/client_data/catalog/%{clientcert}.json -w 750 -c 1800"
ensure: 'absent'
sensu::handlers:
'graphite-occurrences':
type: 'pipe'
command: '/etc/sensu/handlers/graphite-occurrences.rb'
'graphite':
type: 'tcp'
socket:
host: "graphite.%{facts.networking.domain}"
port: 2003
mutator: 'only_check_output'
'mailer':
type: 'pipe'
command: '/etc/sensu/handlers/mailer.rb'
config:
mail_from: "info@%{facts.networking.domain}"
mail_to: "info@%{facts.networking.domain}"
smtp_address: 'localhost'
smtp_port: 25
smtp_domain: "%{facts.networking.domain}"
psick::sensu::plugins_params_hash:
pkg_provider: 'sensu_gem'
type: 'package'
# gem_install_options: [{ '-p' => 'http://user:pass@myproxy.company.org:8080' }]
psick::sensu::plugins_hash:
'sensu-plugins-conntrack': {}
'sensu-plugins-cpu-checks': {}
'sensu-plugins-cpu-usage': {}
'sensu-plugins-dhcp': {}
'sensu-plugins-disk-checks': {}
'sensu-plugins-dns': {}
'sensu-plugins-dnslookup': {}
'sensu-plugins-disk-checks': {}
'sensu-plugins-filesystem-checks': {}
'sensu-plugins-filesize': {}
'sensu-plugins-fsmounts': {}
# 'sensu-plugins-graphite': {}
'sensu-plugins-hardware': {}
'sensu-plugins-io-checks': {}
'sensu-plugins-load-checks': {}
'sensu-plugins-loadavg': {}
'sensu-plugins-logs': {}
'sensu-plugins-memory-checks': {}
'sensu-plugins-network-checks': {}
'sensu-plugins-ntp': {}
'sensu-plugins-process-checks': {}
sensu::purge:
'plugins': true
'config': true
'handlers': true
'extensions': true
'mutators': true
#Timezone
psick::timezone::timezone: 'CEST'
psick::timezone::timezone_windows: 'Central European Standard Time'
# Puppet agents (on PE) sticky environment
psick::puppet::pe_agent::manage_environment: true
# Users
# psick::users::root_pw: hash_as_in_etc_shadow
psick::users::delete_unmanaged: false
psick::users::module: 'user'
psick::users::users_hash:
al:
ensure: present
comment: 'Al'
groups:
- users
# ssh_authorized_keys:
# - 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC93uOkdIrvcA1ij6wxtL0wDKch7E2gFqID2xR1LnEVQRSP9OFmNQV+4B7fM/fAVpFs939qBDeDRabft1ZAP2hUIeKWxweNQ6wxxV3YhJbxt+g6RAqm37BI+/ynZnZ4vrQp3XHfxNFYGFqiaowiiQ3/0QLh8PHliDJroOUU7h2YNwKBWiqdgufLCrPgnalSZ3kfKa2Yd5sM+iyAYJ102sXcGIFjAXCmQU1y7aJXjrzXzPuugnHvVFPzAUjsvu0FAiE+m8EhfBiyy1+SjnMB838G3EwrqNW+sEZ6lXh637xensB2WJuH0lPooCgaeG6WCmYjVK9rblcOb3B0Pp8Vbhp5 al@lab.psick.io'
# Ansible
psick::ansible::master: puppet.lab.psick.io
psick::ansible::keyshare_method: storeconfigs
# Bolt
psick::bolt::master: puppet.lab.psick.io
psick::bolt::keyshare_method: storeconfigs
# Enable package data collection on Puppet Enterprise
puppet_enterprise::profile::agent::package_inventory_enabled: true