added in and tidy up of metrics

This commit is contained in:
christopher.lawrence 2020-03-30 12:19:25 +01:00
parent 5f78f7fe04
commit 2d6f08fcce
11 changed files with 63 additions and 51 deletions

View File

@ -1,3 +1,7 @@
---
profile::puppetserver::authority: false
profile::puppetserver::authority: true
profile::puppetserver::authority::validity: '7200'
profile::puppetserver::nfs_export: true
puppet_enterprise::profile::master::r10k_remote: "git@github.com:chlawren/control-repo.git"
puppet_enterprise::profile::master::r10k_private_key: "/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa"
puppet_enterprise::profile::master::code_manager_auto_configure: true

View File

@ -0,0 +1,6 @@
---
profile::puppetserver::authority: true
profile::puppetserver::authority::validity: '7200'
puppet_enterprise::profile::master::r10k_remote: "git@github.com:chlawren/control-repo.git"
puppet_enterprise::profile::master::r10k_private_key: "/etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa"
puppet_enterprise::profile::master::code_manager_auto_configure: true

View File

@ -36,26 +36,6 @@ node 'puppet' {
}
node 'peadm-03.pe' {
include profile::tools::docker_install
include profile::tools::nfs_mount
}
node 'agent-02' {
include profile::tools::nfs_mount
}
node 'peadm-04.pe' {
include profile::metrics_dashboard
include profile::tools::nfs_mount
}
node default {
if $trusted['extensions']['pp_role'] {

View File

@ -0,0 +1,11 @@
class profile::monitoring (
Boolean $docker_install = false,
Boolean $nfs_mount = false,
) {
if $docker_install {
class { '::profile::tools::docker_install': }
}
if $nfs_mount {
class { '::profile::tools::nfs_mount': }
}
}

View File

@ -1,7 +1,8 @@
class profile::puppetserver (
Boolean $puppetserver = true,
Boolean $authority = false,
Boolean $nfs_export = true,
Boolean $nfs_export = false,
Boolean $metrics_collect = false,
) {
if $puppetserver {
class { '::profile::puppetserver::bootstrap': }
@ -12,4 +13,8 @@ class profile::puppetserver (
if $nfs_export {
class { '::profile::puppetserver::nfs_export': }
}
if $metrics_collect {
include metrics_collector
fi
}
}

View File

@ -31,13 +31,4 @@ class profile::puppetserver::bootstrap {
group => 'pe-puppet',
mode => '0750',
}
# pe_node_group { 'puppetmaster-dashboard':
# ensure => 'present',
# classes => {'puppet_metrics_dashboard::profile::master::postgres_access' => { }},
# description => 'Puppetmaster Dashboard workaround group',
# environment => 'production',
# parent => 'All Nodes',
# rule => ['or', ['=', 'name', $facts['puppet_master_server']]],
# }
}

View File

@ -1,16 +1,23 @@
class profile::puppetserver::nfs_export (
$domain = $::domain,
$server_enabled = true,
$export_root = '/export',
$nfs_v4 = 'true',
$server_export = '/opt/puppetlabs/puppet-metrics-collector',
$export_mount = 'mounted',
) {
class { '::nfs':
server_enabled => true,
nfs_v4 => true,
nfs_v4_idmap_domain => 'peadm.01.pe',
nfs_v4_export_root => '/export',
server_enabled => $server_enabled,
nfs_v4 => $nfs_v4,
nfs_v4_idmap_domain => $domain,
nfs_v4_export_root => '$export_root',
nfs_v4_export_root_clients => '*(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)',
}
nfs::server::export { '/opt/puppetlabs/puppet-metrics-collector':
ensure => 'mounted',
nfs::server::export { $server_export:
ensure => $export_mount,
clients => '*(rw,insecure,async,no_root_squash,no_subtree_check)',
}
}

View File

@ -2,14 +2,16 @@ class profile::tools::docker_install (
$docker_version = '19.03',
$compose_version = '1.24',
) {
class { 'docker':
ensure => present,
version => '$docker_version',
}
yumrepo { 'docker':
ensure => 'present',
baseurl => 'https://download.docker.com/linux/centos/7/x86_64/stable',
descr => 'Docker',
gpgcheck => 'True',
gpgkey => 'https://download.docker.com/linux/centos/gpg',
}
class {'docker::compose':
ensure => present,
version => '$compose_version',
}
}

View File

@ -2,14 +2,14 @@ class profile::tools::nfs_mount (
$server = 'puppet',
) {
class { '::nfs':
server_enabled => false,
client_enabled => true,
nfs_v4_client => false,
nfs_v4_idmap_domain => $::domain,
}
server_enabled => false,
client_enabled => true,
nfs_v4_client => false,
nfs_v4_idmap_domain => $::domain,
}
nfs::client::mount { '/mnt/puppet-metrics-collector':
server => $server,
share => '/export/puppet-metrics-collector',
}
nfs::client::mount { '/mnt/puppet-metrics-collector':
server => $server,
share => '/export/puppet-metrics-collector',
}
}

View File

@ -0,0 +1,6 @@
class role::metrics {
include profile::base
include profile::tools::nfs_mount
include profile::tools::docker_install
}