View
8.889
Download
0
Category
Preview:
Citation preview
Puppet Master
Puppet Code (.git repository)
web01.olindata.com icinga.olindata.comdb01.olindata.comPuppet Agent Puppet AgentPuppet Agent
●○ mod 'icingaweb2',
■ :git => 'https://github.com/icinga/puppet-icingaweb2.git'
○ mod 'icinga2',■ :git => 'https://github.com/icinga/puppet-icinga2.git', ■ :branch => 'develop'
○ mod 'puppetlabs/mysql', '3.6.2'
class opstheater::profile::icinga::db {
$icinga2_webdb_password = ‘mypw’
$icinga2_ido_password = ‘mypw’
$mysql_whitelist_range = ‘192.168.%’
mysql::db { 'icinga2_web':
user => 'icinga2_web',
password => $icinga2_webdb_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
mysql::db { 'icinga2_data':
user => 'icinga2',
password => $icinga2_ido_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
}
$icinga2_db_ipaddress = hiera('opstheater::icinga::mysql_ipaddress')
$icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn')
$icinga2_ido_password = hiera('opstheater::icinga::ido_password')
class { 'icinga2':
db_type => 'mysql',
db_host => $icinga2_db_ipaddress,
db_port => '3306',
db_name => 'icinga2_data',
db_user => 'icinga2',
db_pass => $icinga2_ido_password,
manage_database => true,
}
●
●
●
class opstheater::profile::icinga::web {
class { 'icingaweb2':
manage_repo => true,
install_method => 'package',
manage_apache_vhost => true,
apache_vhost_name => $icinga2_web_fqdn,
ido_db => 'mysql',
ido_db_host => $icinga2_db_ip,
ido_db_name => 'icinga2_data',
ido_db_user => 'icinga2',
ido_db_pass => $icinga2_ido_pass,
web_db => 'mysql',
web_db_name => 'icinga2_web',
web_db_host => $icinga2_db_ip,
web_db_user => 'icinga2_web',
web_db_pass => $icinga2_webdb_pass,
web_db_port => '3306',
}
class opstheater::profile::icinga::client {
include ::icinga2
include ::icinga2::feature::command
class { '::icinga2::feature::api':
accept_commands => true,
accept_config => true,
manage_zone => false,
}
# icinga2::pki::puppet class needs to be declared
# after the icinga2::feature::api class in order
# to avoid resource duplication
contain ::icinga2::pki::puppet
}
$icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn')
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => {
host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_web_fqdn => {
host => $icinga2_web_fqdn },
},
}
Icinga2::Object::Zone <<| |>>
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress,}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
node ‘icinga.olindata.com’ {
Icinga2::Object::Host <<| |>> Icinga2::Object::Service <<| |>> Icinga2::Object::Zone <<| |>>
@@icinga2::object::zone { $::fqdn: endpoints => { $::fqdn => { host => $::fqdn }, }, parent => 'master', } icinga2::object::zone { 'master': endpoints => { $icinga2_fqdn => { host => $icinga2_ip, }, }, }
}
node ‘web01.olindata.com’ { @@icinga2::object::zone { $::fqdn: endpoints => { $::fqdn => { host => $::fqdn }, }, parent => 'master', } icinga2::object::zone { 'master': endpoints => { $icinga2_fqdn => { host => $icinga2_ip, }, }, }
Icinga2::Object::Zone <<| |>>
@@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, }}
Icinga2::Object::Apply_service {
assign_where => 'host.address && host.vars.remote == true && host.vars.remote_endpoint',
command_endpoint => 'host.vars.remote_endpoint',
}
icinga2::object::apply_service { 'user':
check_command => 'users',
}
icinga2::object::apply_service { 'load':
check_command => 'load',
}
icinga2::object::apply_service { 'process':
check_command => 'procs',
}
●●
Recommended