Readme
- - -[[TOC]]
+ +- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
Synopsis
Grafana Alloy is a log management agent built by Grafana labs to scrape and forward logs to Loki, a log management system also built by Grafana labs. Then you can use Grafana itself to visualize those logs and built an alerting system.
-alloy_cd is a Puppet module to automate installation and configuration of alloy.
confdroid_alloy is a Puppet module to automate installation and configuration of alloy.
WARNING
@@ -106,7 +131,7 @@via site.pp or nodes.pp
node 'example.example.net' {
- include cd_kubernetes
+ include confdroid_alloy
}
-
@@ -127,13 +152,18 @@
-
OS: Rocky 9
-
-
Puppet 6,8
+Puppet 8
Tests
-
Puppet Lint
-
+
excluded tests:
+-
+
+--no-variable_scope-check: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
-
+
-
Puppet Parser
-
ERB Template Parser
@@ -142,8 +172,11 @@
Contact Us
- +Disclaimer
diff --git a/doc/index.html b/doc/index.html index a609058..eb87bcf 100644 --- a/doc/index.html +++ b/doc/index.html @@ -60,15 +60,40 @@Readme
- - -[[TOC]]
+ +- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
- + +
Synopsis
Grafana Alloy is a log management agent built by Grafana labs to scrape and forward logs to Loki, a log management system also built by Grafana labs. Then you can use Grafana itself to visualize those logs and built an alerting system.
-
+alloy_cdis a Puppet module to automate installation and configuration of alloy.confdroid_alloyis a Puppet module to automate installation and configuration of alloy.WARNING
@@ -106,7 +131,7 @@via site.pp or nodes.pp
node 'example.example.net' { - include cd_kubernetes + include confdroid_alloy }-
@@ -127,13 +152,18 @@
-
OS: Rocky 9
-
-
Puppet 6,8
+Puppet 8
Tests
-
Puppet Lint
-
+
excluded tests:
+-
+
+--no-variable_scope-check: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
-
+
-
Puppet Parser
-
ERB Template Parser
@@ -142,8 +172,11 @@
Contact Us
- +Disclaimer
diff --git a/doc/puppet_class_list.html b/doc/puppet_class_list.html index 0a74441..eef7b80 100644 --- a/doc/puppet_class_list.html +++ b/doc/puppet_class_list.html @@ -36,58 +36,58 @@-
-
- +
- -
- +
- -
- +
- -
- +
- -
- +
- -
- +
- -
- +
- -
- +
- diff --git a/doc/puppet_classes/confdroid_alloy.html b/doc/puppet_classes/confdroid_alloy.html new file mode 100644 index 0000000..cb00451 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy.html @@ -0,0 +1,121 @@ + + + + + +
- Defined in: +
- + manifests/init.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/config.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/dirs.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/files.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/install.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/service.pp + +
- Inherits: +
- confdroid_alloy::params +
- Defined in: +
- + manifests/main/yumrepo.pp + +
- Inherited by: +
-
+
+ confdroid_alloy::main::dirs
+ + confdroid_alloy::main::files
+ + confdroid_alloy::main::config
+ + confdroid_alloy::main::install
+ + confdroid_alloy::main::service
+ + confdroid_alloy::main::yumrepo
+ +
+ - Defined in: +
- + manifests/params.pp + +
+ Puppet Class: confdroid_alloy + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aconfig.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aconfig.html new file mode 100644 index 0000000..661f929 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aconfig.html @@ -0,0 +1,130 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy
++ + ++ +-
+
Summary
+ Class initializes the confdroid_alloy module. + +Overview
+++ + + ++ ++confdroid_alloy::init.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8
++ +# File 'manifests/init.pp', line 6 + +class confdroid_alloy { + include confdroid_alloy::params +}++ Puppet Class: confdroid_alloy::main::config + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Adirs.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Adirs.html new file mode 100644 index 0000000..47e1080 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Adirs.html @@ -0,0 +1,154 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::config
++ ++ +-
+
-
+
Summary
+ Class manages module logic for the confdroid_alloy module + +Overview
+++ + + ++ ++confdroid_alloy::main::config.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8 +9 +10
++ +# File 'manifests/main/config.pp', line 6 + +class confdroid_alloy::main::config ( + +) inherits confdroid_alloy::params { + include confdroid_alloy::main::service +}++ Puppet Class: confdroid_alloy::main::dirs + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Afiles.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Afiles.html new file mode 100644 index 0000000..2b78b30 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Afiles.html @@ -0,0 +1,222 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::dirs
++ ++ +-
+
-
+
Summary
+ Class manages required directories for the confdroid_alloy module + +Overview
+++ + + ++ ++confdroid_alloy::main::dirs.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22
++ +# File 'manifests/main/dirs.pp', line 6 + +class confdroid_alloy::main::dirs ( + +) inherits confdroid_alloy::params { + require confdroid_alloy::main::install + + # main config dir + file { $ay_main_dir: + ensure => directory, + owner => 'root', + group => 'alloy', + mode => '0770', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + } +}++ Puppet Class: confdroid_alloy::main::files + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ainstall.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ainstall.html new file mode 100644 index 0000000..a4d1f7c --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ainstall.html @@ -0,0 +1,138 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::files
++ ++ +-
+
-
+
Summary
+ Class manages required config files for the confdroid_alloy module + +Overview
+++ + + ++ ++confdroid_alloy::main::files.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +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
++ +# File 'manifests/main/files.pp', line 6 + +class confdroid_alloy::main::files ( + +) inherits confdroid_alloy::params { + require confdroid_alloy::main::dirs + + # Ensure log_targets is always an array + $log_targets_array = Array($confdroid_alloy::params::ay_log_targets, true) + + file { $ay_main_file: + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template('confdroid_alloy/config.alloy.erb'), + notify => Service[$ay_service], + } + + # manage logrotate for rsyslog to allow adm group membership + file { '/etc/logrotate.d/rsyslog': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template('confdroid_alloy/logrotate.rsyslog.erb'), + } + + # manage log file group permissions + file { '/var/log/messages': + ensure => file, + owner => 'root', + group => 'adm', + mode => '0640', + notify => Service[$ay_service], + } + + file { '/var/log/secure': + ensure => file, + owner => 'root', + group => 'adm', + mode => '0640', + notify => Service[$ay_service], + } +}++ Puppet Class: confdroid_alloy::main::install + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aservice.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aservice.html new file mode 100644 index 0000000..8ca8682 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Aservice.html @@ -0,0 +1,144 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::install
++ ++ +-
+
-
+
Summary
+ Class installs packages for the confdroid_alloy module + +Overview
+++ + + ++ ++confdroid_alloy::main::install.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8 +9 +10 +11 +12 +13 +14
++ +# File 'manifests/main/install.pp', line 6 + +class confdroid_alloy::main::install ( + +) inherits confdroid_alloy::params { + require confdroid_alloy::main::yumrepo + + package { $ay_reqpackages: + ensure => $ay_pkg_ensure, + } +}++ Puppet Class: confdroid_alloy::main::service + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ayumrepo.html b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ayumrepo.html new file mode 100644 index 0000000..e946ed7 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Amain_3A_3Ayumrepo.html @@ -0,0 +1,150 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::service
++ ++ +-
+
-
+
Summary
+ Class manages the alloy service + +Overview
+++ + + ++ ++confdroid_alloy::main::service.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17
++ +# File 'manifests/main/service.pp', line 6 + +class confdroid_alloy::main::service ( + +) inherits confdroid_alloy::params { + require confdroid_alloy::main::files + + service { $ay_service: + ensure => running, + hasstatus => true, + hasrestart => true, + enable => true, + } +}++ Puppet Class: confdroid_alloy::main::yumrepo + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file diff --git a/doc/puppet_classes/confdroid_alloy_3A_3Aparams.html b/doc/puppet_classes/confdroid_alloy_3A_3Aparams.html new file mode 100644 index 0000000..60f9ae3 --- /dev/null +++ b/doc/puppet_classes/confdroid_alloy_3A_3Aparams.html @@ -0,0 +1,382 @@ + + + + + ++ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::main::yumrepo
++ ++ +-
+
-
+
Summary
+ class install yum repos for the confdroid_alloy module + +Overview
+++ + + ++ ++confdroid_alloy::main::yumrepo.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20
++ +# File 'manifests/main/yumrepo.pp', line 6 + +class confdroid_alloy::main::yumrepo ( + +) inherits confdroid_alloy::params { + # test + yumrepo { 'grafana': + ensure => 'present', + name => 'grafana', + descr => 'grafana', + baseurl => 'https://packages.grafana.com/oss/rpm', + gpgkey => 'https://packages.grafana.com/gpg.key', + enabled => '1', + gpgcheck => '1', + target => '/etc/yum.repo.d/grafana.repo', + } +}++ Puppet Class: confdroid_alloy::params + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +++ + \ No newline at end of file+ + ++ ++ + + + + + ++ ++ + + +Puppet Class: confdroid_alloy::params
++ + ++ +-
+
-
+
Summary
+ Class contains all parameters for the confdroid_alloy module. + +Overview
+++ + + ++ ++confdroid_alloy::params.pp Module name: confdroid_alloy Author: 12ww1160 (12ww1160@confdroid.com)
+ ++++
++ ++ ++ + +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
++ +# File 'manifests/params.pp', line 17 + +class confdroid_alloy::params ( + + String $ay_reqpackages = 'alloy', + String $ay_pkg_ensure = 'latest', + +# loki + Boolean $ay_manage_loki = true, + String $ay_loki_url = 'https://loki.example.net/loki/api/v1/push', + String $ay_loki_username = 'loki_user', + String $ay_loki_userpass = 'loki_pass', + Array $ay_log_targets = ['/var/log/messages','/var/log/secure',], + +# prometheus + Boolean $ay_manage_prom = true, + String $ay_prom_url = 'https://prometheus.example.net/api/v1/write', + +# node exporter (external) + Boolean $ay_manage_ne = false, + +) { + # service + $ay_service = 'alloy' + + # dirs + $ay_main_dir = '/etc/alloy' + + # files + $ay_main_file = "${ay_main_dir}/config.alloy" + + # includes must be last + include confdroid_alloy::main::config +}+ -
-