diff --git a/debian/copyright b/debian/copyright index e256183f84e278e9cf4db1105f71c013c90ca9f8..cdf701668c724e94829156a3f93153ae34248c7c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -9,7 +9,7 @@ Copyright: (c) 2018-2021, Thomas Goirand (c) 2018, Alexandros Afentoulis (c) 2019-2021, Olivier Chaze (c) 2020, Erwan MAS - (c) 2021, Cyril Debourgues + (c) 2021, Cyril de Bourgues License: Apache-2 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/debian/puppet-module-oci.install b/debian/puppet-module-oci.install index 65329606cf529393da69baf71aa5c0ac5304ffda..8d963b525becfb42a25aaeb5f1478424999ed4b4 100644 --- a/debian/puppet-module-oci.install +++ b/debian/puppet-module-oci.install @@ -1,3 +1,4 @@ puppet/lib /usr/share/puppet/modules.available/oci puppet/manifests /usr/share/puppet/modules.available/oci puppet/templates /usr/share/puppet/modules.available/oci +puppet/files /usr/share/puppet/modules.available/oci diff --git a/puppet/files/rsyslog/00-timestamp.conf b/puppet/files/rsyslog/00-timestamp.conf new file mode 100644 index 0000000000000000000000000000000000000000..dc77dac9cc1db67d4f7755c529c9d7914a05ddd9 --- /dev/null +++ b/puppet/files/rsyslog/00-timestamp.conf @@ -0,0 +1 @@ +$ActionFileDefaultTemplate RSYSLOG_FileFormat diff --git a/puppet/manifests/filebeat.pp b/puppet/manifests/filebeat.pp index 9a27bc7cc2c7b85af5176f38be4c3932d44218ca..dfef9bce872c5f67403022e8bd35439a73e7de81 100644 --- a/puppet/manifests/filebeat.pp +++ b/puppet/manifests/filebeat.pp @@ -1,4 +1,5 @@ class oci::filebeat( + $cluster_name = undef, $machine_role = undef, $filebeat_enable = false, $filebeat_repo = undef, @@ -455,7 +456,7 @@ qPDlGRlOgVTd9xUfHFkzB52c70E= fields_under_root => true, paths => ['/var/log/swift/swift-proxy*.log*', '/var/log/swift/proxy*.log*'], fields => { backend => $machine_role, }, - tags => [ 'swift', 'swiftproxy', 'openstack', ], + tags => [ 'swift', 'proxy', 'openstack', 'syslog', $cluster_name, ], } }else{ file { '/etc/filebeat/conf.d/swiftproxy.yml': ensure => 'absent', notify => Service['filebeat'] } @@ -466,7 +467,7 @@ qPDlGRlOgVTd9xUfHFkzB52c70E= fields_under_root => true, paths => ['/var/log/swift/swift-account*.log*', '/var/log/swift/account*.log*'], fields => { backend => $machine_role, }, - tags => [ 'swift', 'swiftaccount', 'openstack', ], + tags => [ 'swift', 'account', 'openstack', 'syslog', $cluster_name, ], } }else{ file { '/etc/filebeat/conf.d/swiftaccount.yml': ensure => 'absent', notify => Service['filebeat'] } @@ -477,7 +478,7 @@ qPDlGRlOgVTd9xUfHFkzB52c70E= fields_under_root => true, paths => ['/var/log/swift/swift-container*.log*', '/var/log/swift/container*.log*'], fields => { backend => $machine_role, }, - tags => [ 'swift', 'swiftcontainer', 'openstack', ], + tags => [ 'swift', 'container', 'openstack', 'syslog', $cluster_name, ], } }else{ file { '/etc/filebeat/conf.d/swiftcontainer.yml': ensure => 'absent', notify => Service['filebeat'] } @@ -488,7 +489,7 @@ qPDlGRlOgVTd9xUfHFkzB52c70E= fields_under_root => true, paths => [ '/var/log/swift/object*.log*' ], fields => { backend => $machine_role, }, - tags => [ 'swift', 'swiftobject', 'openstack', ], + tags => [ 'swift', 'object', 'openstack', 'syslog', $cluster_name, ], } }else{ file { '/etc/filebeat/conf.d/swiftobject.yml': ensure => 'absent', notify => Service['filebeat'] } diff --git a/puppet/manifests/generic.pp b/puppet/manifests/generic.pp index c0798f0a6df06537ed09fd7e64254675e6e0b7b1..d9be9b99a2ed3a1d84a0868d2219faa1b30345d5 100644 --- a/puppet/manifests/generic.pp +++ b/puppet/manifests/generic.pp @@ -13,6 +13,26 @@ class oci::generic( # Generic sysctl options ::oci::sysctl { 'oci-rox': } + package { 'rsyslog': + ensure => present, + } + service { 'rsyslog': + ensure => running, + enable => true, + require => Package['rsyslog'], + } + + file { '/etc/rsyslog.d/00-timestamp.conf': + ensure => present, + source => 'puppet:///modules/oci/rsyslog/00-timestamp.conf', + path => '/etc/rsyslog.d/00-timestamp.conf', + group => 'root', + owner => 'root', + mode => '0644', + require => [Package['rsyslog']], + notify => Service['rsyslog'], + } + # Populate /etc/hosts class { '::oci::etchosts': etc_hosts_file => $etc_hosts, diff --git a/puppet/manifests/swiftproxy.pp b/puppet/manifests/swiftproxy.pp index 1174b20d91983b1855bbd4d8b0123c2ec39d3a2b..88d02bc8f2afea6472a92d7b748353b30615dc8f 100644 --- a/puppet/manifests/swiftproxy.pp +++ b/puppet/manifests/swiftproxy.pp @@ -110,18 +110,11 @@ class oci::swiftproxy( } } - package { 'rsyslog': - ensure => present, - } - service { 'rsyslog': - ensure => running, - enable => true, - require => Package['rsyslog'], - } - file { '/var/log/swift': ensure => directory, mode => '0750', + owner => 'swift', + group => 'adm' } file { "/etc/systemd/system/local-fs.target.d": @@ -145,11 +138,6 @@ OnFailure= selinux_ignore_defaults => true, } - File<| title == '/var/log/swift' |> { - owner => 'swift', - group => 'adm' - } - # Get memcached class { '::memcached': listen_ip => "0.0.0.0", @@ -548,7 +536,7 @@ OnFailure= include ::swift::proxy::copy include ::swift::proxy::container_quotas include ::swift::proxy::account_quotas - class { '::swift::proxy::slo': + class { '::swift::proxy::slo': max_manifest_segments => '10000', } include ::swift::proxy::dlo diff --git a/puppet/manifests/swiftstore.pp b/puppet/manifests/swiftstore.pp index 2f7650db4c875e08e76a80eabcac77959c9f715d..e0b87e626a1f355af1109ec9faee10345bf37974 100644 --- a/puppet/manifests/swiftstore.pp +++ b/puppet/manifests/swiftstore.pp @@ -41,19 +41,11 @@ class oci::swiftstore( self_signed_api_cert => $self_signed_api_cert, } - # rsyslog correctly - package { 'rsyslog': - ensure => present, - } - service { 'rsyslog': - ensure => running, - enable => true, - require => Package['rsyslog'], - } - file { '/var/log/swift': ensure => directory, mode => '0750', + owner => 'swift', + group => 'adm' } file { "/etc/systemd/system/local-fs.target.d": @@ -77,18 +69,6 @@ OnFailure= selinux_ignore_defaults => true, } - file { '/etc/rsyslog.d/10-swift.conf': - ensure => present, - source => "puppet:///modules/${module_name}/rsyslog-swift.conf", - require => [Package['rsyslog'], File['/var/log/swift']], - notify => Service['rsyslog'], - } - - File<| title == '/var/log/swift' |> { - owner => 'swift', - group => 'adm' - } - # Install memcache class { '::memcached': listen_ip => '127.0.0.1', diff --git a/src/inc/enc.php b/src/inc/enc.php index e19091940166c970b8657a9acb7acfb45400cb9d..b03acead6886816f9fe314c4884dbcb57fea05f3 100644 --- a/src/inc/enc.php +++ b/src/inc/enc.php @@ -887,6 +887,7 @@ function puppet_enc($con,$conf){ ### Filebeat logging ### ######################## $enc_file .= " oci::filebeat:\n"; + $enc_file .= " cluster_name: ".$cluster_name."\n"; $enc_file .= " machine_role: ".$machine["role"]."\n"; $enc_file .= " filebeat_repo: ".$conf["filebeat"]["filebeat_repo"]."\n";