From f211dbc58179dff5f3301eee821a258462f4e980 Mon Sep 17 00:00:00 2001 From: Mickey Nasriachi Date: Sun, 22 Apr 2018 09:23:19 +0200 Subject: [PATCH 001/147] Added a cronjob for cover data filling This cron will run daily for now (takes about an hour for the full data set), until we set a system for smaller incremental data sets on the cpancover end. --- hieradata/common.yaml | 5 +++++ hieradata/nodes/lw-mc-03.yaml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8791154b..b25c6906 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -422,6 +422,11 @@ metacpan::crons::api: minute: 0 weekday: 0 ensure : absent + cover_full: + cmd : 'cover' + hour: 14 + minute: 0 + ensure : absent metacpan::fw_ports: http: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 77c2dafe..bf5e387d 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -79,3 +79,5 @@ metacpan::crons::api: ensure : present favorite_weekly: ensure : present + cover_full: + ensure : present From 790f548309e0975fc2ccf29db11e0bc0bab24bd1 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 17 May 2018 20:02:48 +0100 Subject: [PATCH 002/147] allow atoomic sudo access for grep site --- hieradata/nodes/bm-mc-02.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index 9831c6a3..ce618849 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -2,6 +2,7 @@ metacpan::users: toddr: + admin: true fullname : "Todd " atoomic: fullname : "Atoomic " From bf1eba04458d6cb5cfaafdb941589b6a2e3cdcf8 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 17 May 2018 21:20:46 +0100 Subject: [PATCH 003/147] make sure to PIN Elasticsearch and Logstash so no accidental upgrades --- modules/metacpan/manifests/logstash.pp | 6 ++++++ modules/metacpan_elasticsearch/manifests/init.pp | 8 ++++++++ modules/metacpan_elasticsearch/manifests/instance.pp | 2 +- modules/metacpan_elasticsearch/manifests/test_instance.pp | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/metacpan/manifests/logstash.pp b/modules/metacpan/manifests/logstash.pp index 20fb1d41..539a95bb 100644 --- a/modules/metacpan/manifests/logstash.pp +++ b/modules/metacpan/manifests/logstash.pp @@ -3,6 +3,12 @@ $status = hiera('metacpan::logstash::status'), ) { + apt::pin { 'logstash': + version => '1.4.2-1-2c0f5a1', + priority => 1001, + packages => 'logstash' + } + class { '::logstash': status => $status, package_url => 'https://download.elasticsearch.org/logstash/logstash/packages/debian/logstash_1.4.2-1-2c0f5a1_all.deb', diff --git a/modules/metacpan_elasticsearch/manifests/init.pp b/modules/metacpan_elasticsearch/manifests/init.pp index 39ade530..e601c77e 100644 --- a/modules/metacpan_elasticsearch/manifests/init.pp +++ b/modules/metacpan_elasticsearch/manifests/init.pp @@ -1,4 +1,5 @@ class metacpan_elasticsearch( + $version = hiera('metacpan::elasticsearch::version'), ) { include metacpan_elasticsearch::curator @@ -8,4 +9,11 @@ $script = hiera_hash('metacpan::elasticsearch::scripts', {}) create_resources('metacpan_elasticsearch::script', $script) + # Do not let apt upgrade us by mistake + apt::pin { 'elasticsearch': + version => $version, + priority => 1001, + packages => 'elasticsearch' + } + } diff --git a/modules/metacpan_elasticsearch/manifests/instance.pp b/modules/metacpan_elasticsearch/manifests/instance.pp index 407b7b3a..da3b6bef 100644 --- a/modules/metacpan_elasticsearch/manifests/instance.pp +++ b/modules/metacpan_elasticsearch/manifests/instance.pp @@ -1,6 +1,6 @@ class metacpan_elasticsearch::instance( $version = hiera('metacpan::elasticsearch::version'), - $autoupgrade = hiera('metacpan::elasticsearch::autoupgrade', true), + $autoupgrade = hiera('metacpan::elasticsearch::autoupgrade', false), $ensure = hiera('metacpan::elasticsearch::ensure', 'present'), $memory = hiera('metacpan::elasticsearch::memory', '64'), $ip_address = hiera('metacpan::elasticsearch::ipaddress', '127.0.0.1'), diff --git a/modules/metacpan_elasticsearch/manifests/test_instance.pp b/modules/metacpan_elasticsearch/manifests/test_instance.pp index f21acdd2..3febbea5 100644 --- a/modules/metacpan_elasticsearch/manifests/test_instance.pp +++ b/modules/metacpan_elasticsearch/manifests/test_instance.pp @@ -5,7 +5,7 @@ $ip_address = hiera('metacpan::elasticsearch::ipaddress', '127.0.0.1'), $data_dir = hiera('metacpan::elasticsearch::test_datadir', '/var/elasticsearch_test'), $version = hiera('metacpan::elasticsearch::version'), - $autoupgrade = hiera('metacpan::elasticsearch::autoupgrade', true), + $autoupgrade = hiera('metacpan::elasticsearch::autoupgrade', false), ) { $cluster_hosts = hiera_array('metacpan::elasticsearch::cluster_hosts', []) From ddc1bd9e403001fa7c3f53d72239ce89486a4b42 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 17 May 2018 21:24:50 +0100 Subject: [PATCH 004/147] install apt-transport-https for es repo --- modules/metacpan/manifests/system/packages.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index 3264ece2..b178020c 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -16,6 +16,7 @@ package { psmisc: ensure => present } # killall pstree fuser commands package { rsync: ensure => present } package { screen: ensure => present } + package { apt-transport-https: ensure => present } # for ES repo # for monitoring # https://debian-administration.org/article/327/Monitoring_your_hardware's_temperature From 07c29a02958c3d28e71eba2ae3908eac657cfd5c Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 19:53:56 +0100 Subject: [PATCH 005/147] pin kibana version --- modules/metacpan_kibana/manifests/init.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/metacpan_kibana/manifests/init.pp b/modules/metacpan_kibana/manifests/init.pp index 43f43ecb..9094579b 100644 --- a/modules/metacpan_kibana/manifests/init.pp +++ b/modules/metacpan_kibana/manifests/init.pp @@ -2,6 +2,15 @@ include metacpan_kibana::package + apt::pin { 'kibana': + version => '4.6.3', + priority => 1001, + packages => 'kibana' + } + + + Unpacking kibana (6.2.4) over (4.6.3) ... + service { "kibana": ensure => 'running', require => Exec['kibana_deb_install'], From c6572df6c297ab4ddb25ddcaa09894acb525e585 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 20:09:04 +0100 Subject: [PATCH 006/147] silly copy/paste --- modules/metacpan_kibana/manifests/init.pp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/metacpan_kibana/manifests/init.pp b/modules/metacpan_kibana/manifests/init.pp index 9094579b..ee7e9bc8 100644 --- a/modules/metacpan_kibana/manifests/init.pp +++ b/modules/metacpan_kibana/manifests/init.pp @@ -2,14 +2,11 @@ include metacpan_kibana::package - apt::pin { 'kibana': - version => '4.6.3', - priority => 1001, - packages => 'kibana' - } - - - Unpacking kibana (6.2.4) over (4.6.3) ... + apt::pin { 'kibana': + version => '4.6.3', + priority => 1001, + packages => 'kibana' + } service { "kibana": ensure => 'running', From 04cec6ad26591d9e1cb2fd465fec90f4e418e9de Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 20:57:53 +0100 Subject: [PATCH 007/147] start setting up BM boxes to be production --- hieradata/nodes/bm-mc-01.yaml | 10 ++++++++++ hieradata/nodes/bm-mc-02.yaml | 8 ++++++++ hieradata/nodes/bm-mc-03.yaml | 11 +++++++++-- hieradata/nodes/lw-mc-03.yaml | 1 - 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index ed97d539..6b498cd5 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -1 +1,11 @@ --- +classes: + - metacpan_postgres + - minion_queue + +minion_queue::service::workers: 5 +minion_queue::service::ensure: running +minion_queue::service::enable: true + +# We want watcher enabled +# metacpan::watcher::enable: true \ No newline at end of file diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index ce618849..aafd81d9 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -1,4 +1,12 @@ --- +classes: + - metacpan_postgres::install_only + - metacpan_postgres::pgpass + - minion_queue + +minion_queue::service::workers: 10 +minion_queue::service::ensure: running +minion_queue::service::enable: true metacpan::users: toddr: diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index c6ab5326..1cd9b1fd 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -1,7 +1,14 @@ --- classes: - - metacpan::system::rsyslog::server - - metacpan_kibana + - metacpan::system::rsyslog::server + - metacpan_kibana + - metacpan_postgres::install_only + - metacpan_postgres::pgpass + - minion_queue + +minion_queue::service::workers: 10 +minion_queue::service::ensure: running +minion_queue::service::enable: true metacpan::fw_ports: rsyslog: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 77c2dafe..820ed0c7 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -1,5 +1,4 @@ --- -# Using this box as a stage box classes: - metacpan_postgres - minion_queue From b9ce5940a79a28f42e779da11599c82e049f039d Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 22:07:39 +0100 Subject: [PATCH 008/147] allow local access via nginx --- hieradata/common.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8791154b..c465d532 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -443,6 +443,8 @@ nginx::allowed: - 172.16.0.0/12 - 192.168.0.0/16 - 127.0.0.1/32 + # local machine's IP + - %{ipaddress}/32 # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 From e0d6a08dcd2ab1dcc302747958c5392f12130d57 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 22:09:16 +0100 Subject: [PATCH 009/147] quote to get string value --- hieradata/common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index c465d532..497c81d3 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -444,7 +444,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - %{ipaddress}/32 + - "%{ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 From aa4acc89dadfc53733604fbcdbcf4bd94e56d3a9 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 22:16:51 +0100 Subject: [PATCH 010/147] install backport access --- modules/metacpan/manifests/system.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/metacpan/manifests/system.pp b/modules/metacpan/manifests/system.pp index cf0d818b..c61fcfb0 100644 --- a/modules/metacpan/manifests/system.pp +++ b/modules/metacpan/manifests/system.pp @@ -3,6 +3,11 @@ include apt + class { 'apt::backports': + # This is lower than the normal default of 500, so packages with ensure => latest don't get upgraded from backports without your explicit permission. + pin => 200, + } + # Set all servers to London timezone class { 'timezone': region => 'Europe', From c95cd4a6be0402d0022fd05a16a992fdbf0162c1 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 19 May 2018 22:20:41 +0100 Subject: [PATCH 011/147] now backports is there, use latest tmux --- modules/metacpan/manifests/system/packages.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index b178020c..ecf06698 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -38,7 +38,7 @@ package { sqlite3: ensure => present } package { sudo: ensure => present } package { sysstat: ensure => present } - package { tmux: ensure => present } + package { tmux: ensure => '2.7-1~bpo9+1' } # back ports package { tree: ensure => present } package { whois: ensure => present } From f8ee93f873688c3435143c61fed4b0ede0e9fda6 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Wed, 30 May 2018 21:42:41 +0100 Subject: [PATCH 012/147] enable the sitemaps! --- hieradata/common.yaml | 2 +- hieradata/env/production.yaml | 2 ++ hieradata/nodes/bm-mc-01.yaml | 6 +++++- hieradata/nodes/bm-mc-02.yaml | 5 +++++ hieradata/nodes/bm-mc-03.yaml | 4 ++++ hieradata/nodes/lw-mc-01.yaml | 3 +++ hieradata/nodes/lw-mc-02.yaml | 3 +++ hieradata/nodes/lw-mc-03.yaml | 3 ++- 8 files changed, 25 insertions(+), 3 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 497c81d3..9836f1a9 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -263,7 +263,7 @@ metacpan::crons::general: metacpan_sitemaps: cmd : "/home/%{hiera('metacpan::user')}/bin/metacpan-web-carton-exec bin/generate_sitemap.pl" hour : 2 - minute : 30 + minute : 0 ensure : absent github-meets-cpan: diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 1387c0ae..299175dd 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -26,6 +26,8 @@ metacpan::crons::general: ensure : present run_puppet: ensure : present + metacpan_sitemaps: + ensure : present metacpan::web::starman: api-v0-shim: diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 6b498cd5..0e7c6df4 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -8,4 +8,8 @@ minion_queue::service::ensure: running minion_queue::service::enable: true # We want watcher enabled -# metacpan::watcher::enable: true \ No newline at end of file +# metacpan::watcher::enable: true + +metacpan::crons::general: + metacpan_sitemaps: + minute : 5 diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index aafd81d9..8c2a6f03 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -15,6 +15,11 @@ metacpan::users: atoomic: fullname : "Atoomic " +metacpan::crons::general: + metacpan_sitemaps: + minute : 10 + + metacpan::web::starman: metacpan-grep-front-end: diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 1cd9b1fd..43f877c2 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -18,3 +18,7 @@ metacpan::fw_ports: rsyslog::extra_modules: - "omprog" + +metacpan::crons::general: + metacpan_sitemaps: + minute : 15 diff --git a/hieradata/nodes/lw-mc-01.yaml b/hieradata/nodes/lw-mc-01.yaml index 2c9bdce1..87f89b42 100644 --- a/hieradata/nodes/lw-mc-01.yaml +++ b/hieradata/nodes/lw-mc-01.yaml @@ -11,3 +11,6 @@ minion_queue::service::workers: 10 minion_queue::service::ensure: running minion_queue::service::enable: true +metacpan::crons::general: + metacpan_sitemaps: + minute : 20 diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index ffb8ce16..c9cef64e 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -13,3 +13,6 @@ metacpan::crons::general: github-meets-cpan: ensure : present +metacpan::crons::general: + metacpan_sitemaps: + minute : 25 diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 820ed0c7..aab8ab0c 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -22,7 +22,6 @@ munin::node::plugins: ensure: 'link' config: ['user metacpan'] -# Run the swat cronjob metacpan::crons::general: swat_monitoring: ensure : present @@ -30,6 +29,8 @@ metacpan::crons::general: ensure : present import_authors: ensure : present + metacpan_sitemaps: + minute : 30 metacpan::crons::api: snapshot_cpan_index: From a8d0d1c614bd68d7c8b6d7cefb7481d24d5fa252 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 25 May 2018 14:23:58 -0400 Subject: [PATCH 013/147] Ensure vagrant users aren't locked out after provisioning --- modules/metacpan/files/default/etc/ssh/sshd_config | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/metacpan/files/default/etc/ssh/sshd_config b/modules/metacpan/files/default/etc/ssh/sshd_config index df793fe3..7fda166a 100644 --- a/modules/metacpan/files/default/etc/ssh/sshd_config +++ b/modules/metacpan/files/default/etc/ssh/sshd_config @@ -87,6 +87,8 @@ Subsystem sftp /usr/lib/openssh/sftp-server # and ChallengeResponseAuthentication to 'no'. UsePAM yes -# Only members of the shell access are allowed to attempt authentication. -AllowGroups shellaccess +# Only members of the shellaccess and vagrant groups are allowed to attempt +# authentication. +AllowGroups shellaccess vagrant + # When AllowGroups is stated, a default DENY policy is applied. From ada53c1eb1f0f0e41bce8aaf0e2abd8ebb27f701 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 1 Jun 2018 12:12:07 -0400 Subject: [PATCH 014/147] Revert back to our own nodejs module --- bin/install-modules.sh | 1 - contrib-modules/nodejs/CHANGELOG.md | 59 ---- contrib-modules/nodejs/Gemfile | 13 - contrib-modules/nodejs/Gemfile-Nix.lock | 85 ----- contrib-modules/nodejs/LICENSE | 19 -- contrib-modules/nodejs/README.md | 313 ------------------ contrib-modules/nodejs/Rakefile | 25 -- contrib-modules/nodejs/checksums.json | 40 --- contrib-modules/nodejs/default.nix | 10 - contrib-modules/nodejs/env.nix | 27 -- contrib-modules/nodejs/gemset.nix | 266 --------------- .../lib/facter/nodejs_installed_version.rb | 5 - .../parser/functions/evaluate_version.rb | 22 -- .../puppet/parser/functions/node_instances.rb | 21 -- .../parser/functions/util/nodejs_functions.rb | 86 ----- .../functions/validate_nodejs_version.rb | 10 - .../nodejs/lib/puppet/provider/package/npm.rb | 80 ----- contrib-modules/nodejs/manifests/init.pp | 92 ----- contrib-modules/nodejs/manifests/instance.pp | 174 ---------- .../nodejs/manifests/instance/download.pp | 45 --- .../nodejs/manifests/instance/pkgs.pp | 29 -- contrib-modules/nodejs/manifests/instances.pp | 94 ------ contrib-modules/nodejs/manifests/npm.pp | 88 ----- contrib-modules/nodejs/manifests/npm/file.pp | 38 --- .../nodejs/manifests/npm/package.pp | 73 ---- contrib-modules/nodejs/manifests/params.pp | 27 -- contrib-modules/nodejs/metadata.json | 56 ---- .../spec/classes/nodejs_instance_pkgs_spec.rb | 25 -- .../spec/classes/nodejs_instances_spec.rb | 157 --------- .../nodejs/spec/classes/nodejs_spec.rb | 66 ---- .../defines/nodejs_instance_download_spec.rb | 30 -- .../spec/defines/nodejs_instance_spec.rb | 307 ----------------- .../nodejs/spec/defines/nodejs_npm_spec.rb | 93 ------ .../spec/functions/evaluate_version_spec.rb | 12 - .../spec/functions/node_instances_spec.rb | 30 -- .../spec/functions/validate_nodejs_version.rb | 15 - contrib-modules/nodejs/spec/spec_helper.rb | 32 -- .../nodejs/templates/nodejs.sh.erb | 4 - contrib-modules/nodejs/templates/npm.sh.erb | 4 - contrib-modules/nodejs/templates/npmrc | 1 - modules/metacpan/manifests/system/packages.pp | 20 +- modules/nodejs/manifests/init.pp | 11 + modules/npm/manifests/init.pp | 13 + modules/npm/manifests/install.pp | 19 ++ 44 files changed, 51 insertions(+), 2586 deletions(-) delete mode 100644 contrib-modules/nodejs/CHANGELOG.md delete mode 100644 contrib-modules/nodejs/Gemfile delete mode 100644 contrib-modules/nodejs/Gemfile-Nix.lock delete mode 100644 contrib-modules/nodejs/LICENSE delete mode 100644 contrib-modules/nodejs/README.md delete mode 100644 contrib-modules/nodejs/Rakefile delete mode 100644 contrib-modules/nodejs/checksums.json delete mode 100644 contrib-modules/nodejs/default.nix delete mode 100644 contrib-modules/nodejs/env.nix delete mode 100644 contrib-modules/nodejs/gemset.nix delete mode 100644 contrib-modules/nodejs/lib/facter/nodejs_installed_version.rb delete mode 100644 contrib-modules/nodejs/lib/puppet/parser/functions/evaluate_version.rb delete mode 100644 contrib-modules/nodejs/lib/puppet/parser/functions/node_instances.rb delete mode 100644 contrib-modules/nodejs/lib/puppet/parser/functions/util/nodejs_functions.rb delete mode 100644 contrib-modules/nodejs/lib/puppet/parser/functions/validate_nodejs_version.rb delete mode 100644 contrib-modules/nodejs/lib/puppet/provider/package/npm.rb delete mode 100644 contrib-modules/nodejs/manifests/init.pp delete mode 100644 contrib-modules/nodejs/manifests/instance.pp delete mode 100644 contrib-modules/nodejs/manifests/instance/download.pp delete mode 100644 contrib-modules/nodejs/manifests/instance/pkgs.pp delete mode 100644 contrib-modules/nodejs/manifests/instances.pp delete mode 100644 contrib-modules/nodejs/manifests/npm.pp delete mode 100644 contrib-modules/nodejs/manifests/npm/file.pp delete mode 100644 contrib-modules/nodejs/manifests/npm/package.pp delete mode 100644 contrib-modules/nodejs/manifests/params.pp delete mode 100644 contrib-modules/nodejs/metadata.json delete mode 100644 contrib-modules/nodejs/spec/classes/nodejs_instance_pkgs_spec.rb delete mode 100644 contrib-modules/nodejs/spec/classes/nodejs_instances_spec.rb delete mode 100644 contrib-modules/nodejs/spec/classes/nodejs_spec.rb delete mode 100644 contrib-modules/nodejs/spec/defines/nodejs_instance_download_spec.rb delete mode 100644 contrib-modules/nodejs/spec/defines/nodejs_instance_spec.rb delete mode 100644 contrib-modules/nodejs/spec/defines/nodejs_npm_spec.rb delete mode 100644 contrib-modules/nodejs/spec/functions/evaluate_version_spec.rb delete mode 100644 contrib-modules/nodejs/spec/functions/node_instances_spec.rb delete mode 100644 contrib-modules/nodejs/spec/functions/validate_nodejs_version.rb delete mode 100644 contrib-modules/nodejs/spec/spec_helper.rb delete mode 100644 contrib-modules/nodejs/templates/nodejs.sh.erb delete mode 100644 contrib-modules/nodejs/templates/npm.sh.erb delete mode 100644 contrib-modules/nodejs/templates/npmrc create mode 100644 modules/nodejs/manifests/init.pp create mode 100644 modules/npm/manifests/init.pp create mode 100644 modules/npm/manifests/install.pp diff --git a/bin/install-modules.sh b/bin/install-modules.sh index 230f8a66..8c8648c6 100755 --- a/bin/install-modules.sh +++ b/bin/install-modules.sh @@ -23,4 +23,3 @@ $PUPPET saz-rsyslog $PUPPET bashtoni-timezone $PUPPET puppet-logrotate $PUPPET puppet-yum -$PUPPET willdurand/nodejs diff --git a/contrib-modules/nodejs/CHANGELOG.md b/contrib-modules/nodejs/CHANGELOG.md deleted file mode 100644 index 96c64cb0..00000000 --- a/contrib-modules/nodejs/CHANGELOG.md +++ /dev/null @@ -1,59 +0,0 @@ -# 2.0.0 - -## Version/Requirement changes - -- dropped support for Node.js versions until `v0.12.0` -- dropped support for all Puppet versions below `v3.4` -- dropped support for all ruby versions below `v2.1` - -## Code changes - -### Minor changes - -- removed the `::nodejs_latest_version` and `::nodejs_stable_version` fact and replaced them with a puppet function to avoid evaluations on each node - -- removed `with_npm` parameter (only used for Node.js 0.6 and below) - -- fixed bug [#94](https://github.com/willdurand/puppet-nodejs/issues/94) - -- added `cpu_cores` option to speedup the compilation process - -- changed all downloads from `http` to `https` - -- remove installation of `git` package. - -- added support for ARM architecture (`armv6l` and `armv7l`). - -- added `download_timeout` parameter to simplify configuration of package download timeouts. - -- dropped `profile.d` script to patch NodeJS paths. Target directory will be set with `nodejs::$target_dir` which should be in `$PATH`. - See [bcfdda3341aa8b0d885b40e9a6ab7f90859f9f3e](https://github.com/willdurand/puppet-nodejs/commit/bcfdda3341aa8b0d885b40e9a6ab7f90859f9f3e) and [#177](https://github.com/willdurand/puppet-nodejs/issues/177) for further reference. - -### Installer Refactoring - -- added `puppetlabs-gcc` for package handling of the compiler (and removed custom implementation) -- killed the `python_package` option (not needed anymore) -- `nodejs::install` has been replaced by an internal API. to use multiple instances, use the `instances` and `instances_to_remove` option of the `nodejs` class (see the docs for more details) -- Introduced a new `build_deps` parameter which makes the entire package setup optional (see `willdurand/composer#44`). - -### Version refactoring - -The whole version detection logic was quite outdated and needed a refactoring: - -- removed the `stable` flag for versions. The behavior of `latest` was equal. -- introduced the `lts` flag to fetch the latest LTS release of Node.js. -- generic versions: - - `7.x` to fetch the latest release of the Node.js v7 branch. - - `7.0` to fetch the latest `7.0.x` release. - -### `nodejs::npm` refactoring - -The `nodejs::npm` resource has been refactored in order to keep the logic inside maintainable. - -The following breaking changes were made: - -- Removed `install_opt` and `remove_opt` and replaced it with a single `options` parameter. -- Renamed `exec_as_user` to `exec_user` as it's describes the intent of the parameter in a better way. -- Dropped automatic generation of a home directory for the `npm` calls and added a `home_dir` parameter which does the job. -- Removed the ability to write `dir:pkg` as resource title. -- The `pkg_name` has now `$title` as default parameter. diff --git a/contrib-modules/nodejs/Gemfile b/contrib-modules/nodejs/Gemfile deleted file mode 100644 index 76f94f3d..00000000 --- a/contrib-modules/nodejs/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -source 'https://rubygems.org/' - -puppetVersion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : '~> 3.4.0' - -gem 'rake' -gem 'puppet', puppetVersion -gem 'puppet-lint' -gem 'puppet-syntax' -gem 'rspec-puppet' -gem 'puppetlabs_spec_helper' -gem 'iconv' -gem 'webmock' -gem 'puppet-blacksmith' diff --git a/contrib-modules/nodejs/Gemfile-Nix.lock b/contrib-modules/nodejs/Gemfile-Nix.lock deleted file mode 100644 index 9380df5f..00000000 --- a/contrib-modules/nodejs/Gemfile-Nix.lock +++ /dev/null @@ -1,85 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.5.0) - public_suffix (~> 2.0, >= 2.0.2) - crack (0.4.3) - safe_yaml (~> 1.0.0) - diff-lcs (1.3) - domain_name (0.5.20170223) - unf (>= 0.0.5, < 1.0.0) - facter (1.7.6) - hashdiff (0.3.2) - hiera (1.3.4) - json_pure - http-cookie (1.0.3) - domain_name (~> 0.5) - iconv (1.0.4) - json_pure (2.0.3) - metaclass (0.0.4) - mime-types (2.99.3) - mocha (1.2.1) - metaclass (~> 0.0.1) - netrc (0.11.0) - public_suffix (2.0.5) - puppet (3.4.3) - facter (~> 1.6) - hiera (~> 1.0) - rgen (~> 0.6.5) - puppet-blacksmith (3.4.0) - puppet (>= 2.7.16) - rest-client (~> 1.8.0) - puppet-lint (2.1.1) - puppet-syntax (2.3.0) - rake - puppetlabs_spec_helper (2.1.0) - mocha (~> 1.0) - puppet-lint (~> 2.0) - puppet-syntax (~> 2.0) - rspec-puppet (~> 2.0) - rake (12.0.0) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rgen (0.6.6) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-puppet (2.5.0) - rspec - rspec-support (3.5.0) - safe_yaml (1.0.4) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.2) - webmock (2.3.2) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff - -PLATFORMS - ruby - -DEPENDENCIES - iconv - puppet (~> 3.4.0) - puppet-blacksmith - puppet-lint - puppet-syntax - puppetlabs_spec_helper - rake - rspec-puppet - webmock - -BUNDLED WITH - 1.14.4 diff --git a/contrib-modules/nodejs/LICENSE b/contrib-modules/nodejs/LICENSE deleted file mode 100644 index b9ada854..00000000 --- a/contrib-modules/nodejs/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) William Durand , Johannes Graf, Maximilian Bosch - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/contrib-modules/nodejs/README.md b/contrib-modules/nodejs/README.md deleted file mode 100644 index 31058d54..00000000 --- a/contrib-modules/nodejs/README.md +++ /dev/null @@ -1,313 +0,0 @@ -puppet-nodejs -============= - -[![Build -Status](https://travis-ci.org/willdurand/puppet-nodejs.png?branch=master)](https://travis-ci.org/willdurand/puppet-nodejs) - -This module allows you to install [Node.js](https://nodejs.org/) and -[NPM](https://npmjs.org/). This module is published on the Puppet Forge as -[willdurand/nodejs](https://forge.puppetlabs.com/willdurand/nodejs). - -Version 1.9 ------------ - -The 1.x branch will be EOLed two months after ``2.0`` is released. -If you need the docs for 1.x, see [1.9](https://github.com/willdurand/puppet-nodejs/tree/1.9). - -Installation ------------- - -### Manual installation - -This modules depends on -[puppetlabs/stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) and -[puppetlabs/gcc](https://github.com/puppetlabs/puppetlabs-gcc). -So all repositories have to be checked out: - -```bash -git clone git://github.com/willdurand/puppet-nodejs.git modules/nodejs -git clone git://github.com/puppetlabs/puppetlabs-stdlib.git modules/stdlib -git clone git://github.com/puppetlabs/puppetlabs-gcc.git modules/gcc -``` - -For Redhat based OS, the following are (typical) additional requirements: - -```bash -git clone git://github.com/treydock/puppet-gpg_key.git modules/gpg_key -``` - -### Puppet Module Tool: - - puppet module install willdurand/nodejs - -### Librarian-puppet: - - mod 'willdurand/nodejs', '2.x.x' - -Usage ------ - -There are a few ways to use this puppet module. The easiest one is just using the class definition: - -```puppet -class { 'nodejs': - version => 'v6.0.0', -} -``` -This install the precompiled Node.js version `v6.0.0` on your machine. `node` and `npm` will be available in your `$PATH` at `/usr/local/bin` so you can just start using `node`. - -Shortcuts are provided to easily install the `latest` release or the latest LTS release (`lts`) by setting the `version` parameter to `latest` or `lts`. It will automatically look for the last release available on https://nodejs.org. - -```puppet -# installs the latest nodejs version -class { 'nodejs': - version => 'latest', -} -``` - -```puppet -# installs the latest nodejs LTS version -class { 'nodejs': - version => 'lts', -} -``` - -### Compiling from source - -In order to compile from source with `gcc`, the `make_install` must be `true`. - -```puppet -class { 'nodejs': - version => 'lts', - make_install => true, -} -``` - -### Setup using a generic version - -Instead of fixing one specific nodejs version it's also possible to tell this module whether to use the latest of a certain minor release: - -``` puppet -class { '::nodejs': - version => '6.3', -} -``` -This will install the latest patch release of `6.3.x`. - -The same is possible with major releases: - -``` puppet -class { '::nodejs': - version => '6.x', -} -``` - -This will install the latest `6.x` release. - -### Setup with a given download timeout - -Due to infrastructures with slower connections the download of the nodejs binaries should be -configurable: - -``` puppet -class { '::nodejs': - download_timeout => 0, -} -``` - -### Setup multiple versions of Node.js - -If you need more than one installed version of Node.js on your machine, you can just configure them using the `instances` list. - -```puppet -class { '::nodejs': - version => 'v6.0.0', - instances => { - "node-v6" => { - version => 'v6.0.0' - }, - "node-v5" => { - version => 'v5.0.0' - } - }, -} -``` - -This will install the node version `v5.0.0` and `v6.0.0` on your machine with `v6.0.0` as default and `v5.0.0` as versioned binary in `/usr/local/bin`: - -``` -/usr/local/bin/node # v6.0.0 -/usr/local/bin/node-v6.0.0 -/usr/local/bin/npm-v6.0.0 - -/usr/local/bin/npm # NPM shipped with v6.0.0 -/usr/local/bin/npm-v5.0.0 -/usr/local/bin/npm-v5.0.0 -``` - -It is also possible to remove those versions again: - -```puppet -class { '::nodejs': - # ... - instances_to_remove => ['5.4'], -} -``` - -After the run the directory __/usr/local/node/node-v5.4.1__ has been purged. -The link __/usr/local/bin/node-v5.4.1__ is also purged. - -__Note:__ It is not possible to install and uninstall an instance in the same run. The version defined in the `version` parameter of the `nodejs` class can't be removed in the same run. If a version should be removed, it must not be present in the `instances` list. - -### Setup using custom amount of cpu cores - -By default, all available cpu (that are detected using the `::processorcount` fact) cores are being used to compile nodejs. Set `cpu_cores` to any number of cores you want to use. - -```puppet -class { 'nodejs': - version => 'lts', - cpu_cores => 2, -} -``` - -### Configuring $NODE_PATH - -The environment variable $NODE_PATH can be configured using the `init` manifest: - -```puppet -class { '::nodejs': - version => 'lts', - node_path => '/your/custom/node/path', -} -``` - -It is not possible to adjust a $NODE_PATH through ``::nodejs::install``. - -### Binary path - -`node` and `npm` are linked to `/usr/local/bin` to be available in your system `$PATH` by default. To link those binaries to e.g `/bin`, just set the parameter `target_dir`. - -```puppet -class { 'nodejs': - version => 'lts', - target_dir => '/bin', -} -``` - -### NPM - -Also, this module installs [NPM](https://npmjs.org/) by default. - -### NPM Provider - -This module adds a new provider: `npm`. You can use it as usual: - -```puppet -package { 'express': - provider => npm -} -``` - -Note: When deploying a new machine without nodejs already installed, your npm package definition requires the nodejs class: - -```puppet -class { 'nodejs': - version => 'lts' -} - -package { 'express': - provider => 'npm', - require => Class['nodejs'] -} -``` - -### NPM installer - -The nodejs installer can be used if a npm package should not be installed globally, but in a certain directory. - -There are two approaches how to use this feature: - -#### Installing a single package into a directory - -```puppet -::nodejs::npm { 'npm-webpack': - ensure => present, # absent would uninstall this package - pkg_name => 'webpack', - version => 'x.x', # optional - options => '-x -y -z', # CLI options passed to the "npm install" cmd, optional - exec_user => 'vagrant', # exec user, optional - directory => '/target/directory', # target directory - home_dir => '/home/vagrant', # home directory of the user which runs the installation (vagrant in this case) -} -``` - -This would install the package ``webpack`` into ``/target/directory`` with version ``x.x``. - -#### Executing a ``package.json`` file - -```puppet -::nodejs::npm { 'npm-install-dir': - list => true, # flag to tell puppet to execute the package.json file - directory => '/target', - exec_user => 'vagrant', - options => '-x -y -z', -} -``` - -### Proxy - -When your puppet agent is behind a web proxy, export the `http_proxy` environment variable: - -```bash -export http_proxy=http://myHttpProxy:8888 -``` - -### Skipping package setup - -As discussed in [willdurand/composer#44](https://github.com/willdurand/puppet-composer/issues/44) each module should get a `build_deps` parameter which can be used in edge cases in order to turn the package setup of this module off: - -``` puppet -class { '::nodejs': - build_deps => false, -} -``` - -In this case you'll need to take care of the following packages: - -- `tar` -- `ruby` -- `wget` -- `semver` (GEM used by ruby) -- `make` (if `make_install` = `true`) -- `gcc` compiler (if `make_install` = `true`) - -Development with `nix` ----------------------- - -If you're using `nix` as dependency manager, you can create a custom shell which contains all dependencies declared in `Gemfile.lock` by running `nix-shell` in the root directory. - -Running the tests ------------------ - -Install the dependencies using [Bundler](https://bundler.io): - - bundle install - -Run the following command: - - bundle exec rake test - - -Authors -------- - -* William Durand -* Johannes Graf ([@grafjo](https://github.com/grafjo)) -* Maximilian Bosch ([@Ma27](https://github.com/Ma27)) - - -License -------- - -puppet-nodejs is released under the MIT License. See the bundled LICENSE file -for details. diff --git a/contrib-modules/nodejs/Rakefile b/contrib-modules/nodejs/Rakefile deleted file mode 100644 index d73711cd..00000000 --- a/contrib-modules/nodejs/Rakefile +++ /dev/null @@ -1,25 +0,0 @@ -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet-lint/tasks/puppet-lint' -require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet_blacksmith/rake_tasks' - -PuppetLint.configuration.log_format = "%{path}:%{line}:%{check}:%{KIND}:%{message}" -PuppetLint.configuration.fail_on_warnings = false -PuppetLint.configuration.send("disable_80chars") -PuppetLint.configuration.send("disable_arrow_on_right_operand_line") - -exclude_paths = [ - "pkg/**/*", - "vendor/**/*", - "spec/**/*", -] - -PuppetLint.configuration.ignore_paths = exclude_paths -PuppetSyntax.exclude_paths = exclude_paths - -desc "Run syntax, lint, and spec tests." -task :test => [ - :syntax, - :lint, - :spec, -] diff --git a/contrib-modules/nodejs/checksums.json b/contrib-modules/nodejs/checksums.json deleted file mode 100644 index 90b4164c..00000000 --- a/contrib-modules/nodejs/checksums.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "CHANGELOG.md": "caf8d901618f4154f68c47467c9d467e", - "Gemfile": "6d7b25a044afe3b8883a76f034a069c8", - "Gemfile-Nix.lock": "dce2cf1f506f214497d90d71f8e2f491", - "LICENSE": "cdb7180494364f5c665246b3d5873909", - "README.md": "bce669e898ccb4aac4fe8f82ff11e11d", - "Rakefile": "f294a41cecb582053cd36fbb010c3c2a", - "default.nix": "dc64e55eaab90eafc19b74e8f4675eed", - "env.nix": "92a4bf7eaaa93defadb1ad2c39da6a8f", - "gemset.nix": "8937d0dd2763a6dab86c7cf1955bccc7", - "lib/facter/nodejs_installed_version.rb": "0419087d4f368c0cbe7c3b6f055c88cb", - "lib/puppet/parser/functions/evaluate_version.rb": "5be6a0bd6c95379ff1d24d43d77ddc73", - "lib/puppet/parser/functions/node_instances.rb": "3a6fb503dc21a92ecef31c5a4efff980", - "lib/puppet/parser/functions/util/nodejs_functions.rb": "a6ba1dc31048f3f10579a0644ec35ea0", - "lib/puppet/parser/functions/validate_nodejs_version.rb": "3ab442667bf9e0642e819e9848f1ca6b", - "lib/puppet/provider/package/npm.rb": "8108a51964ab4f9836cf831d029e7a2b", - "manifests/init.pp": "7d5159236168581f62d6c848e5bdfac0", - "manifests/instance/download.pp": "1ca0df6c5f4cd74faa9f18ef2c084b4f", - "manifests/instance/pkgs.pp": "25fa4741c2df7621e1db194f8efdd71f", - "manifests/instance.pp": "0daa3c8609b0a3caf696e13235ba5fea", - "manifests/instances.pp": "7094de13f33cf6c540fcb54f00db9f66", - "manifests/npm/file.pp": "b089cd661ce44aa289a3c480dac47aac", - "manifests/npm/package.pp": "88b06201b492bf525461e1d83d3dac6f", - "manifests/npm.pp": "e007b5ff48c1bfcddde41ecfee1c7e0e", - "manifests/params.pp": "2ce678d5ef8379a85e8ff8c9d4547636", - "metadata.json": "9ef5273d62a16882389b36f8515fd8b6", - "spec/classes/nodejs_instance_pkgs_spec.rb": "b62f27ae0334ea98136b8b06545ae7ce", - "spec/classes/nodejs_instances_spec.rb": "5231d2b7906160c7a7028d89b81d493b", - "spec/classes/nodejs_spec.rb": "e9d6b964947d396b40350b3e55ec7282", - "spec/defines/nodejs_instance_download_spec.rb": "1b5a6bd7c883ba3e5290aeaddda5f43f", - "spec/defines/nodejs_instance_spec.rb": "f5dc117f26d1f6effdb170def15155c1", - "spec/defines/nodejs_npm_spec.rb": "61bbbbfb68493c642b3508efd7b94d07", - "spec/functions/evaluate_version_spec.rb": "fee64530071f7461a85dbe862550ce3b", - "spec/functions/node_instances_spec.rb": "a966fba0156cdd560c0865acaebe984b", - "spec/functions/validate_nodejs_version.rb": "a2d1f10468305abf65c2912c68f7e708", - "spec/spec_helper.rb": "8e25ff283e7552b0299215eec50967ec", - "templates/nodejs.sh.erb": "71188d5e60f24e7beb7dfb8ef8fe8aed", - "templates/npm.sh.erb": "1106580968e0237843224a4e6034d8eb", - "templates/npmrc": "2f3bd1c8cb8b5afe886cb3541aed4db8" -} \ No newline at end of file diff --git a/contrib-modules/nodejs/default.nix b/contrib-modules/nodejs/default.nix deleted file mode 100644 index 94e15e7b..00000000 --- a/contrib-modules/nodejs/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -with import {}; - -stdenv.mkDerivation rec { - name = "willdurand-puppet-nodejs"; - - buildInputs = - [ - (import ./env.nix) - ]; -} diff --git a/contrib-modules/nodejs/env.nix b/contrib-modules/nodejs/env.nix deleted file mode 100644 index 2d47dfdd..00000000 --- a/contrib-modules/nodejs/env.nix +++ /dev/null @@ -1,27 +0,0 @@ -with import {}; - -stdenv.mkDerivation rec { - name = "willdurand-puppet-nodejs-env"; - - env = bundlerEnv { - name = "willdurand-puppet-nodejs-env-gems"; - - gemfile = ./Gemfile; - lockfile = ./Gemfile-Nix.lock; - gemset = ./gemset.nix; - - inherit ruby; - }; - - buildInputs = [ makeWrapper ]; - - phases = [ "installPhase" ]; - installPhase = '' - export PUPPET_VERSION="~> 4.9.0" - - mkdir -p $out/bin - makeWrapper ${env}/bin/puppet $out/bin/puppet - makeWrapper ${env}/bin/rake $out/bin/rake - makeWrapper ${env}/bin/puppet-lint $out/bin/puppet-lint - ''; -} diff --git a/contrib-modules/nodejs/gemset.nix b/contrib-modules/nodejs/gemset.nix deleted file mode 100644 index e04d6045..00000000 --- a/contrib-modules/nodejs/gemset.nix +++ /dev/null @@ -1,266 +0,0 @@ -{ - addressable = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1j5r0anj8m4qlf2psnldip4b8ha2bsscv11lpdgnfh4nnchzjnxw"; - type = "gem"; - }; - version = "2.5.0"; - }; - crack = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0abb0fvgw00akyik1zxnq7yv391va148151qxdghnzngv66bl62k"; - type = "gem"; - }; - version = "0.4.3"; - }; - diff-lcs = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "18w22bjz424gzafv6nzv98h0aqkwz3d9xhm7cbr1wfbyas8zayza"; - type = "gem"; - }; - version = "1.3"; - }; - domain_name = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1bbbzlr4b02bqv8q0m1y2s2nnid8yc8crfvpkz6zkhz3dzv9ba7s"; - type = "gem"; - }; - version = "0.5.20170223"; - }; - facter = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0pd4bms2zw3qfkllw5b5gk8qakmqlc2s3hfdh85bh48hm4jv0ajr"; - type = "gem"; - }; - version = "1.7.6"; - }; - hashdiff = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1q1rp4ncyykjrlh4kvg5vpxfzh1xbp8q0pc85k2d697j23jwd0jn"; - type = "gem"; - }; - version = "0.3.2"; - }; - hiera = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "083hyad5affm817z124d89a29p2ia6bfpziy8mnr2r6svn2m7j53"; - type = "gem"; - }; - version = "1.3.4"; - }; - http-cookie = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "004cgs4xg5n6byjs7qld0xhsjq3n6ydfh897myr2mibvh6fjc49g"; - type = "gem"; - }; - version = "1.0.3"; - }; - iconv = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "16sgj6gqs4bgwv6q4vv811fb43908psr33dz7sphn1z8la3y7m2v"; - type = "gem"; - }; - version = "1.0.4"; - }; - json_pure = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0l1qsw6hdyx4i92ay296sa95vb4ax8rp7zc17k4ssz530dx1ix1s"; - type = "gem"; - }; - version = "2.0.3"; - }; - metaclass = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0hp99y2b1nh0nr8pc398n3f8lakgci6pkrg4bf2b2211j1f6hsc5"; - type = "gem"; - }; - version = "0.0.4"; - }; - mime-types = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "03j98xr0qw2p2jkclpmk7pm29yvmmh0073d8d43ajmr0h3w7i5l9"; - type = "gem"; - }; - version = "2.99.3"; - }; - mocha = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "03gmpq8xkw131jn0zcfrqvr4b8aihi3gwaj485lc87d4b809psbx"; - type = "gem"; - }; - version = "1.2.1"; - }; - netrc = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y"; - type = "gem"; - }; - version = "0.11.0"; - }; - public_suffix = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "040jf98jpp6w140ghkhw2hvc1qx41zvywx5gj7r2ylr1148qnj7q"; - type = "gem"; - }; - version = "2.0.5"; - }; - puppet = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0hhjdfjw3fbijygag84rslr56kcdi184zhm25zahb4cx79702wvk"; - type = "gem"; - }; - version = "3.4.3"; - }; - puppet-blacksmith = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0z0514m5hw7r2ilpy556xrb0vvkzwqzrg768d7vg7vmbh8rlwzfs"; - type = "gem"; - }; - version = "3.4.0"; - }; - puppet-lint = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "12gfxfk3z36z9dfn3q6qfjm8h1j2djd30qfm0nch9igcy1sddf75"; - type = "gem"; - }; - version = "2.1.1"; - }; - puppet-syntax = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1nlcxjl2byn635j0ijarqp2pxwg09wlx5wwpk98kapl1pmics399"; - type = "gem"; - }; - version = "2.3.0"; - }; - puppetlabs_spec_helper = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1nnckd6vlxbr7gaksp7dx3pwqyngkfmk8mvxj32c4lj2j05wl2aa"; - type = "gem"; - }; - version = "2.1.0"; - }; - rake = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n"; - type = "gem"; - }; - version = "12.0.0"; - }; - rest-client = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1m8z0c4yf6w47iqz6j2p7x1ip4qnnzvhdph9d5fgx081cvjly3p7"; - type = "gem"; - }; - version = "1.8.0"; - }; - rgen = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0bqmw778dv9zs3lfa5lisg83xmy8dh1ix2mq147bg421ka80b7gh"; - type = "gem"; - }; - version = "0.6.6"; - }; - rspec = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "16g3mmih999f0b6vcz2c3qsc7ks5zy4lj1rzjh8hf6wk531nvc6s"; - type = "gem"; - }; - version = "3.5.0"; - }; - rspec-core = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1nacs062qbr98fx6czf1vwppn1js956nv2c8vfwj6i65axdfs46i"; - type = "gem"; - }; - version = "3.5.4"; - }; - rspec-expectations = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0bbqfrb1x8gmwf8x2xhhwvvlhwbbafq4isbvlibxi6jk602f09gs"; - type = "gem"; - }; - version = "3.5.0"; - }; - rspec-mocks = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0nl3ksivh9wwrjjd47z5dggrwx40v6gpb3a0gzbp1gs06a5dmk24"; - type = "gem"; - }; - version = "3.5.0"; - }; - rspec-puppet = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1x7xh9aj775q6wv24i6s0sadvnywjblg8gbx5x4c8zbz370smx3g"; - type = "gem"; - }; - version = "2.5.0"; - }; - rspec-support = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "10vf3k3d472y573mag2kzfsfrf6rv355s13kadnpryk8d36yq5r0"; - type = "gem"; - }; - version = "3.5.0"; - }; - safe_yaml = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "1hly915584hyi9q9vgd968x2nsi5yag9jyf5kq60lwzi5scr7094"; - type = "gem"; - }; - version = "1.0.4"; - }; - unf = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "0bh2cf73i2ffh4fcpdn9ir4mhq8zi50ik0zqa1braahzadx536a9"; - type = "gem"; - }; - version = "0.1.4"; - }; - unf_ext = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "04d13bp6lyg695x94whjwsmzc2ms72d94vx861nx1y40k3817yp8"; - type = "gem"; - }; - version = "0.0.7.2"; - }; - webmock = { - source = { - remotes = ["https://rubygems.org/"]; - sha256 = "04hkcqsmbfnp8g237pisnc834vpgildklicbjbyikqg0bg1rwcy5"; - type = "gem"; - }; - version = "2.3.2"; - }; -} \ No newline at end of file diff --git a/contrib-modules/nodejs/lib/facter/nodejs_installed_version.rb b/contrib-modules/nodejs/lib/facter/nodejs_installed_version.rb deleted file mode 100644 index a27b9fc7..00000000 --- a/contrib-modules/nodejs/lib/facter/nodejs_installed_version.rb +++ /dev/null @@ -1,5 +0,0 @@ -Facter.add("nodejs_installed_version") do - setcode do - Facter::Util::Resolution.exec('node -v 2> /dev/null') - end -end diff --git a/contrib-modules/nodejs/lib/puppet/parser/functions/evaluate_version.rb b/contrib-modules/nodejs/lib/puppet/parser/functions/evaluate_version.rb deleted file mode 100644 index c0ed0a6a..00000000 --- a/contrib-modules/nodejs/lib/puppet/parser/functions/evaluate_version.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_relative 'util/nodejs_functions' - -module Puppet::Parser::Functions - newfunction(:evaluate_version, :type => :rvalue) do |args| - raise(Puppet::ParseError, "evaluate_version(): too few arguments") if args.size < 1 - - version = args[0] - return get_latest_version if version == 'latest' - return get_lts_version if version == 'lts' - - if version =~ /^(?:(v)?)[0-9]+\.[0-9]+\.[0-9]+/ - # if the version is matched, but contains no `v` as prefix, it will - # be added automatically - return 'v' + version if version =~ /^[^v](.*)/ - return version - end - - return get_version_from_branch version if version =~ /^(?:(v)?)[0-9]+\.([0-9]+|x)$/ - - raise Puppet::ParseError, "evaluate_version(): version must be `lts`, `latest` or look like `x.x.x`" - end -end diff --git a/contrib-modules/nodejs/lib/puppet/parser/functions/node_instances.rb b/contrib-modules/nodejs/lib/puppet/parser/functions/node_instances.rb deleted file mode 100644 index 50488c8c..00000000 --- a/contrib-modules/nodejs/lib/puppet/parser/functions/node_instances.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Puppet::Parser::Functions - newfunction(:node_instances, :type => :rvalue) do |args| - raise(Puppet::ParseError, "node_instances(): too few arguments") if args.size < 1 - - Puppet::Parser::Functions.function(:evaluate_version) - - install = args[1] - normalize = args[0].map do |n, h| - evaluation_args = [install ? h["version"] : n] - actual_version = function_evaluate_version(evaluation_args) - hash = { "version" => actual_version } - - [ - install ? "nodejs-custom-instance-#{actual_version}" : "nodejs-uninstall-custom-#{actual_version}", - install ? h.merge(hash) : hash - ] - end - - normalize.to_h - end -end diff --git a/contrib-modules/nodejs/lib/puppet/parser/functions/util/nodejs_functions.rb b/contrib-modules/nodejs/lib/puppet/parser/functions/util/nodejs_functions.rb deleted file mode 100644 index da45f405..00000000 --- a/contrib-modules/nodejs/lib/puppet/parser/functions/util/nodejs_functions.rb +++ /dev/null @@ -1,86 +0,0 @@ -require 'json' - -class NodeVersion < Array - def initialize s - super(s.split('.').map { |e| e.to_i }) - end - def < x - (self <=> x) < 0 - end - def > x - (self <=> x) > 0 - end - def == x - (self <=> x) == 0 - end -end - -class NodeJSListStore - @@list = nil - def self.set_list(list) - @@list = list - end - def self.is_cached - @@list.nil? == false - end - def self.get_list - return @@list - end -end - -# inspired by https://github.com/visionmedia/n/blob/5630984059fb58f47def8dca2f25163456181ed3/bin/n#L363-L372 -def get_version_list - if NodeJSListStore::is_cached - return NodeJSListStore::get_list - end - - uri = URI('https://nodejs.org/dist/index.json') - - http_proxy = ENV["http_proxy"] - if http_proxy.to_s != '' - if http_proxy =~ /^http[s]{0,1}:\/\/.*/ - proxy = URI.parse(http_proxy) - else - proxy = URI.parse('http://' + http_proxy) - end - request = Net::HTTP::Proxy(proxy.host, proxy.port).new(uri.host, uri.port) - else - request = Net::HTTP.new(uri.host, uri.port) - end - request.use_ssl = (uri.scheme == 'https') - request.open_timeout = 2 - request.read_timeout = 2 - - result = JSON.parse(request.get(uri.request_uri).body) - NodeJSListStore::set_list(result) - - return result -end - -def get_latest_version - version_data = get_version_list.map { |o| o['version'].gsub(/^v/, '') } - version_data.sort! { |a,b| NodeVersion.new(a) <=> NodeVersion.new(b) }; - 'v' + version_data.last -end - -def get_lts_version - # in this case it needs to be checked whether NOT false as the `lts` value can either be `false` - # or the name of the LTS (e.g. Argon) - version_data = get_version_list.select { |o| o['lts'] != false } - version_data.first['version'] -end - -def get_version_from_branch(version) - if version =~ /^[0-9]+\.x$/ - version.gsub!(/\.x$/, '') - regex = /^v#{version}\.[0-9]+\.[0-9]+$/ - else - regex = /^v#{version}\.([0-9]+)$/ - end - - version_data = get_version_list - .map { |o| o['version'] } - .select { |v| v =~ regex } - - version_data.first -end diff --git a/contrib-modules/nodejs/lib/puppet/parser/functions/validate_nodejs_version.rb b/contrib-modules/nodejs/lib/puppet/parser/functions/validate_nodejs_version.rb deleted file mode 100644 index 5e5af36e..00000000 --- a/contrib-modules/nodejs/lib/puppet/parser/functions/validate_nodejs_version.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'semver' - -module Puppet::Parser::Functions - newfunction(:validate_nodejs_version) do |args| - version = SemVer.new(args[0]) - if version < SemVer.new('v0.12.0') - raise Puppet::ParseError, ('All NodeJS versions below `v0.12.0` are not supported!') - end - end -end diff --git a/contrib-modules/nodejs/lib/puppet/provider/package/npm.rb b/contrib-modules/nodejs/lib/puppet/provider/package/npm.rb deleted file mode 100644 index 5f69cdd5..00000000 --- a/contrib-modules/nodejs/lib/puppet/provider/package/npm.rb +++ /dev/null @@ -1,80 +0,0 @@ -require 'puppet/provider/package' - -# Extracted from: https://github.com/puppetlabs/puppetlabs-nodejs -# Improved to ensure 'npm' is installed before to install packages. -Puppet::Type.type(:package).provide :npm, :parent => Puppet::Provider::Package do - desc "npm is a package management for node.js. This provider only handles global packages." - - has_feature :versionable - - has_command(:npm, 'npm') do - is_optional - environment :HOME => "/root" - end - - def self.npmlist - begin - output = execute([command(:npm), 'list', '--json', '--global'], {:combine => false}) - # ignore any npm output lines to be a bit more robust - # set max_nesting to 100 so parsing will not fail if we have module with big dependencies tree - output = PSON.parse(output.lines.select{ |l| l =~ /^((?!^npm).*)$/}.join("\n"), {:max_nesting => 100}) - @npmlist = output['dependencies'] || {} - rescue Exception => e - Puppet.debug("Error: npm list --json command error #{e.message}") - @npmlist = {} - end - end - - def npmlist - self.class.npmlist - end - - def self.instances - @npmlist ||= npmlist - @npmlist.collect do |k,v| - new({:name=>k, :ensure=>v['version'], :provider=>'npm'}) - end - end - - def query - list = npmlist - - if list.has_key?(resource[:name]) and list[resource[:name]].has_key?('version') - version = list[resource[:name]]['version'] - { :ensure => version, :name => resource[:name] } - else - { :ensure => :absent, :name => resource[:name] } - end - end - - def latest - if /#{resource[:name]}@([\d\.]+)/ =~ npm('outdated', '--global', resource[:name]) - @latest = $1 - else - @property_hash[:ensure] unless @property_hash[:ensure].is_a? Symbol - end - end - - def update - resource[:ensure] = @latest - self.install - end - - def install - if resource[:ensure].is_a? Symbol - package = resource[:name] - else - package = "#{resource[:name]}@#{resource[:ensure]}" - end - - if resource[:source] - npm('install', '--global', resource[:source]) - else - npm('install', '--global', package) - end - end - - def uninstall - npm('uninstall', '--global', resource[:name]) - end -end diff --git a/contrib-modules/nodejs/manifests/init.pp b/contrib-modules/nodejs/manifests/init.pp deleted file mode 100644 index 30255c29..00000000 --- a/contrib-modules/nodejs/manifests/init.pp +++ /dev/null @@ -1,92 +0,0 @@ -# = Class: nodejs -# -# == Parameters: -# -# [*version*] -# The NodeJS version ('vX.Y.Z', 'latest', 'lts' or 'v6.x' (latest release from the NodeJS 6 branch)). -# -# [*target_dir*] -# Where to install the executables. -# -# [*make_install*] -# If false, will install from nodejs.org binary distributions. -# -# [*node_path*] -# Value of the system environment variable (default: "/usr/local/node/node-default/lib/node_modules"). -# -# [*cpu_cores*] -# Number of CPU cores to use for compiling nodejs. Will be used for parallel 'make' jobs. -# -# [*instances*] -# List of instances to install. -# -# [*instances_to_remove*] -# Instances to be removed. -# -# [*download_timeout*] -# Maximum download timeout. -# -# [*build_deps*] -# Optional parameter whether or not to allow the module to installs its dependant packages. -# -# == Example: -# -# include nodejs -# -# class { 'nodejs': -# version => 'v0.10.17' -# } -# -class nodejs( - $version = $::nodejs::params::version, - $target_dir = $::nodejs::params::target_dir, - $make_install = $::nodejs::params::make_install, - $node_path = $::nodejs::params::node_path, - $cpu_cores = $::nodejs::params::cpu_cores, - $instances = $::nodejs::params::instances, - $instances_to_remove = $::nodejs::params::instances_to_remove, - $download_timeout = $::nodejs::params::download_timeout, - $build_deps = $::nodejs::params::build_deps, -) inherits ::nodejs::params { - validate_string($node_path) - validate_integer($cpu_cores) - validate_string($version) - validate_string($target_dir) - validate_bool($make_install) - validate_hash($instances) - validate_array($instances_to_remove) - validate_integer($download_timeout) - validate_bool($build_deps) - - $node_version = evaluate_version($version) - $nodejs_default_path = '/usr/local/node/node-default' - - if $build_deps { - Anchor['nodejs::start'] -> - class { '::nodejs::instance::pkgs': - make_install => $make_install, - } -> - Class['::nodejs::instances'] - } - anchor { 'nodejs::start': } -> - class { '::nodejs::instances': - instances => $instances, - node_version => $node_version, - target_dir => $target_dir, - make_install => $make_install, - cpu_cores => $cpu_cores, - instances_to_remove => $instances_to_remove, - nodejs_default_path => $nodejs_default_path, - download_timeout => $download_timeout, - } -> - # TODO remove! - file { '/etc/profile.d/nodejs.sh': - ensure => file, - owner => 'root', - group => 'root', - mode => '0644', - content => template("${module_name}/nodejs.sh.erb"), - require => File[$nodejs_default_path], - } -> - anchor { 'nodejs::end': } -} diff --git a/contrib-modules/nodejs/manifests/instance.pp b/contrib-modules/nodejs/manifests/instance.pp deleted file mode 100644 index b52e40bc..00000000 --- a/contrib-modules/nodejs/manifests/instance.pp +++ /dev/null @@ -1,174 +0,0 @@ -# = Define: nodejs::install -# -# == Parameters: -# -# [*ensure*] -# Whether to install or uninstall an instance. -# -# [*version*] -# The NodeJS version ('vX.Y.Z', 'latest' or 'stable'). -# -# [*target_dir*] -# Where to install the executables. -# -# [*make_install*] -# If false, will install from nodejs.org binary distributions. -# -# [*cpu_cores*] -# Number of CPU cores to use for compiling nodejs. Will be used for parallel 'make' jobs. -# -# [*default_node_version*] -# The default nodejs version. Required to ensure that the default version won't be uninstalled if $ensure = absent. -# -# [*timeout*] -# Maximum download timeout. -# -define nodejs::instance($ensure, $version, $target_dir, $make_install, $cpu_cores, $default_node_version, $timeout) { - if $caller_module_name != $module_name { - warning('nodejs::instance is private!') - } - - validate_string($ensure) - validate_re($ensure, '^(present|absent)$') - validate_integer($cpu_cores) - validate_string($version) - validate_string($target_dir) - validate_bool($make_install) - validate_integer($timeout) - - include ::nodejs::params - - $node_unpack_folder = "${::nodejs::params::install_dir}/node-${version}" - - if $ensure == present { - $node_os = $::kernel ? { - /(?i)(darwin)/ => 'darwin', - /(?i)(linux)/ => 'linux', - default => 'linux', - } - - $node_arch = $::hardwaremodel ? { - /.*64.*/ => 'x64', - /(armv6l|armv7l)/ => $1, - default => 'x86', - } - - $node_filename = $make_install ? { - true => "node-${version}.tar.gz", - false => "node-${version}-${node_os}-${node_arch}.tar.gz" - } - - $node_symlink_target = "${node_unpack_folder}/bin/node" - $node_symlink = "${target_dir}/node-${version}" - $npm_instance = "${node_unpack_folder}/bin/npm" - $npm_symlink = "${target_dir}/npm-${version}" - - ensure_resource('file', 'nodejs-install-dir', { - ensure => 'directory', - path => $::nodejs::params::install_dir, - owner => 'root', - group => 'root', - mode => '0644', - }) - - ::nodejs::instance::download { "nodejs-download-${version}": - source => "https://nodejs.org/dist/$%7Bversion%7D/$%7Bnode_filename%7D", - destination => "${::nodejs::params::install_dir}/${node_filename}", - require => File['nodejs-install-dir'], - timeout => $timeout, - } - - file { "nodejs-check-tar-${version}": - ensure => 'file', - path => "${::nodejs::params::install_dir}/${node_filename}", - owner => 'root', - group => 'root', - mode => '0644', - require => ::Nodejs::Instance::Download["nodejs-download-${version}"], - } - - file { $node_unpack_folder: - ensure => 'directory', - owner => 'root', - group => 'root', - mode => '0644', - require => File['nodejs-install-dir'], - } - - exec { "nodejs-unpack-${version}": - command => "tar -xzvf ${node_filename} -C ${node_unpack_folder} --strip-components=1", - path => '/usr/bin:/bin:/usr/sbin:/sbin', - cwd => $::nodejs::params::install_dir, - user => 'root', - unless => "test -f ${node_symlink_target}", - require => [ - File["nodejs-check-tar-${version}"], - File[$node_unpack_folder], - Package['tar'], - ], - } - - if $make_install { - notify { "Starting to compile NodeJS version ${version}": - before => Exec["nodejs-make-install-${version}"], - require => Exec["nodejs-unpack-${version}"], - } - - exec { "nodejs-make-install-${version}": - command => "./configure --prefix=${node_unpack_folder} && make -j ${cpu_cores} && make -j ${cpu_cores} install", - path => "${node_unpack_folder}:/usr/bin:/bin:/usr/sbin:/sbin", - cwd => $node_unpack_folder, - user => 'root', - unless => "test -f ${node_symlink_target}", - timeout => 0, - require => [ - Exec["nodejs-unpack-${version}"], - Class['::gcc'], - Package['make'], - ], - before => File["nodejs-symlink-bin-with-version-${version}"], - } - } - - $node_prefix = $target_dir - file { "nodejs-npmrc-etc-dir-${version}": - ensure => directory, - path => "${node_unpack_folder}/etc", - } -> - file { "nodejs-npmrc-${version}": - ensure => present, - path => "${node_unpack_folder}/etc/npmrc", - content => template("${module_name}/npmrc") - } - - file { "nodejs-symlink-bin-with-version-${version}": - ensure => 'link', - path => $node_symlink, - target => $node_symlink_target, - } - - file { "npm-symlink-bin-with-version-${version}": - ensure => file, - mode => '0755', - path => $npm_symlink, - content => template("${module_name}/npm.sh.erb"), - require => [File["nodejs-symlink-bin-with-version-${version}"]], - } - } else { - if $default_node_version == $version { - fail('Can\'t remove the instance which is the default instance defined in the ::nodejs class!') - } - - file { $node_unpack_folder: - ensure => absent, - force => true, - recurse => true, - } -> - file { "${target_dir}/node-${version}": - ensure => absent, - } -> - file { "${target_dir}/npm-${version}": - ensure => absent, - } - } -} diff --git a/contrib-modules/nodejs/manifests/instance/download.pp b/contrib-modules/nodejs/manifests/instance/download.pp deleted file mode 100644 index 8edcca1c..00000000 --- a/contrib-modules/nodejs/manifests/instance/download.pp +++ /dev/null @@ -1,45 +0,0 @@ -# = Define: nodejs::install::download -# -# == Parameters: -# -# [*source*] -# Source to fetch for wget. -# -# [*destination*] -# Local destination of the file to download. -# -# [*unless_test*] -# Test whether the destination is already in use. -# -# [*timeout*] -# Timeout for the download command. -# -define nodejs::instance::download( - $source, - $destination, - $unless_test = true, - $timeout = 0 -) { - validate_bool($unless_test) - validate_string($destination) - validate_string($source) - validate_integer($timeout) - - if $caller_module_name != $module_name { - warning('::nodejs::install::download is not meant for public use!') - } - - $creates = $unless_test ? { - true => $destination, - default => undef, - } - - exec { "nodejs-wget-download-${source}-${destination}": - command => "/usr/bin/wget --output-document ${destination} ${source}", - creates => $creates, - timeout => $timeout, - require => [ - Package['wget'], - ], - } -} diff --git a/contrib-modules/nodejs/manifests/instance/pkgs.pp b/contrib-modules/nodejs/manifests/instance/pkgs.pp deleted file mode 100644 index accac0b3..00000000 --- a/contrib-modules/nodejs/manifests/instance/pkgs.pp +++ /dev/null @@ -1,29 +0,0 @@ -# = Define: nodejs::instance::pkgs -# -# Ensures that all packages will be installed properly. -# -# == Parameters: -# -# [*make_install*] -# Whether or not to install all compiler-related dependencies. -# -# == Example: -# -# class { '::nodejs::instance::pkgs': } -# -class nodejs::instance::pkgs($make_install = false) { - if $caller_module_name != $module_name { - warning('nodejs::instance::pkgs is private!') - } - - ensure_packages(['tar', 'wget', 'ruby']) - ensure_packages(['semver'], { - provider => gem, - require => Package['ruby'], - }) - - if $make_install { - include ::gcc - ensure_packages(['make']) - } -} diff --git a/contrib-modules/nodejs/manifests/instances.pp b/contrib-modules/nodejs/manifests/instances.pp deleted file mode 100644 index 36147d38..00000000 --- a/contrib-modules/nodejs/manifests/instances.pp +++ /dev/null @@ -1,94 +0,0 @@ -# = Class: nodejs::instances -# -# == Parameters: -# -# [*instances*] -# The list of nodejs instances to be installed. -# -# [*node_version*] -# The evaluated node version which is either the only one or the default instance. -# -# [*target_dir*] -# The target dir where to install the executables. -# -# [*make_install*] -# Whether or not to compile from source. -# -# [*cpu_cores*] -# How many CPU cores to use for the compile from source (only used when $make_install = true) -# -# [*instances_to_remove*] -# The list of instances to remove. -# -# [*nodejs_default_path*] -# The path of the default installation. -# -# [*download_timeout*] -# Maximum time for the download of the nodejs sources. -# -class nodejs::instances($instances, $node_version, $target_dir, $make_install, $cpu_cores, $instances_to_remove, $nodejs_default_path, $download_timeout) { - if $caller_module_name != $module_name { - warning('nodejs::instances is private!') - } - - if count($instances) == 0 { - nodejs::instance { "nodejs-custom-instance-${node_version}": - ensure => present, - version => $node_version, - target_dir => $target_dir, - make_install => $make_install, - cpu_cores => $cpu_cores, - default_node_version => undef, - timeout => $download_timeout, - } - } else { - create_resources('::nodejs::instance', node_instances($instances, true), { - ensure => present, - target_dir => $target_dir, - make_install => $make_install, - cpu_cores => $cpu_cores, - default_node_version => undef, - timeout => $download_timeout, - }) - - if !defined(Nodejs::Instance["nodejs-custom-instance-${$node_version}"]) { - fail("Cannot create a default instance with version `${$node_version}` if this version is not defined in the `instances` list!") - } - } - - if count($instances_to_remove) > 0 { - create_resources('::nodejs::instance', node_instances($instances_to_remove, false), { - ensure => absent, - make_install => false, - cpu_cores => 0, - target_dir => $target_dir, - default_node_version => $node_version, - timeout => $download_timeout, - }) - } - - $nodejs_version_path = "/usr/local/node/node-${$node_version}" - - file { $nodejs_default_path: - ensure => link, - target => $nodejs_version_path, - require => Nodejs::Instance["nodejs-custom-instance-${$node_version}"], - } - - $node_default_symlink = "${target_dir}/node" - $node_default_symlink_target = "${nodejs_default_path}/bin/node" - $npm_default_symlink = "${target_dir}/npm" - $npm_default_symlink_target = "${nodejs_default_path}/bin/npm" - - file { $node_default_symlink: - ensure => link, - target => $node_default_symlink_target, - require => File[$nodejs_default_path] - } - - file { $npm_default_symlink: - ensure => link, - target => $npm_default_symlink_target, - require => File[$nodejs_default_path] - } -} diff --git a/contrib-modules/nodejs/manifests/npm.pp b/contrib-modules/nodejs/manifests/npm.pp deleted file mode 100644 index 5430b25e..00000000 --- a/contrib-modules/nodejs/manifests/npm.pp +++ /dev/null @@ -1,88 +0,0 @@ -# = Define: nodejs::npm -# -# Define to install packages in a certain directory. -# -# == Parameters: -# -# [*ensure*] -# Whether to install or uninstall the package. -# -# [*version*] -# The specific version of the package to install (optional). -# -# [*options*] -# Additional NPM options. -# -# [*exec_user*] -# User which should execute the command (optional). -# -# [*list*] -# Whehter to apply a package.json or installing a custom package (default: false). -# -# [*directory*] -# Target directory. -# -# [*pkg_name*] -# Package name. -# -# [*home_dir*] -# The home directory of the executing user. -# -# == Example: -# -# Single package: -# -# ::nodejs::npm { 'webpack-directory': -# ensure => present, -# version => 'x.x', -# pkg_name => 'webpack', -# directory => '/directory', -# } -# -# From package.json: -# -# ::nodejs::npm { 'directory-npm-install': -# list => true, -# directory => '/directory', -# } -# -define nodejs::npm ( - $pkg_name = $title, - $ensure = present, - $version = undef, - $exec_user = undef, - $list = false, - $directory = undef, - $options = undef, - $home_dir = '/root', -) { - validate_string($version) - validate_string($exec_user) - validate_bool($list) - validate_string($directory) - validate_string($pkg_name) - validate_string($options) - validate_string($home_dir) - - include ::nodejs - - $exec_env = "HOME=${home_dir}" - if $list { - ::nodejs::npm::file { "npm-install-dir-${directory}": - directory => $directory, - exec_user => $exec_user, - exec_env => $exec_env, - options => $options, - } - } else { - ::nodejs::npm::package { "npm-install-${pkg_name}-${directory}": - ensure => $ensure, - exec_user => $exec_user, - npm_dir => $directory, - npm_pkg => $pkg_name, - version => $version, - exec_env => $exec_env, - options => $options, - } - } -} diff --git a/contrib-modules/nodejs/manifests/npm/file.pp b/contrib-modules/nodejs/manifests/npm/file.pp deleted file mode 100644 index e81003f4..00000000 --- a/contrib-modules/nodejs/manifests/npm/file.pp +++ /dev/null @@ -1,38 +0,0 @@ -# = Define: nodejs::npm::file -# -# Define that installs dependencies from a package file into a certain directory. -# NOTE: this is just a private definition and not meant for public usage. -# -# == Parameters: -# -# [*directory*] -# Target directory. -# -# [*options*] -# Options to adjust for the npm commands (optional). -# -# [*exec_user*] -# User which should execute the command (optional). -# -# [*exec_env*] -# Exec environment. -# -define nodejs::npm::file( - $directory, - $exec_user = undef, - $exec_env = undef, - $options = undef, -) { - if $caller_module_name != $module_name { - warning('::nodejs::npm::file is not meant for public use!') - } - - exec { "npm_install_dir_${directory}": - command => "npm install ${options}", - cwd => $directory, - path => $::path, - require => Class['nodejs'], - user => $exec_user, - environment => $exec_env, - } -} diff --git a/contrib-modules/nodejs/manifests/npm/package.pp b/contrib-modules/nodejs/manifests/npm/package.pp deleted file mode 100644 index 65fac5d7..00000000 --- a/contrib-modules/nodejs/manifests/npm/package.pp +++ /dev/null @@ -1,73 +0,0 @@ -# = Define: nodejs::npm::package -# -# Define that install a single package into a directory. -# NOTE: this is just a private definition and not meant for public usage. -# -# == Parameters: -# -# [*ensure*] -# Whether to install or uninstall a npm module. -# -# [*version*] -# The specific version of the package to install (optional). -# -# [*options*] -# Options for the NPM commands. -# -# [*exec_user*] -# User which should execute the command (optional). -# -# [*exec_env*] -# Exec environment. -# -# [*npm_dir*] -# Target directory. -# -# [*npm_pkg*] -# Package name. -# -define nodejs::npm::package( - $npm_dir, - $npm_pkg, - $ensure = present, - $version = undef, - $options = undef, - $exec_user = undef, - $exec_env = undef, -) { - if $caller_module_name != $module_name { - warning('::nodejs::npm::package is not meant for public use!') - } - - $install_pkg = $version ? { - undef => $npm_pkg, - default => "${npm_pkg}@${version}" - } - - $validate = "${npm_dir}/node_modules/${npm_pkg}:${install_pkg}" - - if $ensure == present { - exec { "npm_install_${npm_pkg}_${npm_dir}": - command => "npm install ${options} ${install_pkg}", - unless => "npm list -p -l | grep '${validate}'", - cwd => $npm_dir, - path => $::path, - require => Class['nodejs'], - user => $exec_user, - environment => $exec_env, - } - - # Conditionally require npm_proxy only if resource exists. - Exec<| title=='npm_proxy' |> -> Exec["npm_install_${npm_pkg}_${npm_dir}"] - } else { - exec { "npm_remove_${npm_pkg}_${npm_dir}": - command => "npm remove ${options} ${npm_pkg}", - onlyif => "npm list -p -l | grep '${validate}'", - cwd => $npm_dir, - path => $::path, - require => Class['nodejs'], - user => $exec_user, - environment => $exec_env, - } - } -} diff --git a/contrib-modules/nodejs/manifests/params.pp b/contrib-modules/nodejs/manifests/params.pp deleted file mode 100644 index 6b135592..00000000 --- a/contrib-modules/nodejs/manifests/params.pp +++ /dev/null @@ -1,27 +0,0 @@ -# = Class: nodejs::params -# -# This class defines default parameters used by the main module class nodejs. -# Operating Systems differences in names and paths are addressed here. -# -# == Variables: -# -# Refer to nodejs class for the variables defined here. -# -# == Usage: -# -# This class is not intended to be used directly. -# It may be imported or inherited by other classes. -# -class nodejs::params { - $install_dir = '/usr/local/node' - $target_dir = '/usr/local/bin' - $version = 'lts' - $make_install = false - $node_path = '/usr/local/node/node-default/lib/node_modules' - $cpu_cores = $::processorcount - $install_ruby = false - $instances = {} - $instances_to_remove = [] - $download_timeout = 0 - $build_deps = true -} diff --git a/contrib-modules/nodejs/metadata.json b/contrib-modules/nodejs/metadata.json deleted file mode 100644 index 0e274188..00000000 --- a/contrib-modules/nodejs/metadata.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "willdurand-nodejs", - "version": "2.0.0", - "author": "William Durand", - "summary": "A module to install Node.js and NPM.", - "license": "MIT", - "source": "https://github.com/willdurand/puppet-nodejs", - "project_page": "https://github.com/willdurand/puppet-nodejs", - "issues_url": "https://github.com/willdurand/puppet-nodejs/issues", - "dependencies": [ - {"name":"puppetlabs/stdlib","version_requirement":">=3.2.1"}, - {"name":"puppetlabs/gcc","version_requirement":">=0.3.0"} - ], - "data_provider": null, - "tags": [ - "node", - "nodejs", - "npm" - ], - "operatingsystem_support": [ - { - "operatingsystem": "RedHat", - "operatingsystemrelease": [ - "6", - "7" - ] - }, - { - "operatingsystem": "CentOS", - "operatingsystemrelease": [ - "6", - "7" - ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "14.04", - "16.04" - ] - }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ - "7", - "8" - ] - } - ], - "requirements": [ - { - "name": "puppet", - "version_requirement": ">=3.4.0 <5.0.0" - } - ] -} diff --git a/contrib-modules/nodejs/spec/classes/nodejs_instance_pkgs_spec.rb b/contrib-modules/nodejs/spec/classes/nodejs_instance_pkgs_spec.rb deleted file mode 100644 index a3faa260..00000000 --- a/contrib-modules/nodejs/spec/classes/nodejs_instance_pkgs_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe 'nodejs::instance::pkgs', :type => :class do - let(:title) { 'nodejs::instance::pkgs' } - - describe 'module dependency management' do - it { should contain_package('wget') } - it { should contain_package('tar') } - end - - describe 'includes compiler-related dependencies' do - let(:params) {{ - :make_install => true - }} - let(:facts) {{ - :osfamily => 'Debian' - }} - - it { should contain_package('wget') } - it { should contain_package('tar') } - - it { should contain_package('make') } - it { should contain_class('gcc') } - end -end diff --git a/contrib-modules/nodejs/spec/classes/nodejs_instances_spec.rb b/contrib-modules/nodejs/spec/classes/nodejs_instances_spec.rb deleted file mode 100644 index fff14368..00000000 --- a/contrib-modules/nodejs/spec/classes/nodejs_instances_spec.rb +++ /dev/null @@ -1,157 +0,0 @@ -require 'spec_helper' - -describe 'nodejs::instances', :type => :class do - let(:title) { 'nodejs::instances' } - let(:facts) {{ - :kernel => 'linux', - :hardwaremodel => 'x86', - :osfamily => 'Debian', - :processorcount => 2, - }} - before(:each) { - Puppet::Parser::Functions.newfunction(:evaluate_version, :type => :rvalue) do |args| - return 'v4.4.7' if args[0] == 'lts' - return args[0] - end - } - - describe 'with a given version' do - let(:params) {{ - :node_version => 'v5.0.0', - :instances => {}, - :instances_to_remove => [], - :target_dir => '/usr/local/bin', - :make_install => false, - :cpu_cores => 2, - :nodejs_default_path => '/usr/local/node/node-default', - :download_timeout => 0, - }} - - it { should contain_nodejs__instance('nodejs-custom-instance-v5.0.0') \ - .with_version('v5.0.0') - } - - it { should contain_file('/usr/local/node/node-default') \ - .with_ensure('link') \ - .with_target('/usr/local/node/node-v5.0.0') - } - end - - describe 'it adds multiple instances and declares a default one' do - let(:params) {{ - :node_version => "v4.4.7", - :instances => { - "node-lts" => { - "version" => "lts" - } - }, - :instances_to_remove => [], - :make_install => false, - :target_dir => '/usr/local/bin', - :cpu_cores => 2, - :nodejs_default_path => '/usr/local/node/node-default', - :download_timeout => 0, - }} - - it { should contain_nodejs__instance("nodejs-custom-instance-v4.4.7") \ - .with_version('v4.4.7') \ - .with_ensure('present') \ - .with_target_dir('/usr/local/bin') \ - .with_make_install(false) \ - .with_cpu_cores(2) - } - - it { should contain_file("/usr/local/node/node-default") \ - .with_ensure("link") \ - .with_target("/usr/local/node/node-v4.4.7") \ - } - - it { should contain_file("/usr/local/bin/node") \ - .with_ensure("link") \ - .with_target("/usr/local/node/node-default/bin/node") - } - - it { should contain_file("/usr/local/bin/npm") \ - .with_ensure("link") \ - .with_target("/usr/local/node/node-default/bin/npm") - } - end - - describe 'adds multiple instances from a hash and completes the hash with default values' do - let(:params) {{ - :instances => { - "v6.7" => { - "version" => 'v6.7.0', - }, - "v6.4" => { - "version" => 'v6.4.0', - "make_install" => true, - } - }, - :node_version => 'v6.7.0', - :make_install => false, - :target_dir => '/usr/local/bin', - :cpu_cores => 2, - :instances_to_remove => [], - :nodejs_default_path => '/usr/local/node/node-default', - :download_timeout => 0, - }} - - it { should contain_nodejs__instance("nodejs-custom-instance-v6.7.0") \ - .with_version('v6.7.0') \ - .with_ensure('present') \ - .with_target_dir('/usr/local/bin') \ - .with_make_install(false) \ - .with_cpu_cores(2) - } - - it { should contain_nodejs__instance("nodejs-custom-instance-v6.4.0") \ - .with_version('v6.4.0') \ - .with_ensure('present') \ - .with_target_dir('/usr/local/bin') \ - .with_make_install(true) \ - .with_cpu_cores(2) - } - end - - describe 'manages instances to be removed' do - let(:params) {{ - :node_version => 'v6.5.0', - :make_install => false, - :target_dir => '/usr/local/bin', - :cpu_cores => 2, - :instances => {}, - :instances_to_remove => ['v6.4.0'], - :nodejs_default_path => '/usr/local/node/node-default', - :download_timeout => 0, - }} - - it { should contain_nodejs__instance("nodejs-uninstall-custom-v6.4.0") \ - .with_ensure("absent") \ - .with_target_dir("/usr/local/bin") \ - .with_make_install(false) \ - .with_cpu_cores(0) \ - .with_version("v6.4.0") \ - .with_target_dir("/usr/local/bin") \ - } - end - - describe 'with an invalid nodejs instance' do - let(:params) {{ - :node_version => 'v7.0.0', - :make_install => false, - :target_dir => '/usr/local/bin', - :cpu_cores => 2, - :instances => { - "node-lts" => { - "version" => 'v6.9.1' - } - }, - :instances_to_remove => [], - :nodejs_default_path => '/usr/local/node/node-default', - :download_timeout => 0, - }} - - it { should compile.and_raise_error(/Cannot create a default instance with version/) } - end -end diff --git a/contrib-modules/nodejs/spec/classes/nodejs_spec.rb b/contrib-modules/nodejs/spec/classes/nodejs_spec.rb deleted file mode 100644 index 4cbc9b3a..00000000 --- a/contrib-modules/nodejs/spec/classes/nodejs_spec.rb +++ /dev/null @@ -1,66 +0,0 @@ -require 'spec_helper' - -describe 'nodejs', :type => :class do - let(:title) { 'nodejs' } - - let(:facts) {{ - :kernel => 'linux', - :hardwaremodel => 'x86', - :osfamily => 'Debian', - :processorcount => 2, - }} - - before(:each) { - Puppet::Parser::Functions.newfunction(:evaluate_version, :type => :rvalue) do |args| - return 'v6.0.1' if args[0] == 'latest' - return args[0] # simply return default - end - - Puppet::Parser::Functions.newfunction(:validate_nodejs_version) { - |args| 'v6.0.1' - } - } - - describe 'with node_path' do - let(:params) {{ - :node_path => '/usr/local/node/node-v5.4.1/lib/node_modules' - }} - - it { should contain_file('/etc/profile.d/nodejs.sh') \ - .with_content(/(.*)NODE_PATH=\/usr\/local\/node\/node-v5.4.1\/lib\/node_modules/) - } - end - - describe 'manages nodejs instances' do - let(:params) {{ - :instances => { - "nodejs-latest" => { "version" => "latest" } - }, - :version => "latest", - :instances_to_remove => ["v0.12.2"] - }} - - it { should contain_class('nodejs::instances') \ - .with_instances({ "nodejs-latest" => { "version" => "latest" } }) \ - .with_node_version("v6.0.1") \ - .with_target_dir("/usr/local/bin") \ - .with_make_install(false) \ - .with_cpu_cores(2) \ - .with_instances_to_remove(["v0.12.2"]) - } - end - - describe 'package setup is included by default' do - it { should contain_class('nodejs::instance::pkgs') \ - .with_make_install(false) \ - } - end - - describe 'package setup can be excluded' do - let(:params) {{ - :build_deps => false, - }} - - it { should_not contain_class('::nodejs::instance::pkgs') } - end -end diff --git a/contrib-modules/nodejs/spec/defines/nodejs_instance_download_spec.rb b/contrib-modules/nodejs/spec/defines/nodejs_instance_download_spec.rb deleted file mode 100644 index e8345021..00000000 --- a/contrib-modules/nodejs/spec/defines/nodejs_instance_download_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe 'nodejs::instance::download', :type => :define do - let(:title) { 'nodejs::instance::download' } - - describe 'wget download' do - let(:params) {{ - :source => 'https://test.dev/foo', - :destination => '/usr/local/bin/foo' - }} - - it { should contain_exec('nodejs-wget-download-https://test.dev/foo-/usr/local/bin/foo') \ - .with_command('/usr/bin/wget --output-document /usr/local/bin/foo https://test.dev/foo') \ - .with_creates('/usr/local/bin/foo') \ - .with_timeout(0) - } - end - - describe 'wget download with given timeout' do - let(:params) {{ - :source => 'https://test.dev/foo', - :destination => '/usr/local/bin/foo', - :timeout => 25 - }} - - it { should contain_exec('nodejs-wget-download-https://test.dev/foo-/usr/local/bin/foo') \ - .with_timeout(25) \ - } - end -end diff --git a/contrib-modules/nodejs/spec/defines/nodejs_instance_spec.rb b/contrib-modules/nodejs/spec/defines/nodejs_instance_spec.rb deleted file mode 100644 index 5b367a9c..00000000 --- a/contrib-modules/nodejs/spec/defines/nodejs_instance_spec.rb +++ /dev/null @@ -1,307 +0,0 @@ -require 'spec_helper' - -describe 'nodejs::instance', :type => :define do - let(:title) { 'nodejs::instance' } - let(:facts) {{ - :kernel => 'linux', - :hardwaremodel => 'x86', - :osfamily => 'Debian', - :processorcount => 2, - }} - - describe 'with latest lts release' do - let(:params) {{ - :ensure => 'present', - :version => 'v4.4.7', - :target_dir => '/usr/local/bin', - :make_install => true, - :cpu_cores => 2, - :default_node_version => nil, - :timeout => 0, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v4.4.7') \ - .with_source('https://nodejs.org/dist/v4.4.7/node-v4.4.7.tar.gz') \ - .with_destination('/usr/local/node/node-v4.4.7.tar.gz') - } - - it { should contain_file('nodejs-check-tar-v4.4.7') \ - .with_ensure('file') \ - .with_path('/usr/local/node/node-v4.4.7.tar.gz') - } - - it { should contain_exec('nodejs-unpack-v4.4.7') \ - .with_command('tar -xzvf node-v4.4.7.tar.gz -C /usr/local/node/node-v4.4.7 --strip-components=1') \ - .with_cwd('/usr/local/node') \ - .with_unless('test -f /usr/local/node/node-v4.4.7/bin/node') - } - end - - describe 'default parameters with cpu_cores set manually to 1' do - - let(:params) {{ - :make_install => true, - :ensure => 'present', - :target_dir => '/usr/local/bin', - :version => 'v6.2.0', - :cpu_cores => 1, - :default_node_version => nil, - :timeout => 0, - }} - - it { should contain_exec('nodejs-make-install-v6.2.0') \ - .with_command('./configure --prefix=/usr/local/node/node-v6.2.0 && make -j 1 && make -j 1 install') \ - .with_cwd('/usr/local/node/node-v6.2.0') \ - .with_unless('test -f /usr/local/node/node-v6.2.0/bin/node') - } - end - - describe 'with specific version v6.0.0' do - - let(:params) {{ - :version => 'v6.0.0', - :ensure => 'present', - :target_dir => '/usr/local/bin', - :make_install => true, - :cpu_cores => 2, - :default_node_version => nil, - :timeout => 0, - }} - - it { should contain_file('nodejs-install-dir') \ - .with_ensure('directory') - } - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0.tar.gz') \ - .with_destination('/usr/local/node/node-v6.0.0.tar.gz') \ - .with_timeout(0) - } - - it { should contain_file('nodejs-check-tar-v6.0.0') \ - .with_ensure('file') \ - .with_path('/usr/local/node/node-v6.0.0.tar.gz') - } - - it { should contain_exec('nodejs-unpack-v6.0.0') \ - .with_command('tar -xzvf node-v6.0.0.tar.gz -C /usr/local/node/node-v6.0.0 --strip-components=1') \ - .with_cwd('/usr/local/node') \ - .with_unless('test -f /usr/local/node/node-v6.0.0/bin/node') - } - - it { should contain_file('/usr/local/node/node-v6.0.0') \ - .with_ensure('directory') - } - - it { should contain_exec('nodejs-make-install-v6.0.0') \ - .with_command('./configure --prefix=/usr/local/node/node-v6.0.0 && make -j 2 && make -j 2 install') \ - .with_cwd('/usr/local/node/node-v6.0.0') \ - .with_unless('test -f /usr/local/node/node-v6.0.0/bin/node') - } - - it { should contain_file('nodejs-symlink-bin-with-version-v6.0.0') \ - .with_ensure('link') \ - .with_path('/usr/local/bin/node-v6.0.0') \ - .with_target('/usr/local/node/node-v6.0.0/bin/node') - } - - it { should contain_file('npm-symlink-bin-with-version-v6.0.0') \ - .with_ensure('file') \ - .with_mode('0755') \ - .with_path('/usr/local/bin/npm-v6.0.0') \ - .with_content(/(.*)\/usr\/local\/bin\/node-v6.0.0 \/usr\/local\/node\/node-v6.0.0\/bin\/npm "\$@"/) - } - - it { should contain_file('nodejs-npmrc-etc-dir-v6.0.0') \ - .with_ensure('directory') \ - .with_path('/usr/local/node/node-v6.0.0/etc') - } - - it { should contain_file('nodejs-npmrc-v6.0.0') \ - .with_path('/usr/local/node/node-v6.0.0/etc/npmrc') - } - - it { should_not contain_file('/usr/local/bin/node') } - it { should_not contain_file('/usr/local/bin/npm') } - - it { should_not contain_nodejs__instance__download('npm-download-v6.0.0') } - it { should_not contain_exec('npm-install-v6.0.0') } - end - - describe 'specific version v6.0.0 and cpu_cores manually set to 1' do - - let(:params) {{ - :ensure => 'present', - :target_dir => '/usr/local/bin', - :make_install => true, - :version => 'v6.0.0', - :cpu_cores => 1, - :default_node_version => nil, - :timeout => 0, - }} - - it { should contain_exec('nodejs-make-install-v6.0.0') \ - .with_command('./configure --prefix=/usr/local/node/node-v6.0.0 && make -j 1 && make -j 1 install') \ - .with_cwd('/usr/local/node/node-v6.0.0') \ - .with_unless('test -f /usr/local/node/node-v6.0.0/bin/node') - } - end - - describe 'with a given target_dir' do - let(:params) {{ - :ensure => 'present', - :version => 'v6.2.0', - :make_install => true, - :target_dir => '/bin', - :cpu_cores => 1, - :default_node_version => nil, - :timeout => 0, - }} - - it { should contain_file('nodejs-symlink-bin-with-version-v6.2.0') \ - .with_ensure('link') \ - .with_path('/bin/node-v6.2.0') \ - .with_target('/usr/local/node/node-v6.2.0/bin/node') - } - end - - describe 'with make_install = false' do - let(:params) {{ - :version => 'v6.2.0', - :ensure => 'present', - :target_dir => '/usr/local/bin', - :cpu_cores => 2, - :make_install => false, - :default_node_version => nil, - :timeout => 0, - }} - - it { should_not contain_exec('nodejs-make-install-v6.2.0') } - end - - describe 'uninstall' do - describe 'any instance' do - let(:params) {{ - :version => 'v0.12.0', - :ensure => 'absent', - :make_install => true, - :target_dir => '/usr/local/bin', - :cpu_cores => 1, - :default_node_version => 'v4.6.0', - :timeout => 0, - }} - - it { should contain_file('/usr/local/node/node-v0.12.0') \ - .with(:ensure => 'absent', :force => true, :recurse => true) \ - } - - it { should contain_file('/usr/local/bin/node-v0.12.0') \ - .with_ensure('absent') \ - } - end - - describe 'default instance' do - let(:params) {{ - :version => 'v5.6.0', - :ensure => 'absent', - :target_dir => '/usr/local/bin', - :make_install => false, - :cpu_cores => 1, - :default_node_version => 'v5.6.0', - :timeout => 0, - }} - - it { should compile.and_raise_error(/Can't remove the instance/) } - end - end - - describe 'nodejs download url' do - let(:params) {{ - :version => 'v6.0.0', - :ensure => 'present', - :make_install => false, - :target_dir => '/usr/local/bin', - :cpu_cores => 1, - :default_node_version => 'v5.6.0', - :timeout => 0, - }} - - describe 'os' do - describe 'darwin' do - let(:facts) {{ - :hardwaremodel => '2.6.32-504.12.2.el6.x86_64', - :kernel => 'darwin', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-darwin-x64.tar.gz') \ - } - end - - describe 'linux' do - let(:facts) {{ - :hardwaremodel => '2.6.32-504.12.2.el6.x86_64', - :kernel => 'linux', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-x64.tar.gz') \ - } - end - end - - describe 'arch' do - describe 'x64' do - let(:facts) {{ - :hardwaremodel => '2.6.32-504.12.2.el6.x86_64', - :kernel => 'linux', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-x64.tar.gz') \ - } - end - - describe 'ARM' do - describe 'armv6l' do - let(:facts) {{ - :hardwaremodel => 'armv6l', - :kernel => 'linux', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-armv6l.tar.gz') \ - } - end - - describe 'armv7l' do - let(:facts) {{ - :hardwaremodel => 'armv7l', - :kernel => 'linux', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-armv7l.tar.gz') \ - } - end - end - - describe 'default' do - let(:facts) {{ - :hardwaremodel => '2.6.32-504.12.2.el6.x86', - :kernel => 'linux', - :processorcount => 1, - }} - - it { should contain_nodejs__instance__download('nodejs-download-v6.0.0') \ - .with_source('https://nodejs.org/dist/v6.0.0/node-v6.0.0-linux-x86.tar.gz') \ - } - end - end - end -end diff --git a/contrib-modules/nodejs/spec/defines/nodejs_npm_spec.rb b/contrib-modules/nodejs/spec/defines/nodejs_npm_spec.rb deleted file mode 100644 index 9f623405..00000000 --- a/contrib-modules/nodejs/spec/defines/nodejs_npm_spec.rb +++ /dev/null @@ -1,93 +0,0 @@ -require 'spec_helper' - -describe 'nodejs::npm', :type => :define do - let(:title) { 'nodejs::npm' } - let(:facts) {{ - :kernel => 'linux', - :hardwaremodel => 'x86', - :osfamily => 'Debian', - :path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - :processorcount => 2, - }} - - describe 'install npm package' do - let (:params) {{ - :name => 'yo-foo', - :pkg_name => 'yo', - :directory => '/foo' - }} - - it { should contain_exec('npm_install_yo_/foo') \ - .with_command('npm install yo') \ - .with_unless("npm list -p -l | grep '/foo/node_modules/yo:yo'") - } - end - - describe 'uninstall npm package' do - let (:params) {{ - :name => 'foo-yo', - :ensure => 'absent', - :pkg_name => 'yo', - :directory => '/foo' - }} - - it { should contain_exec('npm_remove_yo_/foo') \ - .with_command('npm remove yo') \ - .with_onlyif("npm list -p -l | grep '/foo/node_modules/yo:yo'") - } - end - - describe 'install npm package with version' do - let (:params) {{ - :name => 'foo-yo', - :version => '1.4', - :pkg_name => 'yo', - :directory => '/foo' - }} - - it { should contain_exec('npm_install_yo_/foo') \ - .with_command('npm install yo@1.4') \ - .with_unless("npm list -p -l | grep '/foo/node_modules/yo:yo@1.4'") - } - end - - describe 'home path for unix systems' do - # just assert against OS families - operating_systems = ['Debian', 'RedHat'] - operating_systems.each do |os| - let (:params) {{ - :name => 'foo-yo', - :exec_user => 'ma27', - :pkg_name => 'yo', - :directory => '/foo', - :home_dir => '/home/ma27', - }} - let(:facts) {{ - :operatingsystem => os, - :osfamily => os, - :hardwaremodel => 'x86', - :kernel => 'linux', - :path => '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - :processorcount => 2, - }} - - it { should contain_exec('npm_install_yo_/foo') \ - .with_command('npm install yo') \ - .with_unless("npm list -p -l | grep '/foo/node_modules/yo:yo'") \ - .with_environment('HOME=/home/ma27') - } - end - end - - describe 'installation from a package.json file' do - let (:params) {{ - :list => true, - :directory => '/foo', - :options => '-x -z' - }} - - it { should contain_exec('npm_install_dir_/foo') \ - .with_command('npm install -x -z') - } - end -end diff --git a/contrib-modules/nodejs/spec/functions/evaluate_version_spec.rb b/contrib-modules/nodejs/spec/functions/evaluate_version_spec.rb deleted file mode 100644 index 67a3ad2b..00000000 --- a/contrib-modules/nodejs/spec/functions/evaluate_version_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'spec_helper' - -describe 'evaluate_version' do - it { should run.with_params('latest').and_return('v6.3.1') } - it { should run.with_params('lts').and_return('v4.4.7') } - it { should run.with_params('4.4.7').and_return('v4.4.7') } - it { should run.with_params('v4.4.7').and_return('v4.4.7') } - it { is_expected.to run.with_params('any string').and_raise_error(/version must be (.*) or look like (.*)/) } - it { is_expected.to run.with_params().and_raise_error(/too few arguments/) } - it { should run.with_params('6.3').and_return('v6.3.1') } - it { should run.with_params('6.x').and_return('v6.3.1') } -end diff --git a/contrib-modules/nodejs/spec/functions/node_instances_spec.rb b/contrib-modules/nodejs/spec/functions/node_instances_spec.rb deleted file mode 100644 index 249a8d16..00000000 --- a/contrib-modules/nodejs/spec/functions/node_instances_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe 'node_instances' do - before(:each) { - Puppet::Parser::Functions.newfunction(:evaluate_version, :type => :rvalue) do |args| - return 'v6.8.0' - end - } - - it { - should run.with_params( - { "node-instance" => { "version" => "latest" } }, - true - ).and_return({ "nodejs-custom-instance-v6.8.0" => { - "version" => "v6.8.0" - }}) - } - - it { should run.with_params(['v6.8.0']).and_return({ - "nodejs-uninstall-custom-v6.8.0" => { - "version" => "v6.8.0" - } - })} - - it { should run.with_params(['latest']).and_return({ - "nodejs-uninstall-custom-v6.8.0" => { - "version" => "v6.8.0" - } - })} -end diff --git a/contrib-modules/nodejs/spec/functions/validate_nodejs_version.rb b/contrib-modules/nodejs/spec/functions/validate_nodejs_version.rb deleted file mode 100644 index e38dfe03..00000000 --- a/contrib-modules/nodejs/spec/functions/validate_nodejs_version.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe 'validate_nodejs_version' do - it do - expect { - run.with_params('v0.6') - }.to raise_error(Puppet::ParseError, /All NodeJS versions below `v0.10.0` are not supported!/) - end - -it do - expect { - run.with_params('v0.10') - }.to raise_error(Puppet::ParseError, /All NodeJS versions below `v0.10.0` are not supported!/) - end -end diff --git a/contrib-modules/nodejs/spec/spec_helper.rb b/contrib-modules/nodejs/spec/spec_helper.rb deleted file mode 100644 index 9c169c34..00000000 --- a/contrib-modules/nodejs/spec/spec_helper.rb +++ /dev/null @@ -1,32 +0,0 @@ -require 'rubygems' -require 'puppetlabs_spec_helper/module_spec_helper' -require 'webmock/rspec' -require 'rspec' - -WebMock.disable_net_connect!() - -nodejs_response = < 200, :body => nodejs_response, :headers => {}) - end -end - -$:.unshift File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'stdlib', 'lib') diff --git a/contrib-modules/nodejs/templates/nodejs.sh.erb b/contrib-modules/nodejs/templates/nodejs.sh.erb deleted file mode 100644 index f5dfe840..00000000 --- a/contrib-modules/nodejs/templates/nodejs.sh.erb +++ /dev/null @@ -1,4 +0,0 @@ -# -# THIS FILE IS MANAGED VIA PUPPET - DON'T CHANGE ANY CONTENT HERE! -# -export NODE_PATH=<%= @node_path %> diff --git a/contrib-modules/nodejs/templates/npm.sh.erb b/contrib-modules/nodejs/templates/npm.sh.erb deleted file mode 100644 index 828b868c..00000000 --- a/contrib-modules/nodejs/templates/npm.sh.erb +++ /dev/null @@ -1,4 +0,0 @@ -# MANAGED VIA PUPPET -# DON'T EDIT THIS FILE - -<%= @node_symlink %> <%= @npm_instance %> "$@" diff --git a/contrib-modules/nodejs/templates/npmrc b/contrib-modules/nodejs/templates/npmrc deleted file mode 100644 index 184c0e9d..00000000 --- a/contrib-modules/nodejs/templates/npmrc +++ /dev/null @@ -1 +0,0 @@ -prefix=<%= @node_prefix.sub '/bin', '' %> diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index ecf06698..531cb86e 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -62,18 +62,14 @@ package{ 'postgresql-client-9.6': ensure => present } Package{ provider => apt } - class { 'nodejs': - version => 'latest', + # Install a few utilities through node/npm. + npm::install { + [ + 'js-beautify', + 'cssunminifier', + ]: } - package { 'js-beautify': - ensure => 'present', - provider => 'npm', - require => Class['nodejs'], - } - - package { 'cssunminifier': - ensure => 'present', - provider => 'npm', - require => Class['nodejs'] + npm::install { 'less': + exe => 'lessc', } } diff --git a/modules/nodejs/manifests/init.pp b/modules/nodejs/manifests/init.pp new file mode 100644 index 00000000..4cd2395d --- /dev/null +++ b/modules/nodejs/manifests/init.pp @@ -0,0 +1,11 @@ +class nodejs { + + exec { "nodejs": + command => "wget http://nodejs.org/dist/v0.12.18/node-v0.12.18.tar.gz && tar -xzf node-v0.12.18.tar.gz && cd node-v0.12.18 && ./configure && make install", + path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + timeout => 600, # 10 min + cwd => "/tmp", + onlyif => "test ! -f /usr/local/bin/node" + } + +} diff --git a/modules/npm/manifests/init.pp b/modules/npm/manifests/init.pp new file mode 100644 index 00000000..0219956e --- /dev/null +++ b/modules/npm/manifests/init.pp @@ -0,0 +1,13 @@ +class npm { + + include nodejs + + exec { "npm": + command => "curl https://npmjs.org/install.sh | sh", + path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + cwd => "/tmp", + onlyif => "test ! -f /usr/local/bin/npm", + require => [ Exec["nodejs"] ] + } + +} \ No newline at end of file diff --git a/modules/npm/manifests/install.pp b/modules/npm/manifests/install.pp new file mode 100644 index 00000000..c7ae8613 --- /dev/null +++ b/modules/npm/manifests/install.pp @@ -0,0 +1,19 @@ +define npm::install ( + $pkg = $name, + $exe = $name, +) { + + include npm + + exec { "npm install -g $pkg": + path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', + cwd => '/tmp', + # This is naive but sufficient for our current usage. + # We may have to check `npm list` at some point. + unless => "test -f /usr/local/bin/$exe", + require => [ + Class['npm'], + ], + } + +} From a91fd70e454c4532596c832cd417e0915982d7da Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 1 Jun 2018 12:49:21 -0400 Subject: [PATCH 015/147] Revert to original munin config --- contrib-modules/munin/CONTRIBUTING.md | 92 ---- contrib-modules/munin/Gemfile | 33 -- contrib-modules/munin/Guardfile | 5 - contrib-modules/munin/LICENSE | 202 -------- contrib-modules/munin/README.md | 457 ------------------ contrib-modules/munin/Rakefile | 62 --- contrib-modules/munin/checksums.json | 42 -- .../munin/manifests/master/collect.pp | 30 -- contrib-modules/munin/manifests/node.pp | 190 -------- .../munin/manifests/node/export.pp | 19 - .../munin/spec/acceptance/class_spec.rb | 30 -- .../spec/acceptance/munin__master_spec.rb | 20 - .../munin/spec/acceptance/munin__node_spec.rb | 25 - .../acceptance/nodesets/centos-511-x64.yml | 12 - .../acceptance/nodesets/centos-66-x64.yml | 11 - .../spec/acceptance/nodesets/centos-7-x64.yml | 11 - .../acceptance/nodesets/debian-609-x64.yml | 12 - .../acceptance/nodesets/debian-78-x64.yml | 12 - .../spec/acceptance/nodesets/debian-8-x64.yml | 11 - .../spec/acceptance/nodesets/default.yml | 12 - .../acceptance/nodesets/fedora-20-x64.yml | 12 - .../acceptance/nodesets/ubuntu-1204-x64.yml | 13 - .../acceptance/nodesets/ubuntu-1404-x64.yml | 12 - .../munin/spec/classes/coverage_spec.rb | 1 - .../munin/spec/classes/munin_master_spec.rb | 167 ------- .../munin/spec/classes/munin_node_spec.rb | 199 -------- .../munin/spec/defines/munin_plugin_spec.rb | 143 ------ ...ession_13_munin_plugin_config_name_spec.rb | 52 -- contrib-modules/munin/spec/spec_helper.rb | 20 - .../munin/spec/spec_helper_acceptance.rb | 22 - .../munin/CHANGELOG.md | 61 --- modules/munin/Gemfile | 17 + modules/munin/Guardfile | 11 + modules/munin/README.md | 212 ++++++++ modules/munin/Rakefile | 37 ++ modules/munin/checksums.json | 23 + .../munin/manifests/master.pp | 22 +- .../munin/manifests/master/node_definition.pp | 2 +- modules/munin/manifests/node.pp | 127 +++++ .../munin/manifests/params/master.pp | 6 - .../munin/manifests/params/node.pp | 16 +- .../munin/manifests/plugin.pp | 37 +- .../munin/metadata.json | 40 +- .../munin/spec/classes/munin_master_spec.rb | 155 ++++++ modules/munin/spec/classes/munin_node_spec.rb | 79 +++ .../munin/spec/defines/munin_plugin_spec.rb | 108 +++++ ...ession_13_munin_plugin_config_name_spec.rb | 30 ++ modules/munin/spec/spec_helper.rb | 34 ++ .../templates/master/node.definition.conf.erb | 2 +- .../munin/templates/munin-node.conf.erb | 24 +- .../munin/templates/munin.conf.erb | 0 .../munin/templates/plugin_conf.erb | 0 52 files changed, 890 insertions(+), 2082 deletions(-) delete mode 100644 contrib-modules/munin/CONTRIBUTING.md delete mode 100644 contrib-modules/munin/Gemfile delete mode 100644 contrib-modules/munin/Guardfile delete mode 100644 contrib-modules/munin/LICENSE delete mode 100644 contrib-modules/munin/README.md delete mode 100644 contrib-modules/munin/Rakefile delete mode 100644 contrib-modules/munin/checksums.json delete mode 100644 contrib-modules/munin/manifests/master/collect.pp delete mode 100644 contrib-modules/munin/manifests/node.pp delete mode 100644 contrib-modules/munin/manifests/node/export.pp delete mode 100644 contrib-modules/munin/spec/acceptance/class_spec.rb delete mode 100644 contrib-modules/munin/spec/acceptance/munin__master_spec.rb delete mode 100644 contrib-modules/munin/spec/acceptance/munin__node_spec.rb delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/centos-511-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/centos-66-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/centos-7-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/debian-609-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/debian-78-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/debian-8-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/default.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/fedora-20-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1204-x64.yml delete mode 100644 contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1404-x64.yml delete mode 100644 contrib-modules/munin/spec/classes/coverage_spec.rb delete mode 100644 contrib-modules/munin/spec/classes/munin_master_spec.rb delete mode 100644 contrib-modules/munin/spec/classes/munin_node_spec.rb delete mode 100644 contrib-modules/munin/spec/defines/munin_plugin_spec.rb delete mode 100644 contrib-modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb delete mode 100644 contrib-modules/munin/spec/spec_helper.rb delete mode 100644 contrib-modules/munin/spec/spec_helper_acceptance.rb rename {contrib-modules => modules}/munin/CHANGELOG.md (60%) create mode 100644 modules/munin/Gemfile create mode 100644 modules/munin/Guardfile create mode 100644 modules/munin/README.md create mode 100644 modules/munin/Rakefile create mode 100644 modules/munin/checksums.json rename {contrib-modules => modules}/munin/manifests/master.pp (89%) rename {contrib-modules => modules}/munin/manifests/master/node_definition.pp (99%) create mode 100644 modules/munin/manifests/node.pp rename {contrib-modules => modules}/munin/manifests/params/master.pp (82%) rename {contrib-modules => modules}/munin/manifests/params/node.pp (83%) rename {contrib-modules => modules}/munin/manifests/plugin.pp (65%) rename {contrib-modules => modules}/munin/metadata.json (76%) create mode 100644 modules/munin/spec/classes/munin_master_spec.rb create mode 100644 modules/munin/spec/classes/munin_node_spec.rb create mode 100644 modules/munin/spec/defines/munin_plugin_spec.rb create mode 100644 modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb create mode 100644 modules/munin/spec/spec_helper.rb rename {contrib-modules => modules}/munin/templates/master/node.definition.conf.erb (75%) rename {contrib-modules => modules}/munin/templates/munin-node.conf.erb (68%) rename {contrib-modules => modules}/munin/templates/munin.conf.erb (100%) rename {contrib-modules => modules}/munin/templates/plugin_conf.erb (100%) diff --git a/contrib-modules/munin/CONTRIBUTING.md b/contrib-modules/munin/CONTRIBUTING.md deleted file mode 100644 index 36d07a82..00000000 --- a/contrib-modules/munin/CONTRIBUTING.md +++ /dev/null @@ -1,92 +0,0 @@ -This module has grown over time based on a range of contributions from -people using it. If you follow these contributing guidelines your patch -will likely make it into a release a little quicker. - - -## Contributing - -1. Fork the repo. - -2. Run the tests. We only take pull requests with passing tests, and - it's great to know that you have a clean slate. - -3. Add a test for your change. Only refactoring and documentation - changes require no new tests. If you are adding functionality - or fixing a bug, please add a test. - -4. Make the test pass. - -5. Push to your fork and submit a pull request. - - -## Dependencies - -The testing and development tools have a bunch of dependencies, -all managed by [Bundler](http://bundler.io/) according to the -[Puppet support matrix](http://docs.puppetlabs.com/guides/platforms.html#ruby-versions). - -By default the tests use a baseline version of Puppet. - -If you have Ruby 2.x or want a specific version of Puppet, -you must set an environment variable such as: - - export PUPPET_VERSION="~> 3.2.0" - -Install the dependencies like so... - - bundle install - -## Syntax and style - -The test suite will run [Puppet Lint](http://puppet-lint.com/) and -[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to -check various syntax and style things. You can run these locally with: - - bundle exec rake lint - bundle exec rake syntax - -## Running the unit tests - -The unit test suite covers most of the code, as mentioned above please -add tests if you're adding new functionality. If you've not used -[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask -about how best to test your new feature. Running the test suite is done -with: - - bundle exec rake spec - -Note also you can run the syntax, style and unit tests in one go with: - - bundle exec rake test - -### Automatically run the tests - -During development of your puppet module you might want to run your unit -tests a couple of times. You can use the following command to automate -running the unit tests on every change made in the manifests folder. - - bundle exec guard - -## Integration tests - -The unit tests just check the code runs, not that it does exactly what -we want on a real machine. For that we're using -[Beaker](https://github.com/puppetlabs/beaker). - -Beaker fires up a new virtual machine (using Vagrant) and runs a series of -simple tests against it after applying the module. You can run our -Beaker tests with: - - bundle exec rake acceptance - -This will use the host described in `spec/acceptance/nodeset/default.yml` -by default. To run against another host, set the `BEAKER_set` environment -variable to the name of a host described by a `.yml` file in the -`nodeset` directory. For example, to run against CentOS 6.4: - - BEAKER_set=centos-64-x64 bundle exec rake acceptance - -If you don't want to have to recreate the virtual machine every time you -can use `BEAKER_destroy=no` and `BEAKER_provision=no`. On the first run you will -at least need `BEAKER_provision` set to yes (the default). The Vagrantfile -for the created virtual machines will be in `.vagrant/beaker_vagrant_files`. diff --git a/contrib-modules/munin/Gemfile b/contrib-modules/munin/Gemfile deleted file mode 100644 index ca3fd4e6..00000000 --- a/contrib-modules/munin/Gemfile +++ /dev/null @@ -1,33 +0,0 @@ -source "https://rubygems.org/" - -group :test do - gem "rake" - gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 3.8.0' - gem "rspec", '< 3.2.0' - gem "rspec-puppet" - gem "puppetlabs_spec_helper" - gem "metadata-json-lint" - gem "rspec-puppet-facts" - gem 'rubocop', '0.33.0' - gem 'simplecov', '>= 0.11.0' - gem 'simplecov-console' - - gem "puppet-lint-absolute_classname-check" - gem "puppet-lint-leading_zero-check" - gem "puppet-lint-trailing_comma-check" - gem "puppet-lint-version_comparison-check" - gem "puppet-lint-classes_and_types_beginning_with_digits-check" - gem "puppet-lint-unquoted_string-check" -end - -group :development do - gem "travis" - gem "travis-lint" - gem "guard-rake" -end - -group :system_tests do - gem "beaker" - gem "beaker-rspec" - gem "beaker-puppet_install_helper" -end diff --git a/contrib-modules/munin/Guardfile b/contrib-modules/munin/Guardfile deleted file mode 100644 index fd50602a..00000000 --- a/contrib-modules/munin/Guardfile +++ /dev/null @@ -1,5 +0,0 @@ -notification :off - -guard 'rake', :task => 'test' do - watch(%r{^manifests\/(.+)\.pp$}) -end diff --git a/contrib-modules/munin/LICENSE b/contrib-modules/munin/LICENSE deleted file mode 100644 index 9f710553..00000000 --- a/contrib-modules/munin/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - diff --git a/contrib-modules/munin/README.md b/contrib-modules/munin/README.md deleted file mode 100644 index cde6b122..00000000 --- a/contrib-modules/munin/README.md +++ /dev/null @@ -1,457 +0,0 @@ -# Puppet module ssm-munin # - -[![Puppet Forge](http://img.shields.io/puppetforge/v/ssm/munin.svg)](https://forge.puppetlabs.com/ssm/munin) -[![Build Status](https://travis-ci.org/ssm/ssm-munin.png?branch=master)](https://travis-ci.org/ssm/ssm-munin) - - -**Table of Contents** - -- [Puppet module ssm-munin](#puppet-module-ssm-munin) -- [Overview](#overview) -- [Module Description](#module-description) -- [Setup](#setup) - - [Setup requirements](#setup-requirements) -- [Usage](#usage) - - [munin::node](#muninnode) - - [munin::master](#muninmaster) - - [munin::master::node_definition](#muninmasternodedefinition) - - [munin::plugin](#muninplugin) -- [Examples](#examples) - - [munin::master::node_definition](#muninmasternodedefinition) - - [Static node definitions](#static-node-definitions) - - [node definitions as class parameter](#node-definitions-as-class-parameter) - - [node definitions with hiera](#node-definitions-with-hiera) - - [munin::node](#muninnode) - - [Allow remote masters to connect](#allow-remote-masters-to-connect) - - [munin::plugin](#muninplugin) - - [Activate a plugin](#activate-a-plugin) - - [Install and activate a plugin](#install-and-activate-a-plugin) - - [Activate wildcard plugin](#activate-wildcard-plugin) - - [Plugin with configuration](#plugin-with-configuration) - - [A plugin configuration file](#a-plugin-configuration-file) - - - -# Overview # - -Configure munin master, node and plugins. - - -# Module Description # - -This module installs the munin master using the **munin::master** -class, munin node using the **munin::node** class, and can install, -configure and manage munin plugins using the **munin::plugin** defined -type. - -Munin nodes are automatically exported by the munin nodes, and -collected on the munin master. (Requires puppetdb) - -# Setup # - -Classify all nodes with **munin::node**, and classify at least one -node with **munin::master**. Use the **munin::plugin** defined type to -control plugin installation and configuration. - - -## Setup requirements ## - -Munin should be available in most distributions. For RedHat OS -Family, you need to install the EPEL source. - -The **munin::master** class does not manage any web server -configuration. The munin package installed might add some. - - -# Usage # - -## munin::node ## - -Typical usage - - include munin::node - -Installs a munin node. - -By default, **munin::node** exports a munin node definition so a node -classified with the **munin::master** class can collect it. - -Parameters for exporting a munin node definition - -* **address**: The address used in the munin master node definition. - -* **export_node**: "enabled" or "disabled". Defaults to "enabled". - Causes the node config to be exported to puppetmaster. - -* **masterconfig**: List of configuration lines to append to the munin - master node definitinon - -* **mastername**: The name of the munin master server which will - collect the node definition. - -* **mastergroup**: The group used on the master to construct a FQN for - this node. Defaults to "", which in turn makes munin master use the - domain. Note: changing this for a node also means you need to move - rrd files on the master, or graph history will be lost. - -Parameters for the munin node service and configuration - -* **allow**: List of IPv4 and IPv6 addresses and networks to allow to - connect. - -* **bind_address**: The IP address the munin-node process listens - on. Defaults: *. - -* **bind_port**: The port number the munin-node process listens on. - -* **config_root**: Root directory for munin configuration. - -* **host_name**: The host name munin node identifies as. Defaults to - the $::fqdn fact. - -* **log_dir**: The log directory for the munin node process. Defaults - change according to osfamily, see munin::params::node for details. - -* **log_file**: Appended to "log_dir". Defaults to "munin-node.log". - -* **log_destination**: "file" or "syslog". Defaults to "file". If - log_destination is "syslog", the "log_file" and "log_dir" parameters - are ignored, and the "syslog_*" parameters are used if set. - -* **purge_configs**: Removes all other munin plugins and munin plugin - configuration files. Boolean, defaults to false. - -* **syslog_facility**: Defaults to undef, which makes munin-node use - the perl Net::Server module default of "daemon". Possible values are - any syslog facility by number, or lowercase name. - -* **plugins**: A hash used by create_resources to create munin::plugin - instances. - -* **package_name**: The name of the munin node package to install. - -* **service_name**: The name of the munin node service. - -* **service_ensure**: Defaults to "". If set to "running" or - "stopped", it is used as parameter "ensure" for the munin node - service. - -* **file_group**: The UNIX group name owning the configuration files, - log files, etc. - -* **timeout**: Used to set the global plugin runtime timeout for this - node. Integer. (optional, no default) - -* **nodeconfig**: Array of extra configuration lines to append to the - munin node configuration. (optional, no default) - - -## munin::master ## - -Typical usage: - - include munin::master - -Installs a munin master. - -By default, **munin::master** collects all munin node definitions -exported by nodes classified with **munin::node**/ - -Parameters for collecting and defining munin nodes - -* **collect_nodes**: 'enabled' (default), 'disabled', 'mine' or -'unclaimed'. 'enabled' makes the munin master collect all exported -node\_definitions. 'disabled' disables it. 'mine' makes the munin -master collect nodes matching **$munin::master::host_name**, while -'unclaimed' makes the munin master collect nodes not tagged with a -host name. - -* **host_name**: A host name for this munin master, matched with -munin::node::mastername for collecting nodes. Defaults to $::fqdn - -* **node_definitions**: A hash of node definitions used by -create_resources (optional, default: {}) - -Parameters for the munin master configuration - -* **config_root**: the root directory of the munin master -configuration. (Default is "/etc/munin" on most platforms). - -* **dbdir**: Path to the munin dbdir, where munin stores everything - -* **graph_strategy**: 'cgi' (default) or 'cron' Controls if -munin-graph graphs all services ('cron') or if graphing is done by -munin-cgi-graph (which must configured seperatly) - -* **htmldir**: Path to where munin will generate HTML documents and -graphs, used if graph_strategy is cron. - -* **html_strategy**: 'cgi' (default) or 'cron' Controls if munin-html -will recreate all html pages every run interval ('cron') or if html -pages are generated by munin-cgi-graph (which must configured -seperatly) - -* **rundir**: Path to directory munin uses for pid and lock files. - -* **tls**: 'enabled' or 'disabled' (default). Controls the use of TLS -globally for master to node communications. - -* **tls_certificate**: Path to a file containing a TLS certificate. No -default. Required if tls is enabled. - -* **tls_private_key**: Path to a file containing a TLS key. No -default. Required if tls is enabled. - -* **tls_verify_certificate**: 'yes' (default) or 'no'. - -* **extra_config**: Extra lines of config to put in munin.conf. - -## munin::master::node_definition ## - -Typical usage: - - munin::master::node_definition { 'fqn': - address => $address, - config => ['additional', 'configuration' 'lines'], - } - -This will add configuration for the munin master to connect to a munin -node, and ask for data from its munin plugins. - -Note: By default, the node classified with **munin::master** will -collect all all exported instances of this type from hosts classified -with **munin::node**. - -The resource title is used as the munin FQN, or "fully qualified -name". This defines the node name and group. It is common to use the -host's fully qualified domain name, where the domain name will be -implicitly used as the node group. - -Parameters - -* **address**: The address of the munin node. A hostname, an IP -address, or a ssh:// uri for munin-async node. (**required**, no -default) - -* **mastername**: The name of the munin master server which will -collect the node definition. (**optional**, no default) - -* **config**: An array of configuration lines to be added to the node -definition. (**optional**, no default) - -For more information about configuring a munin node definition, see -http://munin.readthedocs.org/en/latest/reference/munin.conf.html#node-definitions - -If you have multiple munin master servers in your infrastructure and -want to assign different nodes to different masters, you can specify -the master's fully qualified domain name on the node's definition: - - munin::master::node_definition { 'fqn': - address => $address, - mastername => 'munin.example.com', - } - - -## munin::plugin ## - -The defined type munin::plugin is used to control the munin plugins -used on a munin node. - -Typical usage: - - munin::plugin { 'cpu': - ensure => link, - } - -Parameters: - -* **ensure**: "link", "present", "absent" or "". (optional, default is -""). The ensure parameter is mandatory for installing a plugin, and -interacts with the **source** and **target** parameters (see below). - -* **source**: when ensure => present, source file. (optional) - -* **target**: when ensure => link, link target. If target is an -absolute path (starts with "/") it is used directly. If target is a -relative path, $munin::node::plugin_share_dir is prepended. (optional) - -* **config**: array of lines for munin plugin config - -* **config_label**: label for munin plugin config - -When using "**ensure** => link", a symlink is created from -/etc/munin/plugins/$title to what the optional **target** parameter -contains, or to /usr/share/munin/plugins/$title if that is not set. - -When using "**ensure** => present", you need to provide the **source** -parameter as well. - -When **ensure** is not set, a plugin will not be installed, but extra -plugin configuration can be managed with the **config** and -**config_label** parameters. - -# Examples # - -## munin::master::node_definition ## - - -### Static node definitions ### - -The munin master class will collect all -"munin::master::node_definition" exported by "munin::node". - -For extra nodes, you can define them in hiera, and munin::master will -create them. Example: - - munin::master::node_definition { 'foo.example.com': - address => '192.0.2.1' - } - munin::master::node_definition { 'bar.example.com': - address => '192.0.2.1', - config => [ 'load.graph_future 30', - 'load.load.trend yes', - 'load.load.predict 86400,12' ], - } - - -### node definitions as class parameter ### - -If you define your nodes as a data structure in a puppet manifest, or from the -puppet External Node Classifier, you can use a class parameter: - - $nodes = { ... } - - class { 'puppet::master': - node_definitions => $nodes, - } - - -### node definitions with hiera ### - -A JSON definition. - - { - "munin::master::node_definitions" : { - "foo.example.com" : { - "address" : "192.0.2.1" - }, - "bar.example.com" : { - "address" : "192.0.2.2", - "config" : [ - "load.graph_future 30", - "load.load.trend yes", - "load.load.predict 86400,12" - ] - } - } - } - - -A YAML definition - - --- - munin::master::node_definitions: - foo.example.com: - address: 192.0.2.1 - bar.example.com: - address: 192.0.2.2 - config: - - load.graph_future 30 - - load.load.trend yes - - load.load.predict 86400,12 - -## munin::node ## - -### Allow remote masters to connect ### - -The **allow** parameter enables the munin master to connect. By -default, the munin node only permits connections from localhost. - - class { 'munin::node': - allow => [ '192.0.2.0/24', '2001:db8::/64' ] - } - -or in hiera: - - --- - munin::node::allow: - - 192.0.2.0/24 - - 2001:db8::/64 - -Installs munin-node, and exports a munin::master::node_definition -which munin::master will collect, and allows munin masters on -specified networks to connect. - - -## munin::plugin ## - -### Activate a plugin ### - -Here, we activate an already installed plugin. - -The use of "ensure => link" creates an implicit "target => -/usr/share/munin/plugins/$title". - -The "target" parameter can be set to an absolute path (starting with a -"/"), or a relative path (anything else). If relative, -$munin::params::node::plugin_share_dir is prepended to the path. - - munin::plugin { - 'apt': - ensure => link; - 'something': - ensure => link, - target => '/usr/local/share/munin/plugins/something'; - 'ip_eth0': - ensure => link, - target => 'ip_'; # becomes $munin::params::node::plugin_share_dir/ip_ - } - - -### Install and activate a plugin ### - -The use of "ensure => present" creates a file in /etc/munin/plugins - - munin::plugin { 'somedaemon': - ensure => present, - source => 'puppet:///modules/munin/plugins/somedaemon', - } - -### Activate wildcard plugin ### - -A pair of plugins we provide, with a _name symlink (This is also known -as "wildcard" plugins) - - munin::plugin { - 'foo_bar': - ensure => present, - target => 'foo_', - source => 'puppet:///modules/munin/plugins/foo_'; - 'foo_baz': - ensure => present, - target => 'foo_', - source => 'puppet:///modules/munin/plugins/foo_'; - } - -### Plugin with configuration ### - -This creates an additional "/etc/munin/plugin-conf.d/${title}.conf" - - munin::plugin { - 'bletch': - ensure => link, - config => 'env.database flumpelump'; - 'thud': - ensure => present, - source => 'puppet:///modules/munin/plugins/thud', - config => ['env.database zotto', 'user root']; - } - -### A plugin configuration file ### - -This only adds a plugin configuration file. - - munin::plugin { 'slapd': - config => ['env.rootdn cn=admin,dc=example,dc=org'], - config_label => 'slapd_*', - } diff --git a/contrib-modules/munin/Rakefile b/contrib-modules/munin/Rakefile deleted file mode 100644 index 8ac719ec..00000000 --- a/contrib-modules/munin/Rakefile +++ /dev/null @@ -1,62 +0,0 @@ -require 'rubygems' -require 'bundler/setup' - -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet/version' -require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6 -require 'puppet-lint/tasks/puppet-lint' -require 'puppet-syntax/tasks/puppet-syntax' -require 'metadata-json-lint/rake_task' -require 'rubocop/rake_task' - -# These gems aren't always present, for instance -# on Travis with --without development -begin -rescue LoadError # rubocop:disable Lint/HandleExceptions -end - -RuboCop::RakeTask.new - -exclude_paths = [ - "bundle/**/*", - "pkg/**/*", - "vendor/**/*", - "spec/**/*", -] - -# Coverage from puppetlabs-spec-helper requires rcov which -# doesn't work in anything since 1.8.7 -Rake::Task[:coverage].clear - -Rake::Task[:lint].clear - -PuppetLint.configuration.relative = true -PuppetLint.configuration.disable_80chars -PuppetLint.configuration.disable_class_inherits_from_params_class -PuppetLint.configuration.disable_class_parameter_defaults -PuppetLint.configuration.fail_on_warnings = true - -PuppetLint::RakeTask.new :lint do |config| - config.ignore_paths = exclude_paths -end - -PuppetSyntax.exclude_paths = exclude_paths - -desc "Run acceptance tests" -RSpec::Core::RakeTask.new(:acceptance) do |t| - t.pattern = 'spec/acceptance' -end - -desc "Populate CONTRIBUTORS file" -task :contributors do - system("git log --format='%aN' | sort -u > CONTRIBUTORS") -end - -desc "Run syntax, lint, and spec tests." -task :test => [ - :metadata_lint, - :syntax, - :lint, - :rubocop, - :spec, -] diff --git a/contrib-modules/munin/checksums.json b/contrib-modules/munin/checksums.json deleted file mode 100644 index e85361f7..00000000 --- a/contrib-modules/munin/checksums.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "CHANGELOG.md": "8c781a3224c59786c9bece8ef8357d9c", - "CONTRIBUTING.md": "55506ed83f2a251cf9fdf76695dce4e3", - "Gemfile": "20308c961e219e4ae3ebb8367acd9de9", - "Guardfile": "3ae8d9a61b870350cc1c8e0d6a9a36e7", - "LICENSE": "47bbee59c4c1cb14cc3667035a227be0", - "README.md": "453e75d72435d20ed6aeac4c1ba08d9e", - "Rakefile": "4f7c27f1112026c72b732516f6cfef32", - "manifests/master/collect.pp": "b169585a97ab89b6f5ef0646e2d7c4d6", - "manifests/master/node_definition.pp": "92ceedf2f2ac3b53acc8c4175de18a9f", - "manifests/master.pp": "cae4fe497bbae654dc19cfc6bc2d595a", - "manifests/node/export.pp": "1adb79a7bfe1d467e05e66c6a14e184a", - "manifests/node.pp": "01c37c9e9161afa8b2b1f749a51b8018", - "manifests/params/master.pp": "7162a8fa9243e35cd8ed8dd44df9ce97", - "manifests/params/node.pp": "71a367547e83b4956962830a2c47f34b", - "manifests/plugin.pp": "6b3dd71dab9b65d3527b76484ceb10dd", - "metadata.json": "846e89dc3414823e8a1ccb3e1b8981dd", - "spec/acceptance/class_spec.rb": "ec1f62620e85de548249c19194ba6f7c", - "spec/acceptance/munin__master_spec.rb": "d0aa42fced8a7dc9920fe5a0363e6359", - "spec/acceptance/munin__node_spec.rb": "ac5c1af8b008abc37c7bc49031259c10", - "spec/acceptance/nodesets/centos-511-x64.yml": "19f4339a9395ce5ef8e19cd66844e9b1", - "spec/acceptance/nodesets/centos-66-x64.yml": "b0b1129ab2f45b449bb9fea565bad5e0", - "spec/acceptance/nodesets/centos-7-x64.yml": "31c23abc0148831753e5c2a847ccdd11", - "spec/acceptance/nodesets/debian-609-x64.yml": "2c970ef6fb9856b66c1c11d0cb5a475b", - "spec/acceptance/nodesets/debian-78-x64.yml": "bafbd2b57400c80f6f578bd5d53310f6", - "spec/acceptance/nodesets/debian-8-x64.yml": "137b813bd4622b7819a264c15c0f15ba", - "spec/acceptance/nodesets/default.yml": "bafbd2b57400c80f6f578bd5d53310f6", - "spec/acceptance/nodesets/fedora-20-x64.yml": "92a9666895bab2ff3248b27a3458dfc0", - "spec/acceptance/nodesets/ubuntu-1204-x64.yml": "43a33a7a157e531b4906d60d43e5ebba", - "spec/acceptance/nodesets/ubuntu-1404-x64.yml": "608d94367f0d67e80a80202846ffd153", - "spec/classes/coverage_spec.rb": "5b6dfa0dd426aca0ccfae23c0a629f0b", - "spec/classes/munin_master_spec.rb": "72b72712b80e7164a9e511a26234a41c", - "spec/classes/munin_node_spec.rb": "b45eb87904f37cefafdf6a04a8b31dc1", - "spec/defines/munin_plugin_spec.rb": "bce90fed8a0044167202e8de6cc5380a", - "spec/defines/regression_13_munin_plugin_config_name_spec.rb": "4f94c0d7c47a997892585e15111fd2ac", - "spec/spec_helper.rb": "d8e9db823ffeb72d921583ec558b756c", - "spec/spec_helper_acceptance.rb": "054cadb73414e891850969620f0ea9b6", - "templates/master/node.definition.conf.erb": "115bf8e20a5128006dcc9a5c0f346118", - "templates/munin-node.conf.erb": "4a9da105f5ca16be27bf397332d234c9", - "templates/munin.conf.erb": "aed4f1d629c58260a87e9f71e45b018f", - "templates/plugin_conf.erb": "e4d0fd7c2e1d5421481efd10ebd5a078" -} \ No newline at end of file diff --git a/contrib-modules/munin/manifests/master/collect.pp b/contrib-modules/munin/manifests/master/collect.pp deleted file mode 100644 index 875f07d6..00000000 --- a/contrib-modules/munin/manifests/master/collect.pp +++ /dev/null @@ -1,30 +0,0 @@ -# Class to collect the exported munin nodes. -# -# This is separated into its own class to avoid warnings about missing -# storeconfigs. -# - -class munin::master::collect ( - $collect_nodes, - $host_name, -) -{ - case $collect_nodes { - 'enabled': { - Munin::Master::Node_definition <<| |>> - } - 'mine': { - # Collect nodes explicitly tagged with this master - Munin::Master::Node_definition <<| tag == "munin::master::${host_name}" |>> - } - 'unclaimed': { - # Collect all exported node definitions, except the ones tagged - # for a specific master - Munin::Master::Node_definition <<| tag == 'munin::master::' |>> - } - 'disabled', - default: { - # do nothing - } - } -} diff --git a/contrib-modules/munin/manifests/node.pp b/contrib-modules/munin/manifests/node.pp deleted file mode 100644 index 423d5b92..00000000 --- a/contrib-modules/munin/manifests/node.pp +++ /dev/null @@ -1,190 +0,0 @@ -# munin::node - Configure a munin node, and export configuration a -# munin master can collect. -# -# Parameters: -# -# allow: List of IPv4 and IPv6 addresses and networks to allow to connect. -# -# config_root: Root directory for munin configuration. -# -# nodeconfig: List of lines to append to the munin node configuration. -# -# host_name: The host name munin node identifies as. Defaults to -# the $::fqdn fact. -# -# log_dir: The log directory for the munin node process. Defaults -# change according to osfamily, see munin::params::node for details. -# -# log_file: Appended to "log_dir". Defaults to "munin-node.log". -# -# log_destination: "file" or "syslog". Defaults to "file". If log_destination -# is "syslog", the "log_file" and "log_dir" parameters are ignored, and the -# "syslog_*" parameters are used if set. -# -# purge_configs: Removes all other munin plugins and munin plugin -# configuration files. Boolean, defaults to false. -# -# syslog_facility: Defaults to undef, which makes munin-node use the -# perl Net::Server module default of "daemon". Possible values are any -# syslog facility by number, or lowercase name. -# -# masterconfig: List of configuration lines to append to the munin -# master node definitinon -# -# mastername: The name of the munin master server which will collect -# the node definition. -# -# mastergroup: The group used on the master to construct a FQN for -# this node. Defaults to "", which in turn makes munin master use the -# domain. Note: changing this for a node also means you need to move -# rrd files on the master, or graph history will be lost. -# -# plugins: A hash used by create_resources to create munin::plugin -# instances. -# -# address: The address used in the munin master node definition. -# -# bind_address: The IP address the munin-node process listens on. Defaults: *. -# -# bind_port: The port number the munin-node process listens on. -# -# package_name: The name of the munin node package to install. -# -# service_name: The name of the munin node service. -# -# service_ensure: Defaults to "". If set to "running" or "stopped", it -# is used as parameter "ensure" for the munin node service. -# -# export_node: "enabled" or "disabled". Defaults to "enabled". -# Causes the node config to be exported to puppetmaster. -# -# file_group: The UNIX group name owning the configuration files, -# log files, etc. -# -# timeout: Used to set the global plugin runtime timeout for this -# node. Integer. Defaults to undef, which lets munin-node use its -# default of 10 seconds. - -class munin::node ( - $address = $munin::params::node::address, - $allow = $munin::params::node::allow, - $bind_address = $munin::params::node::bind_address, - $bind_port = $munin::params::node::bind_port, - $config_root = $munin::params::node::config_root, - $host_name = $munin::params::node::host_name, - $log_dir = $munin::params::node::log_dir, - $log_file = $munin::params::node::log_file, - $masterconfig = $munin::params::node::masterconfig, - $mastergroup = $munin::params::node::mastergroup, - $mastername = $munin::params::node::mastername, - $nodeconfig = $munin::params::node::nodeconfig, - $package_name = $munin::params::node::package_name, - $plugins = $munin::params::node::plugins, - $purge_configs = $munin::params::node::purge_configs, - $service_ensure = $munin::params::node::service_ensure, - $service_name = $munin::params::node::service_name, - $export_node = $munin::params::node::export_node, - $file_group = $munin::params::node::file_group, - $log_destination = $munin::params::node::log_destination, - $syslog_facility = $munin::params::node::syslog_facility, - $timeout = $munin::params::node::timeout, -) inherits munin::params::node { - - validate_array($allow) - validate_array($nodeconfig) - validate_array($masterconfig) - if $mastergroup { validate_string($mastergroup) } - if $mastername { validate_string($mastername) } - validate_hash($plugins) - validate_string($address) - validate_absolute_path($config_root) - validate_string($package_name) - validate_string($service_name) - if $service_ensure { validate_re($service_ensure, '^(running|stopped)$') } - validate_re($export_node, '^(enabled|disabled)$') - validate_absolute_path($log_dir) - validate_re($log_destination, '^(?:file|syslog)$') - validate_string($log_file) - validate_string($file_group) - validate_bool($purge_configs) - if $timeout { validate_integer($timeout) } - - case $log_destination { - 'file': { - $_log_file = "${log_dir}/${log_file}" - validate_absolute_path($_log_file) - } - 'syslog': { - $_log_file = 'Sys::Syslog' - if $syslog_facility { - validate_string($syslog_facility) - validate_re($syslog_facility, - '^(?:\d+|(?:kern|user|mail|daemon|auth|syslog|lpr|news|uucp|authpriv|ftp|cron|local[0-7]))$') - } - } - default: { - fail('log_destination is not set') - } - } - - if $mastergroup { - $fqn = "${mastergroup};${host_name}" - } - else { - $fqn = $host_name - } - - if $service_ensure { $_service_ensure = $service_ensure } - else { $_service_ensure = undef } - - # Defaults - File { - ensure => present, - owner => 'root', - group => $file_group, - mode => '0444', - } - - package { $package_name: - ensure => installed, - } - - service { $service_name: - ensure => $_service_ensure, - enable => true, - require => Package[$package_name], - } - - file { "${config_root}/munin-node.conf": - content => template('munin/munin-node.conf.erb'), - require => Package[$package_name], - notify => Service[$service_name], - } - - # Export a node definition to be collected by the munin master. - # (Separated into its own class to prevent warnings about "missing - # storeconfigs", even if $export_node is not enabled) - if $export_node == 'enabled' { - class { '::munin::node::export': - address => $address, - fqn => $fqn, - mastername => $mastername, - masterconfig => $masterconfig, - } - } - - # Generate plugin resources from hiera or class parameter. - create_resources(munin::plugin, $plugins, {}) - - # Purge unmanaged plugins and plugin configuration files. - if $purge_configs { - file { ["${config_root}/plugins", "${config_root}/plugin-conf.d" ]: - ensure => directory, - recurse => true, - purge => true, - require => Package[$package_name], - notify => Service[$service_name], - } - } - -} diff --git a/contrib-modules/munin/manifests/node/export.pp b/contrib-modules/munin/manifests/node/export.pp deleted file mode 100644 index 49130fa4..00000000 --- a/contrib-modules/munin/manifests/node/export.pp +++ /dev/null @@ -1,19 +0,0 @@ -# Class to export the munin node. -# -# This is separated into its own class to avoid warnings about missing -# storeconfigs. -# -class munin::node::export ( - $address, - $fqn, - $masterconfig, - $mastername, -) -{ - @@munin::master::node_definition{ $fqn: - address => $address, - mastername => $mastername, - config => $masterconfig, - tag => [ "munin::master::${mastername}" ], - } -} diff --git a/contrib-modules/munin/spec/acceptance/class_spec.rb b/contrib-modules/munin/spec/acceptance/class_spec.rb deleted file mode 100644 index 7cd8cdf2..00000000 --- a/contrib-modules/munin/spec/acceptance/class_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'munin and munin-node' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'should work idempotently with no errors' do - pp = <<-EOS - class { 'munin::master': } - class { 'munin::node': } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) - end - - describe package('munin') do - it { is_expected.to be_installed } - end - - describe package('munin-node') do - it { is_expected.to be_installed } - end - - describe service('munin-node') do - it { is_expected.to be_enabled } - it { is_expected.to be_running } - end - end -end diff --git a/contrib-modules/munin/spec/acceptance/munin__master_spec.rb b/contrib-modules/munin/spec/acceptance/munin__master_spec.rb deleted file mode 100644 index 4e045f79..00000000 --- a/contrib-modules/munin/spec/acceptance/munin__master_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'munin::master class' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'should work idempotently with no errors' do - pp = <<-EOS - class { 'munin::master': } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) - end - - describe package('munin') do - it { is_expected.to be_installed } - end - end -end diff --git a/contrib-modules/munin/spec/acceptance/munin__node_spec.rb b/contrib-modules/munin/spec/acceptance/munin__node_spec.rb deleted file mode 100644 index a338a404..00000000 --- a/contrib-modules/munin/spec/acceptance/munin__node_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'munin::node class' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'should work idempotently with no errors' do - pp = <<-EOS - class { 'munin::node': } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) - end - - describe package('munin-node') do - it { is_expected.to be_installed } - end - - describe service('munin-node') do - it { is_expected.to be_enabled } - it { is_expected.to be_running } - end - end -end diff --git a/contrib-modules/munin/spec/acceptance/nodesets/centos-511-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/centos-511-x64.yml deleted file mode 100644 index 155926dd..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/centos-511-x64.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - centos-511-x64: - roles: - - master - platform: el-5-x86_64 - box: puppetlabs/centos-5.11-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-5.11-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/centos-66-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/centos-66-x64.yml deleted file mode 100644 index 07843d5f..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/centos-66-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - centos-66-x64: - roles: - - master - platform: el-6-x86_64 - box: puppetlabs/centos-6.6-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-6.6-64-nocm - hypervisor: vagrant -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/centos-7-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/centos-7-x64.yml deleted file mode 100644 index 028a1b5e..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/centos-7-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - centos-7-x64: - roles: - - master - platform: el-7-x86_64 - box: puppetlabs/centos-7.0-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-7.0-64-nocm - hypervisor: vagrant -CONFIG: - log_level: verbose - type: foss \ No newline at end of file diff --git a/contrib-modules/munin/spec/acceptance/nodesets/debian-609-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/debian-609-x64.yml deleted file mode 100644 index e2451ea0..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/debian-609-x64.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - debian-609-x64: - roles: - - master - platform: debian-6-amd64 - box: puppetlabs/debian-6.0.9-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-6.0.9-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/debian-78-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/debian-78-x64.yml deleted file mode 100644 index c4062fd1..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/debian-78-x64.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - debian-78-x64: - roles: - - master - platform: debian-7-amd64 - box: puppetlabs/debian-7.8-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-7.8-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/debian-8-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/debian-8-x64.yml deleted file mode 100644 index 845be5a4..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/debian-8-x64.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - debian-8-amd64: - roles: - - master - platform: debian-8-amd64 - box: debian/jessie64 - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/default.yml b/contrib-modules/munin/spec/acceptance/nodesets/default.yml deleted file mode 100644 index c4062fd1..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - debian-78-x64: - roles: - - master - platform: debian-7-amd64 - box: puppetlabs/debian-7.8-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/debian-7.8-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/fedora-20-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/fedora-20-x64.yml deleted file mode 100644 index 138341f6..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/fedora-20-x64.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - fedora-20-x64: - roles: - - master - platform: el-7-x86_64 - box: chef/fedora-20 - box_url: https://vagrantcloud.com/chef/boxes/fedora-20 - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1204-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1204-x64.yml deleted file mode 100644 index b4e7d556..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1204-x64.yml +++ /dev/null @@ -1,13 +0,0 @@ -HOSTS: - ubuntu-1204-x64: - roles: - - master - platform: ubuntu-1204-amd64 - box: puppetlabs/ubuntu-12.04-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-12.04-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - color: false - type: foss diff --git a/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1404-x64.yml b/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1404-x64.yml deleted file mode 100644 index edc1d12d..00000000 --- a/contrib-modules/munin/spec/acceptance/nodesets/ubuntu-1404-x64.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - ubuntu-1404-x64: - roles: - - master - platform: ubuntu-1404-amd64 - box: puppetlabs/ubuntu-14.04-64-nocm - box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm - hypervisor: vagrant - -CONFIG: - log_level: verbose - type: foss diff --git a/contrib-modules/munin/spec/classes/coverage_spec.rb b/contrib-modules/munin/spec/classes/coverage_spec.rb deleted file mode 100644 index 12513b83..00000000 --- a/contrib-modules/munin/spec/classes/coverage_spec.rb +++ /dev/null @@ -1 +0,0 @@ -at_exit { RSpec::Puppet::Coverage.report! } diff --git a/contrib-modules/munin/spec/classes/munin_master_spec.rb b/contrib-modules/munin/spec/classes/munin_master_spec.rb deleted file mode 100644 index 0436f4e5..00000000 --- a/contrib-modules/munin/spec/classes/munin_master_spec.rb +++ /dev/null @@ -1,167 +0,0 @@ -require 'spec_helper' - -_conf_dir = {} -_conf_dir.default = '/etc/munin' -_conf_dir['Solaris'] = '/opt/local/etc/munin' -_conf_dir['FreeBSD'] = '/usr/local/etc/munin' - -describe 'munin::master' do - - on_supported_os.each do |os, facts| - - # Avoid testing on distributions similar to RedHat and Debian - next if /^(ubuntu|centos|scientific|oraclelinux)-/.match(os) - - # No need to test all os versions as long as os version is not - # used in the params class - next if /^(debian-[67]|redhat-[56]|freebsd-9)-/.match(os) - - context "on #{os}" do - let(:facts) do - facts - end - - conf_dir = _conf_dir[facts[:osfamily]] - - it { should compile.with_all_deps } - - it { should contain_package('munin') } - - context 'with default params' do - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/graph_strategy\s+cgi/) - .with_content(/html_strategy\s+cgi/) - end - - it do - should contain_file("#{conf_dir}/munin-conf.d") - .with_ensure('directory') - end - end - - context 'with html_strategy => cron' do - let (:params) { { :html_strategy => 'cron' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/html_strategy\s+cron/) - end - end - - context 'with graph_strategy => cron' do - let (:params) { { :graph_strategy => 'cron' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/graph_strategy\s+cron/) - end - end - - context 'with dbdir => /var/lib/munin' do - let (:params) { { :dbdir => '/var/lib/munin' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/dbdir\s+\/var\/lib\/munin/) - end - end - - context 'with htmldir => /var/www/munin' do - let (:params) { { :htmldir => '/var/www/munin' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/htmldir\s+\/var\/www\/munin/) - end - end - - context 'with logdir => /var/log/munin' do - let (:params) { { :dbdir => '/var/log/munin' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/dbdir\s+\/var\/log\/munin/) - end - end - - context 'with rundir => /var/run/munin' do - let (:params) { { :dbdir => '/var/run/munin' } } - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/dbdir\s+\/var\/run\/munin/) - end - end - - context 'with tls => enabled' do - let(:params) do - { - :tls => 'enabled', - :tls_certificate => '/path/to/certificate.pem', - :tls_private_key => '/path/to/key.pem', - :tls_verify_certificate => 'yes', - } - end - - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/tls = enabled/) - .with_content(/tls_certificate = \/path\/to\/certificate\.pem/) - .with_content(/tls_private_key = \/path\/to\/key\.pem/) - .with_content(/tls_verify_certificate = yes/) - end - end - - - context 'with extra_config' do - token = '1b7febce-bb2d-4c18-b889-84c73538a900' - let(:params) do - { :extra_config => [ token ] } - end - it { should compile.with_all_deps } - it do - should contain_file("#{conf_dir}/munin.conf") - .with_content(/#{token}/) - end - end - - context 'with extra_config set to a string' do - token = '1b7febce-bb2d-4c18-b889-84c73538a900' - let(:params) do - { :extra_config => token } - end - it { should raise_error(Puppet::Error, /is not an Array/) } - end - - ['test.example.com', 'invalid/hostname.example.com'].each do |param| - context "with host_name => #{param}" do - let(:params) do - { :host_name => param } - end - if param =~ /invalid/ - it { should raise_error(Puppet::Error, /valid domain name/) } - else - it { should compile.with_all_deps } - end - end - end - - %w( enabled disabled mine unclaimed invalid ).each do |param| - context "with collect_nodes => #{param}" do - let(:params) do - { :collect_nodes => param } - end - if param == 'invalid' - it { should raise_error(Puppet::Error, /validate_re/) } - else - it { should compile.with_all_deps } - end - end - end - - end # on os - end - -end diff --git a/contrib-modules/munin/spec/classes/munin_node_spec.rb b/contrib-modules/munin/spec/classes/munin_node_spec.rb deleted file mode 100644 index a95669a8..00000000 --- a/contrib-modules/munin/spec/classes/munin_node_spec.rb +++ /dev/null @@ -1,199 +0,0 @@ -require 'spec_helper' - -_conf_dir = {} -_conf_dir.default = '/etc/munin' -_conf_dir['DragonFly'] = '/usr/local/etc/munin' -_conf_dir['FreeBSD'] = '/usr/local/etc/munin' -_conf_dir['Solaris'] = '/opt/local/etc/munin' - -describe 'munin::node' do - - on_supported_os.each do |os, facts| - - # Avoid testing on distributions similar to RedHat and Debian - next if /^(ubuntu|centos|scientific|oraclelinux)-/.match(os) - - # No need to test all os versions as long as os version is not - # used in the params class - next if /^(debian-[67]|redhat-[56]|freebsd-9)-/.match(os) - - context "on #{os}" do - let(:facts) do - facts - end - - it { should compile.with_all_deps } - - it { should contain_package('munin-node') } - - munin_confdir = _conf_dir[facts[:osfamily]] - - munin_node_conf = "#{munin_confdir}/munin-node.conf" - munin_plugin_dir = "#{munin_confdir}/plugins" - munin_plugin_conf_dir = "#{munin_confdir}/plugin-conf.d" - - case facts[:osfamily] - when 'Solaris' - munin_node_service = 'smf:/munin-node' - else - munin_node_service = 'munin-node' - end - - case facts[:osfamily] - when 'Solaris' - log_dir = '/var/opt/log/munin' - when 'RedHat' - log_dir = '/var/log/munin-node' - else - log_dir = '/var/log/munin' - end - - it { should contain_service(munin_node_service) } - it { should contain_file(munin_node_conf) } - - context 'with no parameters' do - it { should compile.with_all_deps } - it do - should contain_service(munin_node_service) - .without_ensure() - end - it do - should contain_file(munin_node_conf) - .with_content(/host_name\s+foo.example.com/) - .with_content(/log_file\s+#{log_dir}\/munin-node.log/) - end - end - - context 'with parameter allow' do - let(:params) do - { allow: ['2001:db8:1::', - '2001:db8:2::/64', - '192.0.2.129', - '192.0.2.0/25', - '192\.0\.2'] - } - end - it { should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .with_content(/^cidr_allow 192.0.2.0\/25$/) - .with_content(/^cidr_allow 2001:db8:2::\/64$/) - .with_content(/^allow \^192\\.0\\.2\\.129\$$/) - .with_content(/^allow 192\\.0\\.2$/) - .with_content(/^allow \^2001:db8:1::\$$/) - end - end - - context 'with parameter host_name' do - let(:params) do - { host_name: 'something.example.com' } - end - it { should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .with_content(/host_name\s+something.example.com/) - end - end - - context 'with parameter service_ensure' do - let(:params) do - { service_ensure: 'running' } - end - it { should compile.with_all_deps } - it do - should contain_service('munin-node') - .with_ensure('running') - end - end - - context 'logging to syslog' do - context 'defaults' do - let(:params) do - { log_destination: 'syslog' } - end - it{ should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .with_content(/log_file\s+Sys::Syslog/) - end - end - - context 'with syslog options' do - let(:params) do - { log_destination: 'syslog', - syslog_facility: 'local1', - } - end - it{ should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .with_content(/log_file\s+Sys::Syslog/) - .with_content(/syslog_facility\s+local1/) - end - end - - context 'with syslog_facility set to wrong value ' do - let(:params) do - { log_destination: 'syslog', - syslog_facility: 'wrong', - } - end - it { expect { should compile.with_all_deps }.to raise_error(/validate_re/) } - end - end - - context 'purge_configs' do - context 'set' do - let(:params) { { purge_configs: true } } - it { should compile.with_all_deps } - it do - should contain_file(munin_plugin_dir) - .with_ensure('directory') - .with_recurse(true) - .with_purge(true) - end - it do - should contain_file(munin_plugin_conf_dir) - .with_ensure('directory') - .with_recurse(true) - .with_purge(true) - end - end - context 'unset' do - it { should compile.with_all_deps } - it { should_not contain_file(munin_plugin_dir) } - it { should_not contain_file(munin_plugin_conf_dir) } - end - end - - context 'timeout' do - context 'set' do - let(:params) { { timeout: 123 } } - it { should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .with_content(/^timeout 123/) - end - end - context 'unset' do - it { should compile.with_all_deps } - it do - should contain_file(munin_node_conf) - .without_content(/^timeout/) - end - end - end - - end - end - - context 'unsupported' do - include_context :unsupported - it do - expect do - should contain_class('munin::node') - end.to raise_error(Puppet::Error, /Unsupported osfamily/) - end - end - -end diff --git a/contrib-modules/munin/spec/defines/munin_plugin_spec.rb b/contrib-modules/munin/spec/defines/munin_plugin_spec.rb deleted file mode 100644 index f38ce967..00000000 --- a/contrib-modules/munin/spec/defines/munin_plugin_spec.rb +++ /dev/null @@ -1,143 +0,0 @@ -require 'spec_helper' - -_conf_dir = {} -_conf_dir.default = '/etc/munin' -_conf_dir['Solaris'] = '/opt/local/etc/munin' -_conf_dir['FreeBSD'] = '/usr/local/etc/munin' - -_share_dir = {} -_share_dir.default = '/usr/share/munin' -_share_dir['Solaris'] = '/opt/local/share/munin' -_share_dir['FreeBSD'] = '/usr/local/share/munin' - -describe 'munin::plugin', :type => 'define' do - - let(:title) { 'testplugin' } - - on_supported_os.each do |os, facts| - - # Avoid testing on distributions similar to RedHat and Debian - next if /^(ubuntu|centos|scientific|oraclelinux)-/.match(os) - - # No need to test all os versions as long as os version is not - # used in the params class - next if /^(debian-[67]|redhat-[56]|freebsd-9)-/.match(os) - - context "on #{os}" do - let(:facts) do - facts - end - - conf_dir = _conf_dir[facts[:osfamily]] - plugin_share_dir = "#{_share_dir[facts[:osfamily]]}/plugins" - - context 'with no parameters' do - it do - expect { should contain_file("#{conf_dir}/plugins/testplugin") } - .to raise_error("expected that the catalogue would contain File[#{conf_dir}/plugins/testplugin]") - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_ensure('absent') - end - end - - context 'with ensure=link parameter' do - let(:params) { { :ensure => 'link' } } - it do - should contain_file("#{conf_dir}/plugins/testplugin") - .with_ensure('link') - .with_target("#{plugin_share_dir}/testplugin") - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_ensure('absent') - end - end - - context 'with ensure=link and target parameters' do - let(:title) { 'test_foo' } - let(:params) do - { :ensure => 'link', - :target => 'test_' } - end - it do - should contain_file("#{conf_dir}/plugins/test_foo") - .with_ensure('link') - .with_target("#{plugin_share_dir}/test_") - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/test_foo.conf") - .with_ensure('absent') - end - end - - context 'with ensure=present and source parameters' do - let(:params) do - { :ensure => 'present', - :source => 'puppet:///modules/munin/plugins/testplugin' } - end - it do - should contain_file("#{conf_dir}/plugins/testplugin") - .with_ensure('present') - .with_source('puppet:///modules/munin/plugins/testplugin') - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_ensure('absent') - end - end - - context 'with ensure=present, source and config parameters' do - let(:params) do - { :ensure => 'present', - :source => 'puppet:///modules/munin/plugins/testplugin', - :config => [ 'something wonderful' ], - } - end - it do - should contain_file("#{conf_dir}/plugins/testplugin") - .with_ensure('present') - .with_source('puppet:///modules/munin/plugins/testplugin') - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_ensure('present') - .with_content(/something wonderful/) - end - end - - context 'only configuration' do - let(:params) do - { :config => ['env.rootdn cn=admin,dc=example,dc=org'], - :config_label => 'slapd_*', - } - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_ensure('present') - .with_content(/env.rootdn/) - - end - it do - expect { should contain_file("#{conf_dir}/plugins/testplugin") } - .to raise_error("expected that the catalogue would contain File[#{conf_dir}/plugins/testplugin]") - end - end - - context 'with absolute target' do - let(:params) do - { ensure: 'link', - target: '/full/path/to/testplugin' } - end - it do - should contain_file("#{conf_dir}/plugins/testplugin") - .with_ensure('link') - .with_target('/full/path/to/testplugin') - end - end - - end - end - -end diff --git a/contrib-modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb b/contrib-modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb deleted file mode 100644 index 862327c9..00000000 --- a/contrib-modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'spec_helper' - -_conf_dir = {} -_conf_dir.default = '/etc/munin' -_conf_dir['Solaris'] = '/opt/local/etc/munin' -_conf_dir['FreeBSD'] = '/usr/local/etc/munin' - -describe 'munin::plugin' do - let(:title) { 'testplugin' } - - on_supported_os.each do |os, facts| - - # Avoid testing on distributions similar to RedHat and Debian - next if /^(ubuntu|centos|scientific|oraclelinux)-/.match(os) - - # No need to test all os versions as long as os version is not - # used in the params class - next if /^(debian-[67]|redhat-[56]|freebsd-9)-/.match(os) - - context "on #{os}" do - let(:facts) do - facts - end - - conf_dir = _conf_dir[facts[:osfamily]] - - context 'with config_label unset, label should be set to title' do - let(:params) do - { config: ['env.foo bar'] } - end - - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_content(/^\[testplugin\]$/) - end - end - - context 'with config_label set, label should be set to config_label' do - let(:params) do - { config: ['env.foo bar'], - config_label: 'foo_' } - end - it do - should contain_file("#{conf_dir}/plugin-conf.d/testplugin.conf") - .with_content(/^\[foo_\]$/) - end - end - - end # on os - end - -end diff --git a/contrib-modules/munin/spec/spec_helper.rb b/contrib-modules/munin/spec/spec_helper.rb deleted file mode 100644 index 23d3e29a..00000000 --- a/contrib-modules/munin/spec/spec_helper.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-puppet-facts' - -include RspecPuppetFacts - -require 'simplecov' -require 'simplecov-console' - -SimpleCov.start do - add_filter '/spec' - add_filter '/vendor' - formatter SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console - ]) -end - -shared_context :unsupported do - let(:facts) { { osfamily: 'Unsupported' } } -end diff --git a/contrib-modules/munin/spec/spec_helper_acceptance.rb b/contrib-modules/munin/spec/spec_helper_acceptance.rb deleted file mode 100644 index 538b7a3c..00000000 --- a/contrib-modules/munin/spec/spec_helper_acceptance.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'beaker-rspec/spec_helper' -require 'beaker-rspec/helpers/serverspec' -require 'beaker/puppet_install_helper' - -run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' - -RSpec.configure do |c| - # Project root - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - - # Readable test descriptions - c.formatter = :documentation - - # Configure all nodes in nodeset - c.before :suite do - # Install module and dependencies - puppet_module_install(:source => proj_root, :module_name => 'munin') - hosts.each do |host| - on host, puppet('module', 'install', 'puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } - end - end -end diff --git a/contrib-modules/munin/CHANGELOG.md b/modules/munin/CHANGELOG.md similarity index 60% rename from contrib-modules/munin/CHANGELOG.md rename to modules/munin/CHANGELOG.md index 9c564857..1a7e9332 100644 --- a/contrib-modules/munin/CHANGELOG.md +++ b/modules/munin/CHANGELOG.md @@ -1,66 +1,5 @@ # Changelog -## 0.1.0 - 2015-12-12 - -* Added support for Archlinux - ([#40](https://github.com/ssm/ssm-munin/issues/40)) -* Added acceptance tests -* Added CONTRIBUTING.md for how to contribute to the module - ([#41](https://github.com/ssm/ssm-munin/issues/41)) -* Document all parameters in README.md - -### munin::node - -* Two new parameters: **bind\_address** and **bind\_port** - ([#37](https://github.com/ssm/ssm-munin/pull/37)) -* Bugfix: Rescue InvalidAddressError only if ruby is capable - ([#38](https://github.com/ssm/ssm-munin/pull/38)) - -### contributors - -Contributors to this release: David Hayes, Julien Pivotto, Stig -Sandbeck Mathisen, Victor Engmark - -## 0.0.10 - 2015-08-01 - -* Bugfix: Add missing dependency for the "munin-node" package when - $munin::node::purge_configs is true. - ([#34](https://github.com/ssm/ssm-munin/pull/34)) - -Contributors to this release: Martin Meinhold - -## 0.0.9 - 2015-07-29 - -* Bugfix: The mastergroup, if used in the node's FQN (Fully Qualified - Name), should no longer be empty on Puppet 4.0. - ([#27](https://github.com/ssm/ssm-munin/pull/27)) - -* Bugfix: Using munin::master and munin::node with export and collect - disabled should no longer trigger warnings about missing - storeconfigs. ([#30](https://github.com/ssm/ssm-munin/issues/30), - [#33](https://github.com/ssm/ssm-munin/pull/33)) - -### munin::master - -* Add FreeBSD support. - -### munin::node - -* New feature: Log to syslog with the "log\_destination" and - "syslog\_facility" parameters. - ([#23](https://github.com/ssm/ssm-munin/issues/23), - [#24](https://github.com/ssm/ssm-munin/pull/24), - [#25](https://github.com/ssm/ssm-munin/pull/25)) - -* New feature: Set the plugin runtime timeout with the "timeout" - parameter. ([#29](https://github.com/ssm/ssm-munin/issues/29), - [#32](https://github.com/ssm/ssm-munin/pull/32)) - -* New feature: Purge unmanaged plugins and plugin configuration with - the "purge_configs" parameter. - ([#28](https://github.com/ssm/ssm-munin/issues/28), - [#31](https://github.com/ssm/ssm-munin/pull/31)) - ## 0.0.8 - 2015-02-06 Support the future parser. diff --git a/modules/munin/Gemfile b/modules/munin/Gemfile new file mode 100644 index 00000000..3e72d45a --- /dev/null +++ b/modules/munin/Gemfile @@ -0,0 +1,17 @@ +source 'https://rubygems.org/' + +group :test do + gem 'rake' + gem 'puppet', ENV['PUPPET_VERSION'] || '~> 3.7.0' + gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git', :ref => 'v2.0.0' + gem 'puppetlabs_spec_helper' +end + +group :development do + gem 'travis' + gem 'travis-lint' + gem 'vagrant-wrapper' + gem 'puppet-blacksmith' + gem 'guard-rake' + gem 'metadata-json-lint' +end diff --git a/modules/munin/Guardfile b/modules/munin/Guardfile new file mode 100644 index 00000000..2cd45cb3 --- /dev/null +++ b/modules/munin/Guardfile @@ -0,0 +1,11 @@ +notification :off + +guard 'rake', :task => 'test' do + watch('Rakefile') + watch(%r{^manifests\/(.+)\.pp$}) + watch(%r{^templates\/(.+)\.erb$}) +end + +guard 'rake', :task => 'metadata' do + watch('metadata.json') +end diff --git a/modules/munin/README.md b/modules/munin/README.md new file mode 100644 index 00000000..9fb02651 --- /dev/null +++ b/modules/munin/README.md @@ -0,0 +1,212 @@ +# Puppet munin module [![Build Status](https://travis-ci.org/ssm/ssm-munin.png?branch=master)](https://travis-ci.org/ssm/ssm-munin) + +Control munin master, munin node, and munin plugins. + +Munin nodes are automatically configured on the master. (Requires +puppetdb) + +# Munin master + +Typical usage: + + include munin::master + +Installs a munin master, and automatically collects configuration from +all munin nodes configured with munin::node. + +# Munin node definition + + munin::master::node_definition { 'fqn': + address => $address, + config => ['additional', 'configuration' 'lines'], + } + +The resource title is used as the munin FQN, or "fully qualified +name". This defines the node name and group. It is common to use the +host's fully qualified domain name, where the domain name will be +implicitly used as the node group. + +The address is the host name, ip address, or alternate transport used +to contact the node. + +To add more configuration, specify it as an array for the "config" +attribute. + +For more information about configuring a munin node definition, see +http://munin.readthedocs.org/en/latest/reference/munin.conf.html#node-definitions + +If you have multiple munin master servers in your infrastructure and want to assign different nodes to different masters, you can specify the master's fully qualified domain name on the node's definition: + + munin::master::node_definition { 'fqn': + address => $address, + mastername => 'munin.example.com', + } + +## Static node definitions + +The munin master class will collect all +"munin::master::node_definition" exported by "munin::node". + +For extra nodes, you can define them in hiera, and munin::master will +create them. Example: + + munin::master::node_definition { 'foo.example.com': + address => '192.0.2.1' + } + munin::master::node_definition { 'bar.example.com': + address => '192.0.2.1', + config => [ 'load.graph_future 30', + 'load.load.trend yes', + 'load.load.predict 86400,12' ], + } + +### node definitions as class parameter + +If you define your nodes as a data structure in a puppet manifest, or from the +puppet External Node Classifier, you can use a class parameter: + + $nodes = { ... } + + class { 'puppet::master': + node_definitions => $nodes, + } + +### node definitions with hiera + +A JSON definition. + + { + "munin::master::node_definitions" : { + "foo.example.com" : { + "address" : "192.0.2.1" + }, + "bar.example.com" : { + "address" : "192.0.2.2", + "config" : [ + "load.graph_future 30", + "load.load.trend yes", + "load.load.predict 86400,12" + ] + } + } + } + + +A YAML definition + + --- + munin::master::node_definitions: + foo.example.com: + address: 192.0.2.1 + bar.example.com: + address: 192.0.2.2 + config: + - load.graph_future 30 + - load.load.trend yes + - load.load.predict 86400,12 + +# Munin node + +Typical usage: + + class { 'munin::node': + allow => [ '192.0.2.0/24', '2001:db8::/64' ] + } + +or in hiera: + + --- + munin::node::allow: + - 192.0.2.0/24 + - 2001:db8::/64 + +Installs munin-node, and exports a munin::master::node_definition +which munin::master will collect, and allows munin masters on +specified networks to connect. + +The munin::node class does take more parameters, see the +'manifests/node.pp' file for complete documentation. + +# Munin plugins + +The defined type munin::plugin is used to control the munin plugins +used on a munin node. + +Typical usage: + + munin::plugin { 'cpu': + ensure => link, + } + +## Examples + +### Activate a plugin + +Here, we activate an already installed plugin. + +The use of "ensure => link" creates an implicit "target => +/usr/share/munin/plugins/$title". + +The "target" parameter can be set to an absolute path (starting with a +"/"), or a relative path (anything else). If relative, +$munin::params::node::plugin_share_dir is prepended to the path. + + munin::plugin { + 'apt': + ensure => link; + 'something': + ensure => link, + target => '/usr/local/share/munin/plugins/something'; + 'ip_eth0': + ensure => link, + target => 'ip_'; # becomes $munin::params::node::plugin_share_dir/ip_ + } + + +### Install and activate a plugin + +The use of "ensure => present" creates a file in /etc/munin/plugins + + munin::plugin { 'somedaemon': + ensure => present, + source => 'puppet:///modules/munin/plugins/somedaemon', + } + +### Activate wildcard plugin + +A pair of plugins we provide, with a _name symlink (This is also known +as "wildcard" plugins) + + munin::plugin { + 'foo_bar': + ensure => present, + target => 'foo_', + source => 'puppet:///modules/munin/plugins/foo_'; + 'foo_baz': + ensure => present, + target => 'foo_', + source => 'puppet:///modules/munin/plugins/foo_'; + } + +### Plugin with configuration + +This creates an additional "/etc/munin/plugin-conf.d/${title}.conf" + + munin::plugin { + 'bletch': + ensure => link, + config => 'env.database flumpelump'; + 'thud': + ensure => present, + source => 'puppet:///modules/munin/plugins/thud', + config => ['env.database zotto', 'user root']; + } + +### A plugin configuration file + +This only adds a plugin configuration file. + + munin::plugin { 'slapd': + config => ['env.rootdn cn=admin,dc=example,dc=org'], + config_label => 'slapd_*', + } diff --git a/modules/munin/Rakefile b/modules/munin/Rakefile new file mode 100644 index 00000000..0db5abde --- /dev/null +++ b/modules/munin/Rakefile @@ -0,0 +1,37 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +# Optional gems, used for development +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +# workaround for https://github.com/rodjek/puppet-lint/issues/331 +Rake::Task[:lint].clear + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.fail_on_warnings = true + +exclude_paths = [ + 'pkg/**/*', + 'vendor/**/*', + 'spec/**/*', +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +task :metadata do + sh 'metadata-json-lint metadata.json' +end + +desc 'Run syntax, lint, and spec tests.' +task :test => [ + :syntax, + :lint, + :spec, + :metadata, +] diff --git a/modules/munin/checksums.json b/modules/munin/checksums.json new file mode 100644 index 00000000..db44d23f --- /dev/null +++ b/modules/munin/checksums.json @@ -0,0 +1,23 @@ +{ + "CHANGELOG.md": "f21c2cbe1b2d1dc9945f718500aeab4d", + "Gemfile": "5f200cd431802be504f5d1e9143915e4", + "Guardfile": "5801d6a90ec8dc66c359d099231938e4", + "README.md": "7c2ea263fba3eaa54cb02409baf9bb3a", + "Rakefile": "d285c6f9fc096c5da5b3fb90951246da", + "manifests/master/node_definition.pp": "a23b1545f8654fef095ae19810e868d1", + "manifests/master.pp": "23b9e147a6d43050df2394302f483ce3", + "manifests/node.pp": "6b6302c9ec224423ca72116fd743613a", + "manifests/params/master.pp": "01ec4a371c5cc1bae9a334e94e24d8f0", + "manifests/params/node.pp": "d37eb06756d40fca65bbe2c3508cb4dd", + "manifests/plugin.pp": "ef17f4589bba321ca8cdf6cb737732be", + "metadata.json": "609831fed1addd582975df8ec31f4f98", + "spec/classes/munin_master_spec.rb": "88f8d6a1c213809feab96464901d5889", + "spec/classes/munin_node_spec.rb": "d9621842ae6e6507b6806dd6f2f00a04", + "spec/defines/munin_plugin_spec.rb": "48d5df7c5cbf47e3e3cf9d026d5d3fe3", + "spec/defines/regression_13_munin_plugin_config_name_spec.rb": "29a498ede3107979d889060677d7c845", + "spec/spec_helper.rb": "ba61932d8fb195fd7b04289cc9e0300b", + "templates/master/node.definition.conf.erb": "b321f84d2118f489b7c2e27518ee51e7", + "templates/munin-node.conf.erb": "2f5855c640f78a55b6d32962d7a8ecb8", + "templates/munin.conf.erb": "aed4f1d629c58260a87e9f71e45b018f", + "templates/plugin_conf.erb": "e4d0fd7c2e1d5421481efd10ebd5a078" +} \ No newline at end of file diff --git a/contrib-modules/munin/manifests/master.pp b/modules/munin/manifests/master.pp similarity index 89% rename from contrib-modules/munin/manifests/master.pp rename to modules/munin/manifests/master.pp index 734228cd..32b760f4 100644 --- a/contrib-modules/munin/manifests/master.pp +++ b/modules/munin/manifests/master.pp @@ -91,7 +91,7 @@ if $host_name { validate_string($host_name) - if ! is_domain_name($host_name) { + if ! is_domain_name("${host_name}") { fail('host_name should be a valid domain name') } } @@ -121,10 +121,22 @@ force => true, } - if $collect_nodes != 'disabled' { - class { '::munin::master::collect': - collect_nodes => $collect_nodes, - host_name => $host_name, + case $collect_nodes { + 'enabled': { + Munin::Master::Node_definition <<| |>> + } + 'mine': { + # Collect nodes explicitly tagged with this master + Munin::Master::Node_definition <<| tag == "munin::master::${host_name}" |>> + } + 'unclaimed': { + # Collect all exported node definitions, except the ones tagged + # for a specific master + Munin::Master::Node_definition <<| tag == 'munin::master::' |>> + } + 'disabled', + default: { + # do nothing } } diff --git a/contrib-modules/munin/manifests/master/node_definition.pp b/modules/munin/manifests/master/node_definition.pp similarity index 99% rename from contrib-modules/munin/manifests/master/node_definition.pp rename to modules/munin/manifests/master/node_definition.pp index cc1d582d..dbf47559 100644 --- a/contrib-modules/munin/manifests/master/node_definition.pp +++ b/modules/munin/manifests/master/node_definition.pp @@ -30,6 +30,6 @@ regsubst($name, '[^[:alnum:]\.]', '_', 'IG')) file { $filename: - content => template('munin/master/node.definition.conf.erb'), + content => template('munin/master/node.definition.conf.erb') } } diff --git a/modules/munin/manifests/node.pp b/modules/munin/manifests/node.pp new file mode 100644 index 00000000..85eaadf1 --- /dev/null +++ b/modules/munin/manifests/node.pp @@ -0,0 +1,127 @@ +# munin::node - Configure a munin node, and export configuration a +# munin master can collect. +# +# Parameters: +# +# allow: List of IPv4 and IPv6 addresses and networks to allow to connect. +# +# config_root: Root directory for munin configuration. +# +# nodeconfig: List of lines to append to the munin node configuration. +# +# host_name: The host name munin node identifies as. Defaults to +# the $::fqdn fact. +# +# log_dir: The log directory for the munin node process. Defaults +# change according to osfamily, see munin::params::node for details. +# +# masterconfig: List of configuration lines to append to the munin +# master node definitinon +# +# mastername: The name of the munin master server which will collect +# the node definition. +# +# mastergroup: The group used on the master to construct a FQN for +# this node. Defaults to "", which in turn makes munin master use the +# domain. Note: changing this for a node also means you need to move +# rrd files on the master, or graph history will be lost. +# +# plugins: A hash used by create_resources to create munin::plugin +# instances. +# +# address: The address used in the munin master node definition. +# +# package_name: The name of the munin node package to install. +# +# service_name: The name of the munin node service. +# +# service_ensure: Defaults to "". If set to "running" or "stopped", it +# is used as parameter "ensure" for the munin node service. +# +# export_node: "enabled" or "disabled". Defaults to "enabled". +# Causes the node config to be exported to puppetmaster. +# +# file_group: The UNIX group name owning the configuration files, +# log files, etc. + +class munin::node ( + $address = $munin::params::node::address, + $allow = $munin::params::node::allow, + $config_root = $munin::params::node::config_root, + $host_name = $munin::params::node::host_name, + $log_dir = $munin::params::node::log_dir, + $masterconfig = $munin::params::node::masterconfig, + $mastergroup = $munin::params::node::mastergroup, + $mastername = $munin::params::node::mastername, + $nodeconfig = $munin::params::node::nodeconfig, + $package_name = $munin::params::node::package_name, + $plugins = $munin::params::node::plugins, + $service_ensure = $munin::params::node::service_ensure, + $service_name = $munin::params::node::service_name, + $export_node = $munin::params::node::export_node, + $file_group = $munin::params::node::file_group, +) inherits munin::params::node { + + validate_array($allow) + validate_array($nodeconfig) + validate_array($masterconfig) + validate_string($mastergroup) + validate_string($mastername) + validate_hash($plugins) + validate_string($address) + validate_absolute_path($config_root) + validate_string($package_name) + validate_string($service_name) + validate_re($service_ensure, '^(|running|stopped)$') + validate_re($export_node, '^(enabled|disabled)$') + validate_absolute_path($log_dir) + validate_string($file_group) + + if $mastergroup { + $fqn = "${mastergroup};${host_name}" + } + else { + $fqn = $host_name + } + + # Defaults + File { + ensure => present, + owner => 'root', + group => $file_group, + mode => '0444', + } + + package { $package_name: + ensure => installed, + } + + service { $service_name: + ensure => $service_ensure ? { + '' => undef, + default => $service_ensure, + }, + enable => true, + require => Package[$package_name], + } + + file { "${config_root}/munin-node.conf": + content => template('munin/munin-node.conf.erb'), + require => Package[$package_name], + notify => Service[$service_name], + } + + # Export a node definition to be collected by the munin master + if $export_node == 'enabled' { + @@munin::master::node_definition{ $fqn: + address => $address, + mastername => $mastername, + config => $masterconfig, + tag => [ "munin::master::${mastername}" ] + } + } + + # Generate plugin resources from hiera or class parameter. + create_resources(munin::plugin, $plugins, {}) + +} diff --git a/contrib-modules/munin/manifests/params/master.pp b/modules/munin/manifests/params/master.pp similarity index 82% rename from contrib-modules/munin/manifests/params/master.pp rename to modules/munin/manifests/params/master.pp index ab5322bf..30b4c9ef 100644 --- a/contrib-modules/munin/manifests/params/master.pp +++ b/modules/munin/manifests/params/master.pp @@ -1,5 +1,3 @@ -# Parameters for the munin::master class. Add support for new OS -# families here. class munin::params::master { $message = "Unsupported osfamily ${::osfamily}" @@ -19,7 +17,6 @@ $host_name = $::fqdn case $::osfamily { - 'Archlinux', 'Debian', 'RedHat': { $config_root = '/etc/munin' @@ -27,9 +24,6 @@ 'Solaris': { $config_root = '/opt/local/etc/munin' } - 'FreeBSD': { - $config_root = '/usr/local/etc/munin' - } default: { fail($message) } diff --git a/contrib-modules/munin/manifests/params/node.pp b/modules/munin/manifests/params/node.pp similarity index 83% rename from contrib-modules/munin/manifests/params/node.pp rename to modules/munin/manifests/params/node.pp index 729ad971..587733a4 100644 --- a/contrib-modules/munin/manifests/params/node.pp +++ b/modules/munin/manifests/params/node.pp @@ -1,29 +1,19 @@ -# Parameters for the munin::node class. Add support for new OS -# families here. class munin::params::node { $message = "Unsupported osfamily: ${::osfamily}" $address = $::fqdn $host_name = $::fqdn - $bind_address = '*' - $bind_port = 4949 $allow = [] $masterconfig = [] - $mastergroup = undef - $mastername = undef + $mastergroup = '' + $mastername = '' $nodeconfig = [] $plugins = {} - $service_ensure = undef + $service_ensure = '' $export_node = 'enabled' - $log_file = 'munin-node.log' - $log_destination = 'file' - $syslog_facility = undef - $purge_configs = false - $timeout = undef case $::osfamily { - 'Archlinux', 'RedHat': { $config_root = '/etc/munin' $log_dir = '/var/log/munin-node' diff --git a/contrib-modules/munin/manifests/plugin.pp b/modules/munin/manifests/plugin.pp similarity index 65% rename from contrib-modules/munin/manifests/plugin.pp rename to modules/munin/manifests/plugin.pp index 1b5b66e7..da754738 100644 --- a/contrib-modules/munin/manifests/plugin.pp +++ b/modules/munin/manifests/plugin.pp @@ -2,25 +2,22 @@ # # Parameters: # -# - ensure: "link", "present", "absent" or "". Default is "". The -# ensure parameter is mandatory for installing a plugin. +# - ensure: link, present, absent # - source: when ensure => present, source file -# - target: when ensure => link, link target. If target is an -# absolute path (starts with "/") it is used directly. If target is -# a relative path, $munin::node::plugin_share_dir is prepended. +# - target: when ensure => link, link target # - config: array of lines for munin plugin config # - config_label: label for munin plugin config define munin::plugin ( - $ensure='', + $ensure=undef, $source=undef, - $target='', + $target=undef, $config=undef, $config_label=undef, ) { - include ::munin::node + include munin::node $plugin_share_dir=$munin::node::plugin_share_dir validate_absolute_path($plugin_share_dir) @@ -30,19 +27,18 @@ notify => Service[$munin::node::service_name], } - validate_re($ensure, '^(|link|present|absent)$') case $ensure { - 'present': { + present: { $handle_plugin = true - $plugin_ensure = 'present' + $plugin_ensure = present } - 'absent': { + absent: { $handle_plugin = true - $plugin_ensure = 'absent' + $plugin_ensure = absent } - 'link': { + link: { $handle_plugin = true - $plugin_ensure = 'link' + $plugin_ensure = link case $target { '': { $plugin_target = "${munin::node::plugin_share_dir}/${title}" @@ -54,7 +50,6 @@ $plugin_target = "${munin::node::plugin_share_dir}/${target}" } } - validate_absolute_path($plugin_target) } default: { $handle_plugin = false @@ -63,7 +58,7 @@ if $config { $config_ensure = $ensure ? { - 'absent'=> absent, + absent => absent, default => present, } } @@ -75,10 +70,10 @@ if $handle_plugin { # Install the plugin file {"${munin::node::config_root}/plugins/${name}": - ensure => $plugin_ensure, - source => $source, - target => $plugin_target, - mode => '0755', + ensure => $plugin_ensure, + source => $source, + target => $plugin_target, + mode => '0755', } } diff --git a/contrib-modules/munin/metadata.json b/modules/munin/metadata.json similarity index 76% rename from contrib-modules/munin/metadata.json rename to modules/munin/metadata.json index e024e565..4b701e40 100644 --- a/contrib-modules/munin/metadata.json +++ b/modules/munin/metadata.json @@ -1,6 +1,6 @@ { - "name": "ssm-munin", - "version": "0.1.0", + "name": "ssm/munin", + "version": "0.0.8", "author": "ssm", "summary": "Configure munin master, node and plugins", "license": "Apache-2.0", @@ -8,18 +8,12 @@ "project_page": "https://github.com/ssm/ssm-munin", "issues_url": "https://github.com/ssm/ssm-munin/issues", "operatingsystem_support": [ - { - "operatingsystem": "Archlinux", - "operatingsystemrelease": [ - "4" - ] - }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "5", - "6", - "7" + "5.0", + "6.0", + "7.0" ] }, { @@ -33,25 +27,25 @@ { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "5", - "6", - "7" + "5.0", + "6.0", + "7.0" ] }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "5", - "6", - "7" + "5.0", + "6.0", + "7.0" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ - "5", - "6", - "7" + "5.0", + "6.0", + "7.0" ] }, { @@ -66,11 +60,7 @@ ] }, { - "operatingsystem": "FreeBSD", - "operatingsystemrelease": [ - "9", - "10" - ] + "operatingsystem": "FreeBSD" }, { "operatingsystem": "DragonFly" diff --git a/modules/munin/spec/classes/munin_master_spec.rb b/modules/munin/spec/classes/munin_master_spec.rb new file mode 100644 index 00000000..f8728e50 --- /dev/null +++ b/modules/munin/spec/classes/munin_master_spec.rb @@ -0,0 +1,155 @@ +require 'spec_helper' + +describe 'munin::master' do + + [ :CentOS, :Debian, :RedHat, :Ubuntu ].each do |sc| + context "Check for supported operatingsystem #{sc}" do + include_context sc + it { should compile } + it { should contain_class('munin::master') } + it { + should contain_package('munin') + should contain_file('/etc/munin/munin.conf') + should contain_file('/etc/munin/munin-conf.d') + .with_ensure('directory') + } + end + end + + [ :SmartOS ].each do |sc| + context "Check for supported operatingsystem #{sc}" do + include_context sc + it { should compile } + it { should contain_class('munin::master') } + it { + should contain_package('munin') + should contain_file('/opt/local/etc/munin/munin.conf') + should contain_file('/opt/local/etc/munin/munin-conf.d') + .with_ensure('directory') + } + end + end + + context 'with default params' do + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/graph_strategy\s+cgi/) + .with_content(/html_strategy\s+cgi/) + } + end + + context 'with html_strategy => cron' do + let (:params) { { :html_strategy => 'cron' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/html_strategy\s+cron/) + } + end + + context 'with graph_strategy => cron' do + let (:params) { { :graph_strategy => 'cron' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/graph_strategy\s+cron/) + } + end + + context 'with dbdir => /var/lib/munin' do + let (:params) { { :dbdir => '/var/lib/munin' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/dbdir\s+\/var\/lib\/munin/) + } + end + + context 'with htmldir => /var/www/munin' do + let (:params) { { :htmldir => '/var/www/munin' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/htmldir\s+\/var\/www\/munin/) + } + end + + context 'with logdir => /var/log/munin' do + let (:params) { { :dbdir => '/var/log/munin' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/dbdir\s+\/var\/log\/munin/) + } + end + + context 'with rudir => /var/run/munin' do + let (:params) { { :dbdir => '/var/run/munin' } } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/dbdir\s+\/var\/run\/munin/) + } + end + + context 'with tls => enabled' do + let(:params) { + { + :tls => 'enabled', + :tls_certificate => '/path/to/certificate.pem', + :tls_private_key => '/path/to/key.pem', + :tls_verify_certificate => 'yes', + } + } + + it { should compile } + it { + should contain_file('/etc/munin/munin.conf') + .with_content(/tls = enabled/) + .with_content(/tls_certificate = \/path\/to\/certificate\.pem/) + .with_content(/tls_private_key = \/path\/to\/key\.pem/) + .with_content(/tls_verify_certificate = yes/) + } + end + + context 'with extra_config' do + token = '1b7febce-bb2d-4c18-b889-84c73538a900' + let(:params) do + { :extra_config => [ token ] } + end + it { should compile } + it do + should contain_file('/etc/munin/munin.conf') + .with_content(/#{token}/) + end + end + + context 'with extra_config set to a string' do + token = '1b7febce-bb2d-4c18-b889-84c73538a900' + let(:params) do + { :extra_config => token } + end + it { should raise_error(Puppet::Error, /is not an Array/) } + end + + ['test.example.com', 'invalid/hostname.example.com'].each do |param| + context "with host_name => #{param}" do + let(:params) do + { :host_name => param } + end + if param =~ /invalid/ + it { should raise_error(Puppet::Error, /valid domain name/) } + else + it { should compile } + end + end + end + + %w( enabled disabled mine unclaimed invalid ).each do |param| + context "with collect_nodes => #{param}" do + let(:params) do + { :collect_nodes => param } + end + if param == 'invalid' + it { should raise_error(Puppet::Error, /validate_re/) } + else + it { should compile } + end + end + end + +end diff --git a/modules/munin/spec/classes/munin_node_spec.rb b/modules/munin/spec/classes/munin_node_spec.rb new file mode 100644 index 00000000..9e8d0db1 --- /dev/null +++ b/modules/munin/spec/classes/munin_node_spec.rb @@ -0,0 +1,79 @@ +require 'spec_helper' + +describe 'munin::node' do + + [ :CentOS, :Debian, :RedHat, :Ubuntu ].each do |sc| + context "Check for supported operatingsystem #{sc}" do + include_context sc + it { should compile } + it { should contain_class('munin::node') } + it { + should contain_package('munin-node') + should contain_service('munin-node') + should contain_file('/etc/munin/munin-node.conf') + } + end + end + + [ :SmartOS ].each do |sc| + context "Check for supported operatingsystem #{sc}" do + include_context sc + it { should compile } + it { should contain_class('munin::node') } + it { + should contain_package('munin-node') + should contain_service('smf:/munin-node') + should contain_file('/opt/local/etc/munin/munin-node.conf') + } + end + end + + context 'unsupported' do + include_context :unsupported + it { + expect { + should contain_class('munin::node') + }.to raise_error(Puppet::Error, /Unsupported osfamily/) + } + end + + context 'acl with ipv4 and ipv6 addresses' do + include_context :Debian + let(:params) do + { allow: ['2001:db8:1::', + '2001:db8:2::/64', + '192.0.2.129', + '192.0.2.0/25', + '192\.0\.2'] + } + end + it do + should contain_file('/etc/munin/munin-node.conf') + .with_content(/^cidr_allow 192.0.2.0\/25$/) + .with_content(/^cidr_allow 2001:db8:2::\/64$/) + .with_content(/^allow \^192\\.0\\.2\\.129\$$/) + .with_content(/^allow 192\\.0\\.2$/) + .with_content(/^allow \^2001:db8:1::\$$/) + end + end + + context 'with host_name unset' do + include_context :Debian + it do + should contain_file('/etc/munin/munin-node.conf') + .with_content(/host_name\s+testnode.example.com/) + end + end + + context 'with host_name set' do + include_context :Debian + let(:params) do + { host_name: 'something.example.com' } + end + it do + should contain_file('/etc/munin/munin-node.conf') + .with_content(/host_name\s+something.example.com/) + end + end + +end diff --git a/modules/munin/spec/defines/munin_plugin_spec.rb b/modules/munin/spec/defines/munin_plugin_spec.rb new file mode 100644 index 00000000..9d9cd6a0 --- /dev/null +++ b/modules/munin/spec/defines/munin_plugin_spec.rb @@ -0,0 +1,108 @@ +require 'spec_helper' + +describe 'munin::plugin', :type => 'define' do + + let(:title) { 'testplugin' } + + context 'with no parameters' do + include_context :Debian + it { + expect { + should contain_file('/etc/munin/plugins/testplugin') + }.to raise_error("expected that the catalogue would contain File[/etc/munin/plugins/testplugin]") + + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf').with_ensure('absent') + } + end + + context 'with ensure=link parameter' do + include_context :Debian + let(:params) { { :ensure => 'link' } } + it { + should contain_file('/etc/munin/plugins/testplugin').with_ensure('link').with_target('/usr/share/munin/plugins/testplugin') + + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf').with_ensure('absent') + } + end + + context 'with ensure=link and target parameters' do + include_context :Debian + let (:title) { 'test_foo' } + let (:params) { + { :ensure => 'link', + :target => 'test_' } + } + + it { + should contain_file('/etc/munin/plugins/test_foo').with_ensure('link').with_target('/usr/share/munin/plugins/test_') + + should contain_file('/etc/munin/plugin-conf.d/test_foo.conf').with_ensure('absent') + } + end + + context 'with ensure=present and source parameters' do + include_context :SmartOS + let(:params) { + { :ensure => 'present', + :source => 'puppet:///modules/munin/plugins/testplugin' } + } + + it { + + expect { + should contain_file('/opt/local/etc/munin/plugins/testplugin').with_ensure('present').with_source('puppet:///modules/munin/plugins/testplugin') + } + should contain_file('/opt/local/etc/munin/plugin-conf.d/testplugin.conf').with_ensure('absent') + } + end + + context 'with ensure=present, source and config parameters' do + include_context :Debian + let(:params) { + { :ensure => 'present', + :source => 'puppet:///modules/munin/plugins/testplugin', + :config => [ 'something wonderful' ], + } + } + + it { + should contain_file('/etc/munin/plugins/testplugin').with_ensure('present').with_source('puppet:///modules/munin/plugins/testplugin') + + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf').with_ensure('present').with_content(/something wonderful/) + } + end + + context 'only configuration' do + include_context :Debian + let (:params) { + { :config => ['env.rootdn cn=admin,dc=example,dc=org'], + :config_label => 'slapd_*', + } + } + + it { + + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf').with_ensure('present').with_content(/env.rootdn/) + + expect { + should contain_file('/etc/munin/plugins/testplugin') + }.to raise_error("expected that the catalogue would contain File[/etc/munin/plugins/testplugin]") + + } + end + + context 'with absolute target' do + include_context :Debian + + let(:params) do + { ensure: 'link', + target: '/full/path/to/testplugin' } + end + + it do + should contain_file('/etc/munin/plugins/testplugin') + .with_ensure('link') + .with_target('/full/path/to/testplugin') + end + end +end diff --git a/modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb b/modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb new file mode 100644 index 00000000..f9a01b8d --- /dev/null +++ b/modules/munin/spec/defines/regression_13_munin_plugin_config_name_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe 'munin::plugin' do + + include_context :Debian + let(:title) { 'testplugin' } + + context 'with config_label unset, label should be set to title' do + let(:params) do + { config: ['env.foo bar'] } + end + + it do + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf') + .with_content(/^\[testplugin\]$/) + end + end + + context 'with config_label set, label should be set to config_label' do + let(:params) do + { config: ['env.foo bar'], + config_label: 'foo_' } + end + it do + should contain_file('/etc/munin/plugin-conf.d/testplugin.conf') + .with_content(/^\[foo_\]$/) + end + end + +end diff --git a/modules/munin/spec/spec_helper.rb b/modules/munin/spec/spec_helper.rb new file mode 100644 index 00000000..c0b921ba --- /dev/null +++ b/modules/munin/spec/spec_helper.rb @@ -0,0 +1,34 @@ +require 'puppetlabs_spec_helper/module_spec_helper' + +RSpec.configure do |c| + c.default_facts = { + :operatingsystem => 'Debian', + :osfamily => 'Debian', + :fqdn => 'testnode.example.com', + } +end + + +shared_context :unsupported do + let(:facts) { { :osfamily => 'Unsupported', } } +end + +shared_context :Debian do +end + +shared_context :Ubuntu do + let(:facts) { { :operatingsystem => 'Ubuntu', } } +end + +shared_context :CentOS do + let(:facts) { { :operatingsystem => 'CentOS', :osfamily => 'RedHat', } } +end + +shared_context :RedHat do + let(:facts) { { :osfamily => 'RedHat', } } +end + +shared_context :SmartOS do + let(:facts) { { :operatingsystem => 'SmartOS', :osfamily => 'Solaris', } } +end + diff --git a/contrib-modules/munin/templates/master/node.definition.conf.erb b/modules/munin/templates/master/node.definition.conf.erb similarity index 75% rename from contrib-modules/munin/templates/master/node.definition.conf.erb rename to modules/munin/templates/master/node.definition.conf.erb index 99bd0cf4..80ad992a 100644 --- a/contrib-modules/munin/templates/master/node.definition.conf.erb +++ b/modules/munin/templates/master/node.definition.conf.erb @@ -1,4 +1,4 @@ -# Munin master configuration fragment for <%= @title %> +# Munin master configuration fragment for <%= title %> # # This file is handled by puppet, all modifications will be lost diff --git a/contrib-modules/munin/templates/munin-node.conf.erb b/modules/munin/templates/munin-node.conf.erb similarity index 68% rename from contrib-modules/munin/templates/munin-node.conf.erb rename to modules/munin/templates/munin-node.conf.erb index d059b387..187acd8e 100644 --- a/contrib-modules/munin/templates/munin-node.conf.erb +++ b/modules/munin/templates/munin-node.conf.erb @@ -8,19 +8,13 @@ addresses = [] unrecognized = [] - rescuable_exceptions = [ ArgumentError ] - - if defined?(IPAddr::InvalidAddressError) - rescuable_exceptions << IPAddr::InvalidAddressError - end - Array(@allow).flatten.each do |line| begin a = IPAddr.new(line) if a.ipv4? or a.ipv6? addresses << line end - rescue *rescuable_exceptions + rescue ArgumentError, IPAddr::InvalidAddressError # Treat invalid addresses as "allow" arguments, as they can be # regular expressions. unrecognized << line @@ -30,20 +24,13 @@ host_name <%= @host_name %> log_level 4 -log_file <%= @_log_file %> -<% if @log_destination == 'syslog' -%> -<% if @syslog_facility -%> -syslog_facility <%= @syslog_facility %> -<% end -%> -<% end -%> +log_file <%= @log_dir %>/munin-node.log +port 4949 pid_file /var/run/munin/munin-node.pid background 1 setsid 1 -# Which port and address to bind to; -host <%= @bind_address %> -port <%= @bind_port %> - +# Which port to bind to; user root group <%= @file_group %> @@ -68,9 +55,6 @@ allow ^<%= Regexp.quote(line) %>$ <% unrecognized.each do |line| -%> allow <%= line %> <% end -%> -<% if @timeout -%> -timeout <%= @timeout %> -<% end -%> <% Array(@nodeconfig).each do |line| -%> <%= line %> diff --git a/contrib-modules/munin/templates/munin.conf.erb b/modules/munin/templates/munin.conf.erb similarity index 100% rename from contrib-modules/munin/templates/munin.conf.erb rename to modules/munin/templates/munin.conf.erb diff --git a/contrib-modules/munin/templates/plugin_conf.erb b/modules/munin/templates/plugin_conf.erb similarity index 100% rename from contrib-modules/munin/templates/plugin_conf.erb rename to modules/munin/templates/plugin_conf.erb From dbc17d6b46345c8a3d0d4cc871b43f56ce86a841 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 2 Jun 2018 22:42:58 +0100 Subject: [PATCH 016/147] fix #132 - we also have git version 2.11.0 from new debian --- modules/metacpan/manifests/system/packages.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index 531cb86e..438aff2c 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -29,6 +29,10 @@ package { zsh: ensure => present } # for rafl package { byobu: ensure => present } # for mo + package { libpcre3: ensure => present } # for gitgrep in grep.mc.org + package { libpcre3-dev: ensure => present } # for gitgrep in grep.mc.org + package { gettext: ensure => present } # for gitgrep in grep.mc.org + package { ack-grep: ensure => present } package { less: ensure => present } package { mosh: ensure => present } From c3318008ed077f58a97618347b075902de54c108 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 3 Jun 2018 21:40:24 +0100 Subject: [PATCH 017/147] fix #172 only install sco-redirect in production --- hieradata/common.yaml | 14 +------------- hieradata/env/production.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 7ad46eae..24dcf04e 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -159,19 +159,7 @@ metacpan::web::starman: starman_port: 5002 starman_workers: 1 - sco-redirect: - git_source: 'https://github.com/metacpan/sco-redirect.git' - git_revision: 'master' - vhost_bare: true - vhost_aliases: - - 'search.cpan.org' # not fastly - - "cpansearch.perl.org" # not fastly - - 'sco.metacpan.org' - - "sco.lo.metacpan.org" - - "sco.%{hostname}.metacpan.org" - - ".mcpan.org" - starman_port: 5005 - starman_workers: 1 + metacpan::web::static: diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 299175dd..03c15a68 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -51,6 +51,18 @@ metacpan::web::starman: sco-redirect: git_enable: true starman_workers: 10 + git_source: 'https://github.com/metacpan/sco-redirect.git' + git_revision: 'master' + vhost_bare: true + vhost_aliases: + - 'search.cpan.org' + - "cpansearch.perl.org" # not fastly + - 'sco.metacpan.org' + - "sco.lo.metacpan.org" + - "sco.%{hostname}.metacpan.org" + - ".mcpan.org" + starman_port: 5005 + starman_workers: 1 metacpan::web::static: metacpan-explorer: From 488a12b4e815914fb21d2a2a411aac52066da240 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 3 Jun 2018 21:41:32 +0100 Subject: [PATCH 018/147] only install the v0 shim in production as well ref #172 --- hieradata/common.yaml | 10 ---------- hieradata/env/production.yaml | 26 ++++++++++++++++++++------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 24dcf04e..7a94c9fc 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -148,16 +148,6 @@ metacpan::web::starman: socket_io: template: 'socket_io' - github-meets-cpan: - git_source: 'https://github.com/metacpan/github-meets-cpan.git' - git_revision: 'master' - vhost_bare: true - vhost_aliases: - - 'gh.metacpan.org' - - "gh.lo.metacpan.org" - - "gh.%{hostname}.metacpan.org" - starman_port: 5002 - starman_workers: 1 diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 03c15a68..6539e7be 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -30,6 +30,15 @@ metacpan::crons::general: ensure : present metacpan::web::starman: + + metacpan-web: + git_enable: true + starman_workers: 10 + + metacpan-api: + git_enable: true + starman_workers: 14 + api-v0-shim: git_source: 'https://github.com/metacpan/metacpan-api-v0-shim.git' git_revision: 'master' @@ -39,15 +48,20 @@ metacpan::web::starman: starman_port: 5003 git_enable: true starman_workers: 2 - metacpan-web: - git_enable: true - starman_workers: 10 - metacpan-api: - git_enable: true - starman_workers: 14 + github-meets-cpan: git_enable: true starman_workers: 1 + git_source: 'https://github.com/metacpan/github-meets-cpan.git' + git_revision: 'master' + vhost_bare: true + vhost_aliases: + - 'gh.metacpan.org' + - "gh.lo.metacpan.org" + - "gh.%{hostname}.metacpan.org" + starman_port: 5002 + starman_workers: 1 + sco-redirect: git_enable: true starman_workers: 10 From 7908639fb1296726d577909d04d9f29f1e3636a4 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 3 Jun 2018 22:10:44 +0100 Subject: [PATCH 019/147] make puppet quiet about validations that use old syntax --- modules/munin/manifests/node.pp | 28 ++++++++++++++-------------- modules/munin/manifests/plugin.pp | 3 ++- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/munin/manifests/node.pp b/modules/munin/manifests/node.pp index 85eaadf1..c1d5aafb 100644 --- a/modules/munin/manifests/node.pp +++ b/modules/munin/manifests/node.pp @@ -62,20 +62,20 @@ $file_group = $munin::params::node::file_group, ) inherits munin::params::node { - validate_array($allow) - validate_array($nodeconfig) - validate_array($masterconfig) - validate_string($mastergroup) - validate_string($mastername) - validate_hash($plugins) - validate_string($address) - validate_absolute_path($config_root) - validate_string($package_name) - validate_string($service_name) - validate_re($service_ensure, '^(|running|stopped)$') - validate_re($export_node, '^(enabled|disabled)$') - validate_absolute_path($log_dir) - validate_string($file_group) + # validate_array($allow) + # validate_array($nodeconfig) + # validate_array($masterconfig) + # validate_string($mastergroup) + # validate_string($mastername) + # validate_hash($plugins) + # validate_string($address) + # validate_absolute_path($config_root) + # validate_string($package_name) + # validate_string($service_name) + # validate_re($service_ensure, '^(|running|stopped)$') + # validate_re($export_node, '^(enabled|disabled)$') + # validate_absolute_path($log_dir) + # validate_string($file_group) if $mastergroup { $fqn = "${mastergroup};${host_name}" diff --git a/modules/munin/manifests/plugin.pp b/modules/munin/manifests/plugin.pp index da754738..f8db1f95 100644 --- a/modules/munin/manifests/plugin.pp +++ b/modules/munin/manifests/plugin.pp @@ -20,7 +20,7 @@ include munin::node $plugin_share_dir=$munin::node::plugin_share_dir - validate_absolute_path($plugin_share_dir) + # validate_absolute_path($plugin_share_dir) File { require => Package[$munin::node::package_name], @@ -35,6 +35,7 @@ absent: { $handle_plugin = true $plugin_ensure = absent + $plugin_target = "notlink" } link: { $handle_plugin = true From e0cd61594258237f4750c368318324f1825bd065 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Mon, 4 Jun 2018 17:43:56 +0100 Subject: [PATCH 020/147] make clearing ramdisk not do a warning in puppet --- modules/metacpan/manifests/system/ramdisk.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan/manifests/system/ramdisk.pp b/modules/metacpan/manifests/system/ramdisk.pp index 7677db13..bde15c8a 100644 --- a/modules/metacpan/manifests/system/ramdisk.pp +++ b/modules/metacpan/manifests/system/ramdisk.pp @@ -32,7 +32,7 @@ } - $cmd = "find ${name} -maxdepth 1 -mindepth 1 -mmin +${valid_mins} -exec rm -rf {} \;" + $cmd = "find ${name} -maxdepth 1 -mindepth 1 -mmin +${valid_mins} -exec rm -rf {} ';'" cron { "cron_${name}": From 0d2a65636456f402fee62806ab046005d6e9e156 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Mon, 4 Jun 2018 17:51:27 +0100 Subject: [PATCH 021/147] get bm-mc-01 setup like production (ready for switch over) --- hieradata/nodes/bm-mc-01.yaml | 58 ++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 0e7c6df4..20fb28bf 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -8,8 +8,64 @@ minion_queue::service::ensure: running minion_queue::service::enable: true # We want watcher enabled -# metacpan::watcher::enable: true +metacpan::watcher::enable: true metacpan::crons::general: + swat_monitoring: + ensure : absent + user_data_index_backups: + ensure : absent + import_authors: + ensure : present metacpan_sitemaps: minute : 5 + +metacpan::crons::api: + snapshot_cpan_index: + ensure : absent + snapshot_user_index: + ensure : absent + snapshot_purge_old: + ensure : absent + ratings: + ensure : present + mirrors: + ensure : present + cpantesters: + ensure : present + latest: + ensure : present + backup_purge: + ensure : absent + session: + ensure : present + release: + ensure : present + package: + ensure : present + package_cleanup: + ensure : present + permission: + ensure : present + permission_cleanup: + ensure : present + tickets: + ensure : present + river: + ensure : present + external_cygwin: + ensure : present + external_debian: + ensure : present + external_fedora: + ensure : present + contributor_daily: + ensure : present + contributor_weekly: + ensure : present + favorite_hourly: + ensure : present + favorite_weekly: + ensure : present + cover_full: + ensure : present From aca3bbc820ff6e867d1aa95a80a0b57d26b0977e Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Mon, 4 Jun 2018 13:15:03 -0400 Subject: [PATCH 022/147] Update contrib-modules --- bin/install-modules.sh | 3 +- contrib-modules/elastic_stack/.fixtures.yml | 8 + contrib-modules/elastic_stack/.gitattributes | 4 + contrib-modules/elastic_stack/.gitignore | 22 ++ contrib-modules/elastic_stack/.pmtignore | 20 ++ contrib-modules/elastic_stack/.project | 23 ++ contrib-modules/elastic_stack/.rspec | 2 + contrib-modules/elastic_stack/.rubocop.yml | 108 +++++++ contrib-modules/elastic_stack/.travis.yml | 29 ++ contrib-modules/elastic_stack/.yardopts | 2 + contrib-modules/elastic_stack/CHANGELOG.md | 4 + contrib-modules/elastic_stack/README.md | 7 + contrib-modules/elastic_stack/Rakefile | 9 + contrib-modules/elastic_stack/Vagrantfile | 10 +- .../Vagrantfile.d/manifests/site.pp | 2 + .../elastic_stack/Vagrantfile.d/provision.sh | 8 +- .../elastic_stack/bin/metadata-json-lint | 17 -- contrib-modules/elastic_stack/bin/puppet | 17 -- contrib-modules/elastic_stack/bin/puppet-lint | 17 -- contrib-modules/elastic_stack/bin/rake | 17 -- contrib-modules/elastic_stack/bin/rubocop | 17 -- contrib-modules/elastic_stack/checksums.json | 19 -- .../elastic_stack/manifests/repo.pp | 56 +++- contrib-modules/elastic_stack/metadata.json | 4 +- .../elastic_stack/spec/classes/repo_spec.rb | 47 ++- contrib-modules/logstash/CHANGELOG | 3 + contrib-modules/logstash/checksums.json | 37 ++- contrib-modules/logstash/doc/_index.html | 6 +- contrib-modules/logstash/doc/css/style.css | 11 +- contrib-modules/logstash/doc/file.README.html | 2 +- contrib-modules/logstash/doc/frames.html | 2 +- contrib-modules/logstash/doc/index.html | 2 +- contrib-modules/logstash/doc/js/app.js | 44 +++ .../logstash/doc/puppet_classes/logstash.html | 2 +- .../puppet_classes/logstash_3A_3Aconfig.html | 2 +- .../puppet_classes/logstash_3A_3Apackage.html | 12 +- .../puppet_classes/logstash_3A_3Arepo.html | 279 ------------------ .../puppet_classes/logstash_3A_3Aservice.html | 16 +- .../logstash_3A_3Aconfigfile.html | 2 +- .../logstash_3A_3Apatternfile.html | 2 +- .../logstash_3A_3Aplugin.html | 2 +- .../logstash/doc/top-level-namespace.html | 2 +- contrib-modules/logstash/manifests/package.pp | 5 +- contrib-modules/logstash/manifests/service.pp | 6 + contrib-modules/logstash/metadata.json | 2 +- 45 files changed, 460 insertions(+), 451 deletions(-) create mode 100644 contrib-modules/elastic_stack/.fixtures.yml create mode 100644 contrib-modules/elastic_stack/.gitattributes create mode 100644 contrib-modules/elastic_stack/.gitignore create mode 100644 contrib-modules/elastic_stack/.pmtignore create mode 100644 contrib-modules/elastic_stack/.project create mode 100644 contrib-modules/elastic_stack/.rspec create mode 100644 contrib-modules/elastic_stack/.rubocop.yml create mode 100644 contrib-modules/elastic_stack/.travis.yml create mode 100644 contrib-modules/elastic_stack/.yardopts create mode 100644 contrib-modules/elastic_stack/Vagrantfile.d/manifests/site.pp delete mode 100755 contrib-modules/elastic_stack/bin/metadata-json-lint delete mode 100755 contrib-modules/elastic_stack/bin/puppet delete mode 100755 contrib-modules/elastic_stack/bin/puppet-lint delete mode 100755 contrib-modules/elastic_stack/bin/rake delete mode 100755 contrib-modules/elastic_stack/bin/rubocop delete mode 100644 contrib-modules/elastic_stack/checksums.json delete mode 100644 contrib-modules/logstash/doc/puppet_classes/logstash_3A_3Arepo.html diff --git a/bin/install-modules.sh b/bin/install-modules.sh index 8c8648c6..3386c90d 100755 --- a/bin/install-modules.sh +++ b/bin/install-modules.sh @@ -4,7 +4,7 @@ PUPPET="puppet module install --force --modulepath /etc/puppet/contrib-modules" -declare -a arr=("apt" "archive" "concat" "firewall" "gcc" "java" "postgresql" "stdlib" "vcsrepo") +declare -a arr=("apt" "concat" "firewall" "gcc" "java" "postgresql" "stdlib" "vcsrepo") for m in "${arr[@]}" do @@ -18,7 +18,6 @@ $PUPPET puppet-tea # elastic-elasticsearch $PUPPET richardc-datacat $PUPPET ispavailability-file_concat $PUPPET elastic-logstash -$PUPPET ssm-munin $PUPPET saz-rsyslog $PUPPET bashtoni-timezone $PUPPET puppet-logrotate diff --git a/contrib-modules/elastic_stack/.fixtures.yml b/contrib-modules/elastic_stack/.fixtures.yml new file mode 100644 index 00000000..699c17d9 --- /dev/null +++ b/contrib-modules/elastic_stack/.fixtures.yml @@ -0,0 +1,8 @@ +fixtures: + forge_modules: + stdlib: puppetlabs/stdlib + apt: puppetlabs/apt + zypprepo: darin/zypprepo + yum: puppet/yum + symlinks: + elastic_stack: "#{source_dir}" diff --git a/contrib-modules/elastic_stack/.gitattributes b/contrib-modules/elastic_stack/.gitattributes new file mode 100644 index 00000000..543dd6ad --- /dev/null +++ b/contrib-modules/elastic_stack/.gitattributes @@ -0,0 +1,4 @@ +*.rb eol=lf +*.erb eol=lf +*.pp eol=lf +*.sh eol=lf diff --git a/contrib-modules/elastic_stack/.gitignore b/contrib-modules/elastic_stack/.gitignore new file mode 100644 index 00000000..bb8970a4 --- /dev/null +++ b/contrib-modules/elastic_stack/.gitignore @@ -0,0 +1,22 @@ +.*.sw[op] +.metadata +.yardoc +.yardwarns +*.iml +/.bundle/ +/.idea/ +/.vagrant/ +/coverage/ +/bin/ +/doc/ +/Gemfile.local +/Gemfile.lock +/junit/ +/log/ +/log/ +/pkg/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/ +/tmp/ +/vendor/ + diff --git a/contrib-modules/elastic_stack/.pmtignore b/contrib-modules/elastic_stack/.pmtignore new file mode 100644 index 00000000..fb589575 --- /dev/null +++ b/contrib-modules/elastic_stack/.pmtignore @@ -0,0 +1,20 @@ +docs/ +pkg/ +Gemfile.lock +Gemfile.local +vendor/ +.vendor/ +spec/fixtures/manifests/ +spec/fixtures/modules/ +.vagrant/ +.bundle/ +.ruby-version +coverage/ +log/ +.idea/ +.dependencies/ +.librarian/ +Puppetfile.lock +*.iml +.*.sw? +.yardoc/ diff --git a/contrib-modules/elastic_stack/.project b/contrib-modules/elastic_stack/.project new file mode 100644 index 00000000..534f916c --- /dev/null +++ b/contrib-modules/elastic_stack/.project @@ -0,0 +1,23 @@ + + + elastic-elastic_stack + + + + + + com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + com.puppetlabs.geppetto.pp.dsl.ui.puppetNature + com.eclipse.xtext.ui.shared.xtextNature + + diff --git a/contrib-modules/elastic_stack/.rspec b/contrib-modules/elastic_stack/.rspec new file mode 100644 index 00000000..16f9cdb0 --- /dev/null +++ b/contrib-modules/elastic_stack/.rspec @@ -0,0 +1,2 @@ +--color +--format documentation diff --git a/contrib-modules/elastic_stack/.rubocop.yml b/contrib-modules/elastic_stack/.rubocop.yml new file mode 100644 index 00000000..4827ee5f --- /dev/null +++ b/contrib-modules/elastic_stack/.rubocop.yml @@ -0,0 +1,108 @@ +--- +require: rubocop-rspec +AllCops: + TargetRubyVersion: '2.1' + Include: + - "./**/*.rb" + Exclude: + - bin/* + - ".vendor/**/*" + - Gemfile + - Rakefile + - pkg/**/* + - spec/fixtures/**/* + - vendor/**/* +Metrics/LineLength: + Description: People have wide screens, use them. + Max: 200 +RSpec/BeforeAfterAll: + Description: Beware of using after(:all) as it may cause state to leak between tests. + A necessary evil in acceptance testing. + Exclude: + - spec/acceptance/**/*.rb +RSpec/HookArgument: + Description: Prefer explicit :each argument, matching existing module's style + EnforcedStyle: each +Style/BlockDelimiters: + Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to + be consistent then. + EnforcedStyle: braces_for_chaining +Style/ClassAndModuleChildren: + Description: Compact style reduces the required amount of indentation. + EnforcedStyle: compact +Style/EmptyElse: + Description: Enforce against empty else clauses, but allow `nil` for clarity. + EnforcedStyle: empty +Style/FormatString: + Description: Following the main puppet project's style, prefer the % format format. + EnforcedStyle: percent +Style/FormatStringToken: + Description: Following the main puppet project's style, prefer the simpler template + tokens over annotated ones. + EnforcedStyle: template +Style/Lambda: + Description: Prefer the keyword for easier discoverability. + EnforcedStyle: literal +Style/RegexpLiteral: + Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 + EnforcedStyle: percent_r +Style/TernaryParentheses: + Description: Checks for use of parentheses around ternary conditions. Enforce parentheses + on complex expressions for better readability, but seriously consider breaking + it up. + EnforcedStyle: require_parentheses_when_complex +Style/TrailingCommaInArguments: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/TrailingCommaInLiteral: + Description: Prefer always trailing comma on multiline literals. This makes diffs, + and re-ordering nicer. + EnforcedStyleForMultiline: comma +Style/SymbolArray: + Description: Using percent style obscures symbolic intent of array's contents. + EnforcedStyle: brackets +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/MixinUsage: + Exclude: + - spec/spec_helper.rb +Style/StringMethods: + Enabled: true +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/MessageExpectation: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/NestedGroups: + Enabled: false +Style/AsciiComments: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/SymbolProc: + Enabled: false +Naming/FileName: + Exclude: + - Vagrantfile diff --git a/contrib-modules/elastic_stack/.travis.yml b/contrib-modules/elastic_stack/.travis.yml new file mode 100644 index 00000000..bc6883ec --- /dev/null +++ b/contrib-modules/elastic_stack/.travis.yml @@ -0,0 +1,29 @@ +--- +sudo: false +dist: trusty +language: ruby +cache: bundler + +before_install: + - bundle -v + - rm Gemfile.lock || true + - gem update --system + - gem update bundler + - gem --version + - bundle -v + +script: + - 'bundle exec rake test' + +matrix: + fast_finish: true + include: + - rvm: 2.4.1 + bundler_args: --without system_tests + env: PUPPET_GEM_VERSION="~> 4.0" + - rvm: 2.3.1 + bundler_args: --without system_tests + env: PUPPET_GEM_VERSION="~> 4.0" + - rvm: 2.1.7 + bundler_args: --without system_tests + env: PUPPET_GEM_VERSION="~> 4.0" diff --git a/contrib-modules/elastic_stack/.yardopts b/contrib-modules/elastic_stack/.yardopts new file mode 100644 index 00000000..3687f518 --- /dev/null +++ b/contrib-modules/elastic_stack/.yardopts @@ -0,0 +1,2 @@ +--markup markdown +--output-dir docs/ diff --git a/contrib-modules/elastic_stack/CHANGELOG.md b/contrib-modules/elastic_stack/CHANGELOG.md index bde7c6aa..62dcca5f 100644 --- a/contrib-modules/elastic_stack/CHANGELOG.md +++ b/contrib-modules/elastic_stack/CHANGELOG.md @@ -1,3 +1,7 @@ +## Release 6.1.0 + +- Support OSS-only package repositories + ## Release 6.0.1 - Remove aggressive ordering causing all packages to come after apt::update diff --git a/contrib-modules/elastic_stack/README.md b/contrib-modules/elastic_stack/README.md index 41aced4d..8a18c474 100644 --- a/contrib-modules/elastic_stack/README.md +++ b/contrib-modules/elastic_stack/README.md @@ -27,3 +27,10 @@ class { 'elastic_stack::repo': prerelease => true, } ``` + +To access the repository for OSS-only packages, set `oss` to `true`. +``` puppet +class { 'elastic_stack::repo': + oss => true, +} +``` diff --git a/contrib-modules/elastic_stack/Rakefile b/contrib-modules/elastic_stack/Rakefile index 81381e0c..82350f67 100644 --- a/contrib-modules/elastic_stack/Rakefile +++ b/contrib-modules/elastic_stack/Rakefile @@ -1,2 +1,11 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' + +desc 'Run the test suite.' +task :test => [ + :rubocop, + :syntax, + :validate, + :lint, + :spec +] diff --git a/contrib-modules/elastic_stack/Vagrantfile b/contrib-modules/elastic_stack/Vagrantfile index 68c7d094..808c7d76 100644 --- a/contrib-modules/elastic_stack/Vagrantfile +++ b/contrib-modules/elastic_stack/Vagrantfile @@ -2,7 +2,8 @@ # exploratory testing of puppet-elastic-stack. It's not used by the formal # testing framwork, it's just for hacking. # -module_root = '/etc/puppetlabs/code/environments/production/modules/elastic_stack' +puppet_code_root = '/etc/puppetlabs/code/environments/production' +module_root = "#{puppet_code_root}/modules/elastic_stack" Vagrant.configure(2) do |config| config.vm.box = 'bento/ubuntu-16.04' @@ -12,9 +13,10 @@ Vagrant.configure(2) do |config| end # Make the module available. - %w[manifests templates].each do |dir| - config.vm.synced_folder(dir, "#{module_root}/#{dir}") - end + config.vm.synced_folder('manifests', "#{module_root}/manifests") + + # Map in a Puppet manifest that can be used for experiments. + config.vm.synced_folder('Vagrantfile.d/manifests', "#{puppet_code_root}/manifests") # Provision with Puppet and Puppetserver config.vm.provision('shell', path: 'Vagrantfile.d/provision.sh') diff --git a/contrib-modules/elastic_stack/Vagrantfile.d/manifests/site.pp b/contrib-modules/elastic_stack/Vagrantfile.d/manifests/site.pp new file mode 100644 index 00000000..6e4e954f --- /dev/null +++ b/contrib-modules/elastic_stack/Vagrantfile.d/manifests/site.pp @@ -0,0 +1,2 @@ +class { 'elastic_stack::repo': +} diff --git a/contrib-modules/elastic_stack/Vagrantfile.d/provision.sh b/contrib-modules/elastic_stack/Vagrantfile.d/provision.sh index 7d2bc992..396430b0 100644 --- a/contrib-modules/elastic_stack/Vagrantfile.d/provision.sh +++ b/contrib-modules/elastic_stack/Vagrantfile.d/provision.sh @@ -12,10 +12,16 @@ service puppet stop service puppetserver stop rm -rf /etc/puppetlabs/puppet/ssl/private_keys/* rm -rf /etc/puppetlabs/puppet/ssl/certs/* - echo 'autosign = true' >> /etc/puppetlabs/puppet/puppet.conf service puppetserver start # Puppet agent looks for the server called "puppet" by default. # In this case, we want that to be us (the loopback address). echo '127.0.0.1 localhost puppet vagrant' > /etc/hosts + +# Install puppet-elastic-stack dependencies. +for module in puppetlabs-apt puppet-yum darin-zypprepo; do + /opt/puppetlabs/bin/puppet module install \ + --target-dir=/etc/puppetlabs/code/environments/production/modules \ + $module +done diff --git a/contrib-modules/elastic_stack/bin/metadata-json-lint b/contrib-modules/elastic_stack/bin/metadata-json-lint deleted file mode 100755 index a91e611a..00000000 --- a/contrib-modules/elastic_stack/bin/metadata-json-lint +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'metadata-json-lint' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("metadata-json-lint", "metadata-json-lint") diff --git a/contrib-modules/elastic_stack/bin/puppet b/contrib-modules/elastic_stack/bin/puppet deleted file mode 100755 index 7f0660b2..00000000 --- a/contrib-modules/elastic_stack/bin/puppet +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'puppet' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("puppet", "puppet") diff --git a/contrib-modules/elastic_stack/bin/puppet-lint b/contrib-modules/elastic_stack/bin/puppet-lint deleted file mode 100755 index b406bd02..00000000 --- a/contrib-modules/elastic_stack/bin/puppet-lint +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'puppet-lint' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("puppet-lint", "puppet-lint") diff --git a/contrib-modules/elastic_stack/bin/rake b/contrib-modules/elastic_stack/bin/rake deleted file mode 100755 index 486010f4..00000000 --- a/contrib-modules/elastic_stack/bin/rake +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rake' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rake", "rake") diff --git a/contrib-modules/elastic_stack/bin/rubocop b/contrib-modules/elastic_stack/bin/rubocop deleted file mode 100755 index ccb4d563..00000000 --- a/contrib-modules/elastic_stack/bin/rubocop +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rubocop' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rubocop", "rubocop") diff --git a/contrib-modules/elastic_stack/checksums.json b/contrib-modules/elastic_stack/checksums.json deleted file mode 100644 index 3589c20b..00000000 --- a/contrib-modules/elastic_stack/checksums.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "CHANGELOG.md": "0284904344a12171663b11d9019871dd", - "Gemfile": "183549d55a41bd882aef8dfa8218356c", - "README.md": "e721c8dab0499213e866541caad1e5b0", - "Rakefile": "1229bb6a344b98c0e53d34e9e01b5776", - "Vagrantfile": "ee539cfb5f121a434c0abe146a73c428", - "Vagrantfile.d/provision.sh": "c3c6788b9e84cb8de79ae61caae60b11", - "appveyor.yml": "890733598bc8d3cc58268aad08ca0a40", - "bin/metadata-json-lint": "f81b2db79e27512a1113dadcefeda588", - "bin/puppet": "942860ab5244c62578a4a0e5b2952bd9", - "bin/puppet-lint": "40f3af7d22bfcdc0d1bdfe121f2addcb", - "bin/rake": "f663040ad9a495d23d446a56f2f42bcc", - "bin/rubocop": "ad4ad86162fd167c1fdddfe31abdd054", - "manifests/repo.pp": "be0ec6518b82c3c516df59b1d5f60ac6", - "metadata.json": "e8015fab279e6c972a1ee02ffa27e99e", - "spec/classes/repo_spec.rb": "5c7e84da3727cd0c008ad98b00bf19df", - "spec/default_facts.yml": "4de3cb611af6981a6d22bc77d7dd6f6f", - "spec/spec_helper.rb": "898577ed31fbf848330924de64091e60" -} \ No newline at end of file diff --git a/contrib-modules/elastic_stack/manifests/repo.pp b/contrib-modules/elastic_stack/manifests/repo.pp index fbbf097b..6b75a601 100644 --- a/contrib-modules/elastic_stack/manifests/repo.pp +++ b/contrib-modules/elastic_stack/manifests/repo.pp @@ -5,25 +5,55 @@ # @example # include elastic_stack::repo # -# @param version The (major) version of the Elastic Stack for which to configure the repo +# @param oss Whether to use the purely open source (i.e., bundled without X-Pack) repository +# @param prerelease Whether to use a repo for prerelease versions, like "6.0.0-rc2" # @param priority A numeric priority for the repo, passed to the package management system # @param proxy The URL of a HTTP proxy to use for package downloads (YUM only) -# @param prerelease Whether to use a repo for prerelease versions, like "6.0.0-rc2" +# @param version The (major) version of the Elastic Stack for which to configure the repo class elastic_stack::repo( - Integer $version=6, - Optional[Integer] $priority=undef, - String $proxy='absent', - Boolean $prerelease=false, + Boolean $oss = false, + Boolean $prerelease = false, + Optional[Integer] $priority = undef, + String $proxy = 'absent', + Integer $version = 6, ) { if $prerelease { - $url_suffix = '-prerelease' + $version_suffix = '.x-prerelease' + } else { + $version_suffix = '.x' } - else { - $url_suffix = '' + + if $oss { + $version_prefix = 'oss-' + } else { + $version_prefix = '' + } + + if $version > 2 { + $_repo_url = 'https://artifacts.elastic.co/packages' + case $facts['os']['family'] { + 'Debian': { + $_repo_path = 'apt' + } + default: { + $_repo_path = 'yum' + } + } + } else { + $_repo_url = 'https://packages.elastic.co/elasticsearch' + case $facts['os']['family'] { + 'Debian': { + $_repo_path = 'debian' + } + default: { + $_repo_path = 'centos' + } + } } - $base_url = "https://artifacts.elastic.co/packages/$%7Bversion%7D.x$%7Burl_suffix%7D" + + $base_url = "${_repo_url}/${version_prefix}${version}${version_suffix}/${_repo_path}" $key_id='46095ACC8548582C1A2699A9D27D666CD88E42B4' $key_source='https://artifacts.elastic.co/GPG-KEY-elasticsearch' $description='Elastic package repository.' @@ -35,7 +65,7 @@ apt::source { 'elastic': ensure => 'present', comment => $description, - location => "${base_url}/apt", + location => $base_url, release => 'stable', repos => 'main', key => { @@ -52,7 +82,7 @@ 'RedHat', 'Linux': { yumrepo { 'elastic': descr => $description, - baseurl => "${base_url}/yum", + baseurl => $base_url, gpgcheck => 1, gpgkey => $key_source, enabled => 1, @@ -85,7 +115,7 @@ } zypprepo { 'elastic': - baseurl => "${base_url}/yum", + baseurl => $base_url, enabled => 1, autorefresh => 1, name => 'elastic', diff --git a/contrib-modules/elastic_stack/metadata.json b/contrib-modules/elastic_stack/metadata.json index 512e4134..38fae045 100644 --- a/contrib-modules/elastic_stack/metadata.json +++ b/contrib-modules/elastic_stack/metadata.json @@ -1,11 +1,10 @@ { "name": "elastic-elastic_stack", - "version": "6.0.2", + "version": "6.1.0", "author": "toby@jarpy.net", "summary": "Helpers for installing and configuring components of the Elastic Stack.", "license": "Apache-2.0", "source": "https://github.com/elastic/puppet-elastic-stack", - "project_page": "https://github.com/elastic/puppet-elastic-stack", "issues_url": "https://github.com/elastic/puppet-elastic-stack/issues", "dependencies": [ { @@ -21,7 +20,6 @@ "version_requirement": ">= 0.9.6 < 3.0.0" } ], - "data_provider": null, "operatingsystem_support": [ { "operatingsystem": "Debian", diff --git a/contrib-modules/elastic_stack/spec/classes/repo_spec.rb b/contrib-modules/elastic_stack/spec/classes/repo_spec.rb index c7a18139..e41933c9 100644 --- a/contrib-modules/elastic_stack/spec/classes/repo_spec.rb +++ b/contrib-modules/elastic_stack/spec/classes/repo_spec.rb @@ -1,7 +1,13 @@ require 'spec_helper' def url(http://github.com/format,%20version) - "https://artifacts.elastic.co/packages/#{version}/#{format}" + case version + when %r{^2} + repo_type = (format == 'yum') ? 'centos' : 'debian' + "https://packages.elastic.co/elasticsearch/#{version}/#{repo_type}" + else + "https://artifacts.elastic.co/packages/#{version}/#{format}" + end end def declare_apt(version: '6.x', **params) @@ -38,6 +44,19 @@ def declare_zypper(version: '6.x', **params) it { is_expected.to contain_exec('elastic_zypper_refresh_elastic').with(command: 'zypper refresh elastic') } end + context 'with "version => 2"' do + let(:params) { default_params.merge(version: 2) } + + case facts[:os]['family'] + when 'Debian' + it { is_expected.to declare_apt(version: '2.x') } + when 'RedHat' + it { is_expected.to declare_yum(version: '2.x') } + when 'Suse' + it { is_expected.to declare_zypper(version: '2.x') } + end + end + context 'with "version => 5"' do let(:params) { default_params.merge(version: 5) } @@ -77,6 +96,32 @@ def declare_zypper(version: '6.x', **params) end end + context 'with "oss => true"' do + let(:params) { default_params.merge(oss: true) } + + case facts[:os]['family'] + when 'Debian' + it { is_expected.to declare_apt(version: 'oss-6.x') } + when 'RedHat' + it { is_expected.to declare_yum(version: 'oss-6.x') } + when 'Suse' + it { is_expected.to declare_zypper(version: 'oss-6.x') } + end + end + + context 'with "oss and prerelease => true"' do + let(:params) { default_params.merge(oss: true, prerelease: true) } + + case facts[:os]['family'] + when 'Debian' + it { is_expected.to declare_apt(version: 'oss-6.x-prerelease') } + when 'RedHat' + it { is_expected.to declare_yum(version: 'oss-6.x-prerelease') } + when 'Suse' + it { is_expected.to declare_zypper(version: 'oss-6.x-prerelease') } + end + end + context 'with proxy parameter' do let(:params) { default_params.merge(proxy: 'http://proxy.com:8080/') } diff --git a/contrib-modules/logstash/CHANGELOG b/contrib-modules/logstash/CHANGELOG index d861f586..02b1a0f7 100644 --- a/contrib-modules/logstash/CHANGELOG +++ b/contrib-modules/logstash/CHANGELOG @@ -1,3 +1,6 @@ +6.1.1 + Update init system handling. + 6.1.0 Support centralized pipeline management. diff --git a/contrib-modules/logstash/checksums.json b/contrib-modules/logstash/checksums.json index 4299e3c3..2b6a5c66 100644 --- a/contrib-modules/logstash/checksums.json +++ b/contrib-modules/logstash/checksums.json @@ -1,5 +1,5 @@ { - "CHANGELOG": "4a8bb52d54b65e048a00608ef1edb3e2", + "CHANGELOG": "90e05afda22fc824050ed5366353cf1e", "CONTRIBUTING.md": "e165c224f5cf18e14c5bcb1d24f23d75", "CONTRIBUTORS": "ccd05b41a94ee89f67cc20f3d3b0a6d3", "LICENSE": "320a45413b8e94d84ec24e1084c8b5bf", @@ -8,27 +8,26 @@ "Vagrantfile": "7d1ad3b3f7d66b49c12eb85cc93e9306", "Vagrantfile.d/manifests/site.pp": "11779ad0c9f36b6ea7c0e075ad5030eb", "Vagrantfile.d/server.sh": "b8e187fdeeb70d8e4948a38a37604506", - "doc/_index.html": "de3a403b5c82522c472fd92dff946e3f", + "doc/_index.html": "3f0d370c84824527bde826f00922045b", "doc/css/common.css": "e19d0e0e1d66eae21212f0de39c4c7cf", "doc/css/full_list.css": "e1ec5115f4678514de990e9796ce3734", - "doc/css/style.css": "6d6fdb2b2a289bc7fcdc7e14112f6a9c", - "doc/file.README.html": "9031d8a0a05138ac8508446d84011633", - "doc/frames.html": "f6bf7ff3e9c1d55e138595e96cb6e924", - "doc/index.html": "aa3af69dc7213d52649411d6dbf5cd52", - "doc/js/app.js": "4a445ef2b0260c1903fdd5dfa222a4c5", + "doc/css/style.css": "1b1db11f3336690389b9d490a2ac0495", + "doc/file.README.html": "b20a25daeecf6779f99ec8c32027f2d7", + "doc/frames.html": "d5b498156ffef0d5731567ac0539d175", + "doc/index.html": "e21c5a50088b5ecf00e08a3858247e1d", + "doc/js/app.js": "054fce4b001f25f37d818ab0852036ba", "doc/js/full_list.js": "3ce34d62498c53ac637516bf4bf2afab", "doc/js/jquery.js": "ddb84c1587287b2df08966081ef063bf", "doc/puppet_class_list.html": "45db721d39f2b5fb795dbf5e96ab053f", - "doc/puppet_classes/logstash.html": "e76bbf59d64686c1801c789fb45ba8f5", - "doc/puppet_classes/logstash_3A_3Aconfig.html": "7550b1b1f1dcd2f2e32c60d88d78361b", - "doc/puppet_classes/logstash_3A_3Apackage.html": "f5dc51e907af8c5d0daa04c65ede9757", - "doc/puppet_classes/logstash_3A_3Arepo.html": "75a7fdc25942430fb86a12bde0bd7839", - "doc/puppet_classes/logstash_3A_3Aservice.html": "8ad3b438983f58c9d7d78f69cfd99336", + "doc/puppet_classes/logstash.html": "0fbd8dd72b1b0ddb2964997ca4bfa099", + "doc/puppet_classes/logstash_3A_3Aconfig.html": "30ee081896c3284733b5a1ec5af293a9", + "doc/puppet_classes/logstash_3A_3Apackage.html": "5e641aa6f49b1f4e1d6536940eb7987d", + "doc/puppet_classes/logstash_3A_3Aservice.html": "e3c149b962099d750332943e13f79695", "doc/puppet_defined_type_list.html": "e36f7ed94cec5dabb9dee27afa6e41d0", - "doc/puppet_defined_types/logstash_3A_3Aconfigfile.html": "2b07cb4c1a801edb2dfdad42d4cebc59", - "doc/puppet_defined_types/logstash_3A_3Apatternfile.html": "1c88d90d53d466f9b1aaf0297c9c6680", - "doc/puppet_defined_types/logstash_3A_3Aplugin.html": "23e30bd45ced9cad6ee10b1b6b28c59a", - "doc/top-level-namespace.html": "995ce9ef9b9fe42c32767316f9c61ece", + "doc/puppet_defined_types/logstash_3A_3Aconfigfile.html": "f1b926922e15cec462406beecbd61dfc", + "doc/puppet_defined_types/logstash_3A_3Apatternfile.html": "411baf05645d11127d0ed1fefba2dd8d", + "doc/puppet_defined_types/logstash_3A_3Aplugin.html": "e1b0bd845f479b181aa42764419a6c57", + "doc/top-level-namespace.html": "34672247a69df22e8b93b8ad257a5900", "files/grok-pattern-0": "419f29f042455c0074f0b8ba544a82f8", "files/grok-pattern-1": "bcbfca663965c78d248802492aa75f59", "files/logstash-output-cowsay-5.0.0.zip": "4714feef2b951352fdbcf2c3093478cf", @@ -37,11 +36,11 @@ "manifests/configfile.pp": "c2a88c662c57c3cecac0939700c29a7c", "manifests/init.pp": "8d78e551c2ad6419f91589d50e4d4abb", "manifests/package/install.pp": "87dd3c706a6cb9c635ab328477dc3fc1", - "manifests/package.pp": "b0de4a75e587d0a3171085f89fd31260", + "manifests/package.pp": "779d3ad4eefe1ef72cf0df3a8cacf30f", "manifests/patternfile.pp": "12b5e2b8bc2fc3c79e02dfa9b85c6275", "manifests/plugin.pp": "96b6f136633d423da5df1da468ffd867", - "manifests/service.pp": "79c02bcf180e7411e348561e6ec1c4c5", - "metadata.json": "44cea12b24205eb0c45db608fc39da86", + "manifests/service.pp": "785b5a7549976c5de34d8736c2c307ee", + "metadata.json": "6e834ddf340b849f08f88e0db0202545", "templates/configfile-template.erb": "2814d2f5ccd0556a0c5c53af4d613050", "templates/jvm.options.erb": "01aee9a94bda5500caf76a09d4d899b9", "templates/logstash.yml.erb": "c78e60b55e6d7259e90831ea2f3ed398", diff --git a/contrib-modules/logstash/doc/_index.html b/contrib-modules/logstash/doc/_index.html index f3bd6594..17d1f96f 100644 --- a/contrib-modules/logstash/doc/_index.html +++ b/contrib-modules/logstash/doc/_index.html @@ -4,7 +4,7 @@ - Documentation by YARD 0.9.12 + Documentation by YARD 0.9.13 @@ -52,7 +52,7 @@
-

Documentation by YARD 0.9.12

+

Documentation by YARD 0.9.13

Alphabetic Index

@@ -134,6 +134,8 @@

Defined Type Listing A-Z

+ +

File Listing

    diff --git a/contrib-modules/logstash/doc/css/style.css b/contrib-modules/logstash/doc/css/style.css index 57e8f9d6..0bf7e2c7 100644 --- a/contrib-modules/logstash/doc/css/style.css +++ b/contrib-modules/logstash/doc/css/style.css @@ -245,6 +245,7 @@ ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; } dl.constants { margin-left: 10px; } dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; } +dl.constants.compact dt { display: inline-block; font-weight: normal } dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; } dl.constants .docstring .note:first-child { margin-top: 5px; } @@ -326,13 +327,9 @@ ul.summary a, ul.summary a:visited { text-decoration: none; font-size: 1.1em; } ul.summary li { margin-bottom: 5px; } -.summary .summary_signature { - padding: 4px 8px; - background: #f8f8f8; - border: 1px solid #f0f0f0; - border-radius: 5px; -} +.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; } .summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; } +.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; } ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;} ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; } #content .summary_signature:hover a, @@ -485,7 +482,7 @@ pre.code .rubyid_nth_ref { color: #6D79DE; } pre.code .regexp, .dregexp { color: #036A07; } pre.code a { border-bottom: 1px dotted #bbf; } /* inline code */ -p > code { +*:not(pre) > code { padding: 1px 3px 1px 3px; border: 1px solid #E1E1E8; background: #F7F7F9; diff --git a/contrib-modules/logstash/doc/file.README.html b/contrib-modules/logstash/doc/file.README.html index dc061e7b..0a15d32e 100644 --- a/contrib-modules/logstash/doc/file.README.html +++ b/contrib-modules/logstash/doc/file.README.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 diff --git a/contrib-modules/logstash/doc/frames.html b/contrib-modules/logstash/doc/frames.html index 42ca6b61..7b637438 100644 --- a/contrib-modules/logstash/doc/frames.html +++ b/contrib-modules/logstash/doc/frames.html @@ -2,7 +2,7 @@ - Documentation by YARD 0.9.12 + Documentation by YARD 0.9.13 - - - - - - - - - - - -
    - - -

    Puppet Class: logstash::repo

    -
    - - -
    -
    Defined in:
    -
    - manifests/repo.pp -
    -
    -
    -

    Overview

    -
    -
    -

    This class manages package repositories for Logstash.

    - -

    It is usually used only by the top-level logstash class. It's unlikely -that you will need to declare this class yourself.

    - -
    -
    -
    - -
    -

    Examples:

    - - -

    Include this class to ensure its resources are available.

    -

    - -
    include logstash::repo
    - -
    - -

    Author:

    - - -
    - - - - - -
    -
    -
    -
    -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
    -
    -
    # File 'manifests/repo.pp', line 11
    -
    -class logstash::repo {
    -  $version = $logstash::repo_version
    -  $repo_name = "elastic-${version}"
    -  $url_root = "https://artifacts.elastic.co/packages/${version}"
    -  $gpg_key_url = 'https://artifacts.elastic.co/GPG-KEY-elasticsearch'
    -  $gpg_key_id = '46095ACC8548582C1A2699A9D27D666CD88E42B4'
    -
    -  Exec {
    -    path      => [ '/bin', '/usr/bin', '/usr/local/bin' ],
    -    cwd       => '/',
    -  }
    -
    -  case $::osfamily {
    -    'Debian': {
    -      include apt
    -
    -      apt::source { $repo_name:
    -        location => "${url_root}/apt",
    -        release  => 'stable',
    -        repos    => 'main',
    -        key      => {
    -          'id'     => $gpg_key_id,
    -          'source' => $gpg_key_url,
    -        },
    -        include  => {
    -          'src' => false,
    -        },
    -        notify   => [
    -          Class['apt::update'],
    -          Exec['apt_update'],
    -        ],
    -      }
    -    }
    -    'RedHat': {
    -      yumrepo { $repo_name:
    -        descr    => 'Logstash Centos Repo',
    -        baseurl  => "${url_root}/yum",
    -        gpgcheck => 1,
    -        gpgkey   => $gpg_key_url,
    -        enabled  => 1,
    -      }
    -
    -      Yumrepo[$repo_name] -> Package<|tag == 'logstash'|>
    -    }
    -    'Suse' : {
    -      zypprepo { $repo_name:
    -        baseurl     => "${url_root}/yum",
    -        enabled     => 1,
    -        autorefresh => 1,
    -        name        => 'logstash',
    -        gpgcheck    => 1,
    -        gpgkey      => $gpg_key_url,
    -        type        => 'yum',
    -      }
    -
    -      # Workaround until zypprepo allows the adding of the keys
    -      # https://github.com/deadpoint/puppet-zypprepo/issues/4
    -      exec { 'logstash_suse_import_gpg':
    -        command => "wget -q -O /tmp/RPM-GPG-KEY-elasticsearch ${gpg_key_url}; \
    -                    rpm --import /tmp/RPM-GPG-KEY-elasticsearch; \
    -                    rm /tmp/RPM-GPG-KEY-elasticsearch",
    -        unless  => "test $(rpm -qa gpg-pubkey | grep -i \"${gpg_key_id}\" | wc -l) -eq 1 ",
    -      }
    -
    -      Exec['logstash_suse_import_gpg'] ~> Zypprepo['logstash'] -> Package<|tag == 'logstash'|>
    -    }
    -    default: {
    -      fail("\"${module_name}\" provides no repository information for OSfamily \"${::osfamily}\"")
    -    }
    -  }
    -}
    -
    -
    -
    - - - -
    - - \ No newline at end of file diff --git a/contrib-modules/logstash/doc/puppet_classes/logstash_3A_3Aservice.html b/contrib-modules/logstash/doc/puppet_classes/logstash_3A_3Aservice.html index 906b3c68..221c55ce 100644 --- a/contrib-modules/logstash/doc/puppet_classes/logstash_3A_3Aservice.html +++ b/contrib-modules/logstash/doc/puppet_classes/logstash_3A_3Aservice.html @@ -6,7 +6,7 @@ Puppet Class: logstash::service - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 @@ -273,7 +273,13 @@

    Overview

    164 165 166 -167 +167 +168 +169 +170 +171 +172 +173
    # File 'manifests/service.pp', line 11
    @@ -413,6 +419,12 @@ 

    Overview

    elsif($os =~ /opensuse/ and $release == '13') { $service_provider = 'systemd' } + #Older Amazon Linux AMIs has its release based on the year + #it came out (2010 and up); the provider needed to be set explicitly; + #New Amazon Linux 2 AMIs has the release set to 2, Puppet can handle it + elsif($os =~ /amazon/ and versioncmp($release, '2000') > 0) { + $service_provider = 'upstart' + } else { # In most cases, Puppet(4) can figure out the correct service # provider on its own, so we'll just say 'undef', and let it do diff --git a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aconfigfile.html b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aconfigfile.html index 9f21d06a..b7886cef 100644 --- a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aconfigfile.html +++ b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aconfigfile.html @@ -6,7 +6,7 @@ Defined Type: logstash::configfile - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 diff --git a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Apatternfile.html b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Apatternfile.html index 6810140b..797312af 100644 --- a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Apatternfile.html +++ b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Apatternfile.html @@ -6,7 +6,7 @@ Defined Type: logstash::patternfile - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 diff --git a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aplugin.html b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aplugin.html index 58486a54..d78769d5 100644 --- a/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aplugin.html +++ b/contrib-modules/logstash/doc/puppet_defined_types/logstash_3A_3Aplugin.html @@ -6,7 +6,7 @@ Defined Type: logstash::plugin - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 diff --git a/contrib-modules/logstash/doc/top-level-namespace.html b/contrib-modules/logstash/doc/top-level-namespace.html index 05268791..873bf393 100644 --- a/contrib-modules/logstash/doc/top-level-namespace.html +++ b/contrib-modules/logstash/doc/top-level-namespace.html @@ -6,7 +6,7 @@ Top Level Namespace - — Documentation by YARD 0.9.12 + — Documentation by YARD 0.9.13 diff --git a/contrib-modules/logstash/manifests/package.pp b/contrib-modules/logstash/manifests/package.pp index 40d906a5..ce07c0bf 100644 --- a/contrib-modules/logstash/manifests/package.pp +++ b/contrib-modules/logstash/manifests/package.pp @@ -100,7 +100,10 @@ $package_local_file = undef $package_provider = undef if $::osfamily == 'Debian' { - $package_require = Class['apt::update'] + $package_require = $logstash::manage_repo ? { + true => Class['apt::update'], + false => undef, + } } else { $package_require = undef } diff --git a/contrib-modules/logstash/manifests/service.pp b/contrib-modules/logstash/manifests/service.pp index 97fd5d01..05122da2 100644 --- a/contrib-modules/logstash/manifests/service.pp +++ b/contrib-modules/logstash/manifests/service.pp @@ -143,6 +143,12 @@ elsif($os =~ /opensuse/ and $release == '13') { $service_provider = 'systemd' } + #Older Amazon Linux AMIs has its release based on the year + #it came out (2010 and up); the provider needed to be set explicitly; + #New Amazon Linux 2 AMIs has the release set to 2, Puppet can handle it + elsif($os =~ /amazon/ and versioncmp($release, '2000') > 0) { + $service_provider = 'upstart' + } else { # In most cases, Puppet(4) can figure out the correct service # provider on its own, so we'll just say 'undef', and let it do diff --git a/contrib-modules/logstash/metadata.json b/contrib-modules/logstash/metadata.json index 6e55dd03..7aff4afd 100644 --- a/contrib-modules/logstash/metadata.json +++ b/contrib-modules/logstash/metadata.json @@ -1,6 +1,6 @@ { "name": "elastic-logstash", - "version": "6.1.0", + "version": "6.1.1", "author": "elastic", "summary": "Module for managing and configuring Logstash", "license": "Apache-2.0", From aafe4b5858caa6a797819a6179bef25eeea43947 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 5 Jun 2018 00:04:22 +0200 Subject: [PATCH 023/147] update keys --- modules/metacpan/files/default/home/haarg/ssh/authorized_keys | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys index 4a6947e4..72e26b2b 100644 --- a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys @@ -1,4 +1,4 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6wBnxyfoyNIVcfaw07MwCdnrq5StFGTwXkU7Guh+fb gknop@cuneus ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH7JaCN6LRb/P2tjRVSNxZ5hEKJ3GRnYVyT/X2C4ePQHd3aNb1LyaI4DYo66t1VJUkduzXoQY0vPSlxOeBTr5L5Dzs36S6mMlU182XJ8YJwYYsSd7cwxR3cGBRlBGP8to+RnjkhQodRi5ozWTUVA9RNexCMHZwPPWJsxoKhUWsFiZE19c+eieRuA2rkOj7aQy6dz9vzu0a6uznby8XBDJC+6nw8SZRCw9aiiep07aGSA5kyz8LaxkQXfT7l/pPiwbqnTN6u0jF3VaImPB2ByT3QynUhNbkawixcr992yca0bRRS8cjnu4sgjipo2BN0dl6iPoamzmsAh5tdBlmRjoH gknop@cuneus -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPA+EexKAWEG5IHhghpZLJZtWIRew0AoqKKphOq5Pqz4 gknop@C02QV2JTFVH6 -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXJiAkDecjn42MGMHV+PgIbS2XhSg0NRvO1Kwq2b/Ebt6mqsXab8bJKpF6iLnrcwfnvHnZHuz+qZq14ZBmkOJnJWP9gK6KIxg5lW2U1pLTjtgZWSWrrJZPXDpkXQvSHm69P5jhc5KdqeVecn7aTEPhLUm2u07+H4oLIHm3jFjtDB41+nVLRuynkGB1oxjoVHNOu2hUtO+CdBWVsn07C7DQShRIT6lrrLHtL1PokkZzsY6aQ1xy99p6VgWJK+Cbh3sXpzqQwL+V8tqNqqa5ua/ISU9i9pDeNjd3GqShIZpRUnHXl+G/LowXMS2d4x2OaA7kZpCrqovIqeNFmCR9jsitToWj/JfDM5eiB+j7BCiawIsuTzo0XfZTaV/20sDX07ZqKVlpfDLcOog3w+rtO8EfL4kBk7YaAyTe+K8wmPyuj7PvhbybMbsU+hZdCdz2e2v/+KNrZs8LSwRMfNQWnBZAG4KGkYmI3xN6H407NB3Y8gFfZxk6043kifLcDnojkZcCkz16oimEPK0Xqan34Gw52YjcJkuv8rqiGR5Rbe02yorFDWPEAF2Lnei210NKhnAc8az5tN05OCYCIyOeg/21DK2nVXEPCPylAj9+toga1RralpedhjgOXXEnN7uoXf6w56E7m1JpuEoorr0sMBGAsj4ZBs3DSWj6Kn2OK3HdQw== gknop@C02QV2JTFVH6 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPYWnCQqRC8olnKcqxNpvb7q1ei7kQOk6Wadbeo61O8w gknop@C02QV2JTFVH6 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOAW3UIIDRMoYp8yP6aKhyyfNPsFGMB2D61V4bv4HYzglJyeFLdvEUWfupd7ClnsM9RFv64hHy7bno/8uX9bkXQ7xhq6H90VbZDW4pb54kICy3acMxTKoqd3LRY33pyL5O1YlBJfp7BEwsldIxKKGmyuXQesMvImFM1hi6ObAetO7qDwS+vRp/wq02OvC1lGoFiTds96ohmATKhCC63QfLyb86yeWoExClJo9OU/a3u32WkV39RKC1WOB8OhaUyGiuaca9GCGAQctZeqx7kgGGYkaRkIV8wNw9d0kaNaRG0E7qb8OVQ2D0rgCckdFZ0g2E0B3KDn2NUFCPhlvjnFeTx6YvTVVTV0qcF0yYlaJcSS6ruQjSIflR4S+raQo7cVc+FxM4oq0Xs2QDlZmzWD45mTs/6geUsjFg4dLYNOPx7tRNMx/MP0FHoo6q6v1OPsbF8n/FGNCzOhGLl+ogz3kTxfNzhUysspyXlc/hvL7BlVPlkqiiPf1MrCQCt21atG1RSoH14PAhfk8WwXa6ZPp+YRKtpNOpR0kZvrzKadp4LV9btC94VnnWQhibdyuEbIXlIRXY6rr8mroT0XTrn916AhT4VGR2iYwboXDbPbdXVMQq0xKE64LdBCKTN0MXSmFhantfROde2Y11NgD8DAtu1D0KVfTZSk8DrhJXacGIpw== gknop@C02QV2JTFVH6 From 90a963135152dc677de6b9c7be32351a1c1f1bfe Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 16 Jun 2018 13:03:46 +0100 Subject: [PATCH 024/147] add config for bm-mc-04 --- hieradata/nodes/bm-mc-04.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 hieradata/nodes/bm-mc-04.yaml diff --git a/hieradata/nodes/bm-mc-04.yaml b/hieradata/nodes/bm-mc-04.yaml new file mode 100644 index 00000000..0680031d --- /dev/null +++ b/hieradata/nodes/bm-mc-04.yaml @@ -0,0 +1,13 @@ +--- +classes: + - metacpan_postgres::install_only + - metacpan_postgres::pgpass + - minion_queue + +minion_queue::service::workers: 10 +minion_queue::service::ensure: running +minion_queue::service::enable: true + +metacpan::crons::general: + metacpan_sitemaps: + minute : 35 From 367929daa5c258f558d163ec9e4e5d29979de8a1 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 16 Jun 2018 20:09:09 +0100 Subject: [PATCH 025/147] bm-mc-04 (with SSD) is replacing 03 (which is going back to a stage box) --- hieradata/datacenter/bytemark-YO26-york.yaml | 4 ++-- hieradata/nodes/bm-mc-03.yaml | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hieradata/datacenter/bytemark-YO26-york.yaml b/hieradata/datacenter/bytemark-YO26-york.yaml index 11f8f34d..37d42837 100644 --- a/hieradata/datacenter/bytemark-YO26-york.yaml +++ b/hieradata/datacenter/bytemark-YO26-york.yaml @@ -2,12 +2,12 @@ metacpan::elasticsearch::cluster_hosts: - 5.153.225.19 # bm-mc-01 - 5.153.225.20 # bm-mc-02 - - 46.43.35.68 # bm-mc-03 + - 89.16.178.21 # bm-mc-04 metacpan::postgres::access_hosts: - 5.153.225.19 # bm-mc-01 - 5.153.225.20 # bm-mc-02 - - 46.43.35.68 # bm-mc-03 + - 89.16.178.21 # bm-mc-04 # Run on our public IP address (firewall limits access # to other nodes in our cluster) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 43f877c2..038c22b5 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -2,13 +2,15 @@ classes: - metacpan::system::rsyslog::server - metacpan_kibana - - metacpan_postgres::install_only - - metacpan_postgres::pgpass - - minion_queue -minion_queue::service::workers: 10 -minion_queue::service::ensure: running -minion_queue::service::enable: true +metacpan::elasticsearch::cluster_name: 'meta_log' +metacpan::elasticsearch::master_nodes: 1 +metacpan::elasticsearch::expected_nodes: 1 +metacpan::elasticsearch::replicas: 0 +metacpan::elasticsearch::recover_after_nodes: 1 +metacpan::elasticsearch::cluster_hosts: + - 46.43.35.68 # bm-mc-03 +metacpan::elasticsearch::auto_create_indexes: 'syslog-*,app-*,access-*' metacpan::fw_ports: rsyslog: @@ -22,3 +24,9 @@ rsyslog::extra_modules: metacpan::crons::general: metacpan_sitemaps: minute : 15 + +# Use this to run stage branch if required +# metacpan::web::starman: +# metacpan-web: +# git_revision: 'stage' + From c3197307a386c1799085751dc48b576e7b75817d Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 16 Jun 2018 20:16:55 +0100 Subject: [PATCH 026/147] set sco workers to 10 --- hieradata/env/production.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 6539e7be..a6858279 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -76,7 +76,7 @@ metacpan::web::starman: - "sco.%{hostname}.metacpan.org" - ".mcpan.org" starman_port: 5005 - starman_workers: 1 + metacpan::web::static: metacpan-explorer: From 362c05aa7a65fac8528ba5d0ca17ca26ace0ce0b Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 16 Jun 2018 20:18:46 +0100 Subject: [PATCH 027/147] nolonger need auto_create_indexes as using 03 again --- hieradata/datacenter/bytemark-YO26-york.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/hieradata/datacenter/bytemark-YO26-york.yaml b/hieradata/datacenter/bytemark-YO26-york.yaml index 37d42837..a0a0a955 100644 --- a/hieradata/datacenter/bytemark-YO26-york.yaml +++ b/hieradata/datacenter/bytemark-YO26-york.yaml @@ -13,6 +13,4 @@ metacpan::postgres::access_hosts: # to other nodes in our cluster) metacpan::elasticsearch::ipaddress: "%{::ipaddress}" -metacpan::elasticsearch::auto_create_indexes: 'syslog-*,app-*,access-*' - metacpan::rsyslog::client::log_remote: true From da55cb4f2e8ddd5dc5ca7e377fcb726299c2637f Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 16 Jun 2018 20:32:17 +0100 Subject: [PATCH 028/147] make sure 04 looks like a bytemark box in the facts --- hieradata/common.yaml | 2 ++ modules/facts/lib/facter/datacenter.rb | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 7a94c9fc..c73ba739 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -25,6 +25,8 @@ munin::master::node_definitions: address: 5.153.225.20 'bm-mc-03.metacpan.org': address: 46.43.35.68 + 'bm-mc-04.metacpan.org': + address: 89.16.178.21 # Munin node config munin::node::allow: diff --git a/modules/facts/lib/facter/datacenter.rb b/modules/facts/lib/facter/datacenter.rb index d002aa78..4417e9d8 100644 --- a/modules/facts/lib/facter/datacenter.rb +++ b/modules/facts/lib/facter/datacenter.rb @@ -4,9 +4,12 @@ when /^5\.153\.225\./ # bm-mc-01 and bm-mc-02 'bytemark-YO26-york' - when /^46\.43\.35\./ + when /^46\.43\.35\.68/ # bm-mc-03 'bytemark-YO26-york' + when /^89\.16\.178\.21/ + # bm-mc-04 + 'bytemark-YO26-york' when /^50\.28\.18\./ 'liquidweb' else From 30fb9c059d9f27915c3a9f2c9e1204189d228424 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 17 Jun 2018 20:53:03 +0100 Subject: [PATCH 029/147] add snapshots for new indices, and kill off cpanratings --- hieradata/common.yaml | 10 ++++++++++ hieradata/nodes/bm-mc-01.yaml | 6 +++++- hieradata/nodes/lw-mc-03.yaml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index c73ba739..0463e3b7 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -298,6 +298,16 @@ metacpan::crons::api: hour : 2 minute : 5 ensure : absent + snapshot_cover_index: + cmd : snapshot --snap --indices 'cover' --snap-stub cover --date-format '\%Y-\%m-\%d' + hour : 2 + minute : 15 + ensure : absent + snapshot_contributor_index: + cmd : snapshot --snap --indices 'contributor' --snap-stub contributor --date-format '\%Y-\%m-\%d' + hour : 2 + minute : 20 + ensure : absent snapshot_purge_old: cmd : snapshot --purge-old hour : 3 diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 20fb28bf..f7f2c61f 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -21,6 +21,10 @@ metacpan::crons::general: minute : 5 metacpan::crons::api: + snapshot_cover_index: + ensure : present + snapshot_contributor_index: + ensure : present snapshot_cpan_index: ensure : absent snapshot_user_index: @@ -28,7 +32,7 @@ metacpan::crons::api: snapshot_purge_old: ensure : absent ratings: - ensure : present + ensure : absent mirrors: ensure : present cpantesters: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 40a054fc..f6eb2ee2 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -40,7 +40,7 @@ metacpan::crons::api: snapshot_purge_old: ensure : present ratings: - ensure : present + ensure : absent mirrors: ensure : present cpantesters: From dce8ea6ee2e21e4337faafea5900d51bd8224dd7 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 17 Jun 2018 21:18:25 +0100 Subject: [PATCH 030/147] bytemark does not have as many processors - so do not use so many workers --- hieradata/nodes/bm-mc-01.yaml | 2 +- hieradata/nodes/bm-mc-02.yaml | 2 +- hieradata/nodes/bm-mc-04.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index f7f2c61f..de302ab7 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -3,7 +3,7 @@ classes: - metacpan_postgres - minion_queue -minion_queue::service::workers: 5 +minion_queue::service::workers: 4 minion_queue::service::ensure: running minion_queue::service::enable: true diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index 8c2a6f03..2c4c8730 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -4,7 +4,7 @@ classes: - metacpan_postgres::pgpass - minion_queue -minion_queue::service::workers: 10 +minion_queue::service::workers: 5 minion_queue::service::ensure: running minion_queue::service::enable: true diff --git a/hieradata/nodes/bm-mc-04.yaml b/hieradata/nodes/bm-mc-04.yaml index 0680031d..3a1f25d4 100644 --- a/hieradata/nodes/bm-mc-04.yaml +++ b/hieradata/nodes/bm-mc-04.yaml @@ -4,7 +4,7 @@ classes: - metacpan_postgres::pgpass - minion_queue -minion_queue::service::workers: 10 +minion_queue::service::workers: 5 minion_queue::service::ensure: running minion_queue::service::enable: true From 1bb45a8757cd1823341c3de1898277e8fe66bda1 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Tue, 19 Jun 2018 19:38:09 +0100 Subject: [PATCH 031/147] add ssoriche as a user to help with sysadmin --- hieradata/env/production.yaml | 4 ++++ .../metacpan/files/default/home/ssoriche/ssh/authorized_keys | 1 + 2 files changed, 5 insertions(+) create mode 100644 modules/metacpan/files/default/home/ssoriche/ssh/authorized_keys diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index a6858279..ffd27c13 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -91,6 +91,10 @@ metacpan::users: admin : true fullname : "Olaf Alders " no_passwd_sudo : true + ssoriche: + admin : true + fullname : 'Shawn Sorichetti ' + shell : /bin/zsh rwstauner: admin : true fullname : 'Randy Stauner ' diff --git a/modules/metacpan/files/default/home/ssoriche/ssh/authorized_keys b/modules/metacpan/files/default/home/ssoriche/ssh/authorized_keys new file mode 100644 index 00000000..1759ec4f --- /dev/null +++ b/modules/metacpan/files/default/home/ssoriche/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBIXXt0luctRWRjeqVz3QumS2rTuQOWb/8pKpf/yyl7KGD3E3wsZxWa6fABS2H9aEuAvCrg2hiIM11a7VUbdgJgAwgY5s0W3SGQejt2CafEPdqjzRhAcd6blhI42bfy+O0ok4SMLO36OnClhqv32tq2eGs35tWCQZUqaXHvhPwVQluAY4/3urWhgI3jxaQBz7DwChcAseW28n06Os4YKGvachN7I9Pv+5fICR2Fo6MApxKz2Cz5Xhwqt+GZFWo1Boe+X1tuQ7pUe2m1ql4YC7+rMFhyXChHaUNe+ierv6wqL024dAX6mvWic8Q2o1BDHV8Jj04kikPx6VpvNOZ7vcX From 25bacd82474a46229559bd56ed17385b92731b8e Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 24 Jun 2018 20:10:55 +0100 Subject: [PATCH 032/147] switch snapshot over to bm main server --- hieradata/nodes/bm-mc-01.yaml | 8 ++++---- hieradata/nodes/lw-mc-03.yaml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index de302ab7..699879a9 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -26,11 +26,11 @@ metacpan::crons::api: snapshot_contributor_index: ensure : present snapshot_cpan_index: - ensure : absent + ensure : present snapshot_user_index: - ensure : absent + ensure : present snapshot_purge_old: - ensure : absent + ensure : present ratings: ensure : absent mirrors: @@ -40,7 +40,7 @@ metacpan::crons::api: latest: ensure : present backup_purge: - ensure : absent + ensure : present session: ensure : present release: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index f6eb2ee2..127b2256 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -34,11 +34,11 @@ metacpan::crons::general: metacpan::crons::api: snapshot_cpan_index: - ensure : present + ensure : absent snapshot_user_index: - ensure : present + ensure : absent snapshot_purge_old: - ensure : present + ensure : absent ratings: ensure : absent mirrors: From 9080e6bbd33cbc842f315f6a7204c5aca453df18 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 24 Jun 2018 20:17:17 +0100 Subject: [PATCH 033/147] add an motd --- modules/metacpan/files/motd | 6 ++++++ modules/metacpan/manifests/init.pp | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 modules/metacpan/files/motd diff --git a/modules/metacpan/files/motd b/modules/metacpan/files/motd new file mode 100644 index 00000000..d4718c5a --- /dev/null +++ b/modules/metacpan/files/motd @@ -0,0 +1,6 @@ +See https://github.com/metacpan/network-infrastructure for current status + +Summary: +BM-01,02,04 - main production ES cluster + web sites +BM-03 - non-production (stage) +LW-01,02,03 - some production websites + DR diff --git a/modules/metacpan/manifests/init.pp b/modules/metacpan/manifests/init.pp index c53d4501..b3235541 100644 --- a/modules/metacpan/manifests/init.pp +++ b/modules/metacpan/manifests/init.pp @@ -101,6 +101,13 @@ mode => '0755', } + file { '/etc/motd': + owner => 'root', + group => 'root', + mode => '0755', + source => "puppet:///modules/metacpan/motd", + } + file { '/var/tmp/metacpan': ensure => link, target => $tmp_dir, From a338ddc66725f150179a10a094fdb173b5c466dd Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 24 Jun 2018 20:29:50 +0100 Subject: [PATCH 034/147] fix template for master munin --- modules/munin/templates/master/node.definition.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/munin/templates/master/node.definition.conf.erb b/modules/munin/templates/master/node.definition.conf.erb index 80ad992a..d69dc436 100644 --- a/modules/munin/templates/master/node.definition.conf.erb +++ b/modules/munin/templates/master/node.definition.conf.erb @@ -1,8 +1,8 @@ -# Munin master configuration fragment for <%= title %> +# Munin master configuration fragment for <%= @name %> # # This file is handled by puppet, all modifications will be lost -[<%= @title %>] +[<%= @name %>] address <%= @address %> <% Array(@config).each do |line| -%> <%= line %> From dd8e10910bb579e72f03372835e5562c90342831 Mon Sep 17 00:00:00 2001 From: Mickey Nasriachi Date: Wed, 11 Jul 2018 13:17:48 +0200 Subject: [PATCH 035/147] disable fedora cron for now (changes to API causing breakage) --- hieradata/common.yaml | 10 +++++----- hieradata/nodes/lw-mc-03.yaml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 0463e3b7..e362c6af 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -386,11 +386,11 @@ metacpan::crons::api: minute : 33 hour : 3 ensure : absent - external_fedora: - cmd : 'external --external_source fedora --email_to book@cpan.org' - minute : 35 - hour : 3 - ensure : absent +# external_fedora: +# cmd : 'external --external_source fedora --email_to book@cpan.org' +# minute : 35 +# hour : 3 +# ensure : absent favorite_hourly: cmd : 'favorite --check_missing --age 240 --queue' minute: '*/30' diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 127b2256..380fa575 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -69,8 +69,8 @@ metacpan::crons::api: ensure : present external_debian: ensure : present - external_fedora: - ensure : present +# external_fedora: +# ensure : present contributor_daily: ensure : present contributor_weekly: From 8d81c48abd0e603b1c8089055fec0e310a85b726 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 29 Jul 2018 08:18:14 +0100 Subject: [PATCH 036/147] actually disable fedora and debian --- hieradata/common.yaml | 10 +++++----- hieradata/nodes/bm-mc-01.yaml | 8 ++++---- hieradata/nodes/lw-mc-03.yaml | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index e362c6af..0463e3b7 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -386,11 +386,11 @@ metacpan::crons::api: minute : 33 hour : 3 ensure : absent -# external_fedora: -# cmd : 'external --external_source fedora --email_to book@cpan.org' -# minute : 35 -# hour : 3 -# ensure : absent + external_fedora: + cmd : 'external --external_source fedora --email_to book@cpan.org' + minute : 35 + hour : 3 + ensure : absent favorite_hourly: cmd : 'favorite --check_missing --age 240 --queue' minute: '*/30' diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 699879a9..22eb1048 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -59,10 +59,10 @@ metacpan::crons::api: ensure : present external_cygwin: ensure : present - external_debian: - ensure : present - external_fedora: - ensure : present +# external_debian: +# ensure : present +# external_fedora: +# ensure : present contributor_daily: ensure : present contributor_weekly: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 380fa575..8ecec621 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -67,8 +67,8 @@ metacpan::crons::api: ensure : present external_cygwin: ensure : present - external_debian: - ensure : present +# external_debian: +# ensure : present # external_fedora: # ensure : present contributor_daily: From ae108ef0da2f15bd4ff2c10019e313d15ab32e09 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 4 Sep 2018 16:07:15 +0200 Subject: [PATCH 037/147] update my ssh keys --- modules/metacpan/files/default/home/haarg/ssh/authorized_keys | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys index 72e26b2b..b8a3c461 100644 --- a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys @@ -1,4 +1,4 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6wBnxyfoyNIVcfaw07MwCdnrq5StFGTwXkU7Guh+fb gknop@cuneus ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH7JaCN6LRb/P2tjRVSNxZ5hEKJ3GRnYVyT/X2C4ePQHd3aNb1LyaI4DYo66t1VJUkduzXoQY0vPSlxOeBTr5L5Dzs36S6mMlU182XJ8YJwYYsSd7cwxR3cGBRlBGP8to+RnjkhQodRi5ozWTUVA9RNexCMHZwPPWJsxoKhUWsFiZE19c+eieRuA2rkOj7aQy6dz9vzu0a6uznby8XBDJC+6nw8SZRCw9aiiep07aGSA5kyz8LaxkQXfT7l/pPiwbqnTN6u0jF3VaImPB2ByT3QynUhNbkawixcr992yca0bRRS8cjnu4sgjipo2BN0dl6iPoamzmsAh5tdBlmRjoH gknop@cuneus -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPYWnCQqRC8olnKcqxNpvb7q1ei7kQOk6Wadbeo61O8w gknop@C02QV2JTFVH6 -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOAW3UIIDRMoYp8yP6aKhyyfNPsFGMB2D61V4bv4HYzglJyeFLdvEUWfupd7ClnsM9RFv64hHy7bno/8uX9bkXQ7xhq6H90VbZDW4pb54kICy3acMxTKoqd3LRY33pyL5O1YlBJfp7BEwsldIxKKGmyuXQesMvImFM1hi6ObAetO7qDwS+vRp/wq02OvC1lGoFiTds96ohmATKhCC63QfLyb86yeWoExClJo9OU/a3u32WkV39RKC1WOB8OhaUyGiuaca9GCGAQctZeqx7kgGGYkaRkIV8wNw9d0kaNaRG0E7qb8OVQ2D0rgCckdFZ0g2E0B3KDn2NUFCPhlvjnFeTx6YvTVVTV0qcF0yYlaJcSS6ruQjSIflR4S+raQo7cVc+FxM4oq0Xs2QDlZmzWD45mTs/6geUsjFg4dLYNOPx7tRNMx/MP0FHoo6q6v1OPsbF8n/FGNCzOhGLl+ogz3kTxfNzhUysspyXlc/hvL7BlVPlkqiiPf1MrCQCt21atG1RSoH14PAhfk8WwXa6ZPp+YRKtpNOpR0kZvrzKadp4LV9btC94VnnWQhibdyuEbIXlIRXY6rr8mroT0XTrn916AhT4VGR2iYwboXDbPbdXVMQq0xKE64LdBCKTN0MXSmFhantfROde2Y11NgD8DAtu1D0KVfTZSk8DrhJXacGIpw== gknop@C02QV2JTFVH6 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0TF5TGxXB9JEprUeB4/dJQ3bhRKZDc89QAwz+0Fk0S gknop@C02QV2JTFVH6 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7o3RTCjabI0QGMYWHa6bP8OetQR03xPDO2puhoL3XsD0UX/sSEB3b6EWzih/1eSmxvAmfd7skKwVvW9u3ai607Gi82jtWlQB+KiJXodK7+XCM5S8F6SXFJ4kvsbF58a/08xWw9Vr2dULYu9ooSqaN2ogVchm3w86ZN0mpw8GNef9X3lnxaklbJBBF1LgtPE4+4AmnXKsU8Q0Bx8DH/D5ae1GkY/Kko2p+Iz0zLMvcK/5zlWQyfh7r4t0J5GdU8JQH76MzQIJ7rJp8tVoU22cev+BXIBSzRfEf8KmNEC+JhnJwRB8sS3mbhUCPkL5rnXwBa5nGXeAvD0DvC6zsVnUocWShcTkw/36Ero1QjJc5hYxu1LO/ZmHAl6D1UA0CYNF2i/9pxyJ+Srhfu1xu0bP3C14ND228BcOIbYZKxfH8MXWkhUSG94kCX6MagAqmykW1BkxpZgrY3rOOxkjQHTEVOCowwKtgCOfGPOouFaYeYzfkqiw2BeiYR6OjiwQoBubT04ekDSZk5f+yYM7mwBjrBJNMSv0Slz8ydFeuE1Gh63VgvnKtHTmMKfWHi/2KB7DPyEplyvTMI4D6O5uSuXQvybejuZEO35/7Jr922PbiuJA7BBwB9HWcyo3FDEiCqrJpLUdd+1m0VdxkmM7hxQ6MXgT+8/e/ERf4iKnv20+7sw== gknop@C02QV2JTFVH6 From 100e647e59bc6c3213eb38e24b8cda9ee1e20258 Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Sun, 11 Nov 2018 10:34:25 -0600 Subject: [PATCH 038/147] Change metacpan-api execution to Mojo Replace Gazelle with the Mojo preforking server for the new application. --- modules/starman/templates/init.pl.erb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/starman/templates/init.pl.erb b/modules/starman/templates/init.pl.erb index 9c149420..e01ee2ac 100755 --- a/modules/starman/templates/init.pl.erb +++ b/modules/starman/templates/init.pl.erb @@ -28,7 +28,6 @@ my %dirs = ( ); my $carton = '<%= @perlbin %>/carton'; my $workers = <%= @workers %>; -my $plack_env = '<%= @plack_env %>'; my $carton_dir = "/home/${user}/carton"; my $carton_path = "${carton_dir}/${name}"; @@ -37,14 +36,10 @@ my $carton_path = "${carton_dir}/${name}"; $ENV{PERL_CARTON_PATH} = $carton_path; my @program_args = ( - 'exec', "${carton_path}/bin/plackup", - '--port' => <%= @port %>, + 'exec', '--', "${carton_path}/bin/api.pl", + 'prefork', '--proxy', + '--listen' => "http://localhost:<%= @port %>", '--workers' => $workers, - '-E' => $plack_env, - '-Ilib', - '-a' => 'app.psgi', - '-s', => 'Gazelle', - '--disable-proctitle', # so we know which processes are what ); # Puppet should be doing this with symlinks From d096340dab17f89e59e475eeb433c1195a0ade89 Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Sun, 11 Nov 2018 11:24:08 -0600 Subject: [PATCH 039/147] Rename queue.pl to api.pl This has been a straight port to a new name. --- modules/minion_queue/templates/init.pl.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/minion_queue/templates/init.pl.erb b/modules/minion_queue/templates/init.pl.erb index caa38411..0d2a16ba 100644 --- a/modules/minion_queue/templates/init.pl.erb +++ b/modules/minion_queue/templates/init.pl.erb @@ -41,9 +41,9 @@ $ENV{PERL_CARTON_PATH} = $carton_path; # We need the right perl in the ENV $ENV{PATH} = '<%= @perlbin %>:' . $ENV{PATH}; -# carton exec bin/queue.pl +# carton exec bin/api.pl my @program_args = ( - 'exec', "${home}/bin/queue.pl", + 'exec', "${home}/bin/api.pl", 'minion', 'worker', '-j', $workers ); From ea9e947311a3514b26386983536b4e65d3d8438a Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Sun, 11 Nov 2018 13:53:25 -0600 Subject: [PATCH 040/147] Change location of carton being used Use the metacpan-api-carton-exec to point to the expected version of carton. --- modules/starman/templates/init.pl.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/starman/templates/init.pl.erb b/modules/starman/templates/init.pl.erb index e01ee2ac..675764c6 100755 --- a/modules/starman/templates/init.pl.erb +++ b/modules/starman/templates/init.pl.erb @@ -26,7 +26,7 @@ my %dirs = ( pid => "$home/var/run", log => "$home/var/log", ); -my $carton = '<%= @perlbin %>/carton'; +my $carton = "$home/../bin/metacpan-api-carton-exec"; my $workers = <%= @workers %>; my $carton_dir = "/home/${user}/carton"; @@ -36,7 +36,7 @@ my $carton_path = "${carton_dir}/${name}"; $ENV{PERL_CARTON_PATH} = $carton_path; my @program_args = ( - 'exec', '--', "${carton_path}/bin/api.pl", + '--', "bin/api.pl", 'prefork', '--proxy', '--listen' => "http://localhost:<%= @port %>", '--workers' => $workers, From d9a605497de454fdaf3290d653ac170031dcdd1f Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Sun, 11 Nov 2018 14:53:54 -0600 Subject: [PATCH 041/147] Change listen host Need to listen on all IP addresses. --- modules/starman/templates/init.pl.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/starman/templates/init.pl.erb b/modules/starman/templates/init.pl.erb index 675764c6..e0eb3f27 100755 --- a/modules/starman/templates/init.pl.erb +++ b/modules/starman/templates/init.pl.erb @@ -38,7 +38,7 @@ $ENV{PERL_CARTON_PATH} = $carton_path; my @program_args = ( '--', "bin/api.pl", 'prefork', '--proxy', - '--listen' => "http://localhost:<%= @port %>", + '--listen' => "http://*:<%= @port %>", '--workers' => $workers, ); From fc9b8ab5ffe9be848742e5fdaa3e233181a0a209 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Mon, 12 Nov 2018 09:29:36 +0000 Subject: [PATCH 042/147] nasty nasty, untested hack to get the init files correct again --- hieradata/common.yaml | 1 + modules/metacpan/manifests/web/starman.pp | 2 + modules/starman/manifests/service.pp | 3 +- modules/starman/templates/init.api.erb | 67 +++++++++++++++++++++++ modules/starman/templates/init.pl.erb | 13 +++-- 5 files changed, 81 insertions(+), 5 deletions(-) create mode 100755 modules/starman/templates/init.api.erb diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 0463e3b7..4280ab5c 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -141,6 +141,7 @@ metacpan::web::starman: - "st.aticpan.org" starman_port: 5000 starman_workers: 2 + starman_init_template: 'starman/init.api.erb' vhost_extra_proxies: proxy_cpan_index: location: '/v1/cpan' diff --git a/modules/metacpan/manifests/web/starman.pp b/modules/metacpan/manifests/web/starman.pp index d119a2aa..6d3e10f3 100644 --- a/modules/metacpan/manifests/web/starman.pp +++ b/modules/metacpan/manifests/web/starman.pp @@ -28,6 +28,7 @@ # starman $starman_port = 'UNSET', $starman_workers = 1, + $starman_init_template = 'starman/init.pl.erb', ) { $path = "/home/${owner}/${name}" @@ -83,6 +84,7 @@ root => $path, port => $starman_port, workers => $starman_workers, + init_template => $starman_init_template, } diff --git a/modules/starman/manifests/service.pp b/modules/starman/manifests/service.pp index 62a634f5..e70e8dd7 100644 --- a/modules/starman/manifests/service.pp +++ b/modules/starman/manifests/service.pp @@ -6,6 +6,7 @@ $service_enable = true, $user = hiera('metacpan::user', 'metacpan'), $group = hiera('metacpan::group', 'metacpan'), + $init_template = 'starman/init.pl.erb', ) { include perl include starman::config @@ -83,7 +84,7 @@ mode => '0755', owner => 'root', group => 'root', - content => template('starman/init.pl.erb'), + content => template($init_template), notify => Service[$service_name], } diff --git a/modules/starman/templates/init.api.erb b/modules/starman/templates/init.api.erb new file mode 100755 index 00000000..e0eb3f27 --- /dev/null +++ b/modules/starman/templates/init.api.erb @@ -0,0 +1,67 @@ +#!<%= @perlbin %>/perl +<%# vim: set syn=perl.eruby ts=4 sts=4 sw=4 et sta: %> +# Generated by puppet. + +### BEGIN INIT INFO +# Provides: <%= @name %> +# Required-Start: $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts <%= @name %> +# Description: Starts <%= @name %> +### END INIT INFO` + +use strict; +use warnings; + +use Daemon::Control; +use File::Path 2.06 (); # core + +my $name = "<%= @name %>"; + +my $user = '<%= @user %>'; +my $home = '<%= @root %>'; +my %dirs = ( + pid => "$home/var/run", + log => "$home/var/log", +); +my $carton = "$home/../bin/metacpan-api-carton-exec"; +my $workers = <%= @workers %>; + +my $carton_dir = "/home/${user}/carton"; +my $carton_path = "${carton_dir}/${name}"; + +# TODO: Should we use the ./bin/carton wrapper instead of setting this here? +$ENV{PERL_CARTON_PATH} = $carton_path; + +my @program_args = ( + '--', "bin/api.pl", + 'prefork', '--proxy', + '--listen' => "http://*:<%= @port %>", + '--workers' => $workers, +); + +# Puppet should be doing this with symlinks +#File::Path::make_path( values %dirs ); + +# Notes on unused args +# scan_name: seems to be just 'starman master' (not useful) +# stdout_file: always seems to be just empty + +my $args = { + directory => $home, + fork => 2, + group => $user, +# init_config => '<%= @env_file %>', + lsb_desc => "Starts $name", + lsb_sdesc => "Starts $name", + name => $name, + pid_file => "$dirs{pid}/$name.pid", + program => $carton, + program_args => \@program_args, + stderr_file => "$dirs{log}/starman_error.log", + user => $user, +}; + +exit Daemon::Control->new($args)->run; diff --git a/modules/starman/templates/init.pl.erb b/modules/starman/templates/init.pl.erb index e0eb3f27..9c149420 100755 --- a/modules/starman/templates/init.pl.erb +++ b/modules/starman/templates/init.pl.erb @@ -26,8 +26,9 @@ my %dirs = ( pid => "$home/var/run", log => "$home/var/log", ); -my $carton = "$home/../bin/metacpan-api-carton-exec"; +my $carton = '<%= @perlbin %>/carton'; my $workers = <%= @workers %>; +my $plack_env = '<%= @plack_env %>'; my $carton_dir = "/home/${user}/carton"; my $carton_path = "${carton_dir}/${name}"; @@ -36,10 +37,14 @@ my $carton_path = "${carton_dir}/${name}"; $ENV{PERL_CARTON_PATH} = $carton_path; my @program_args = ( - '--', "bin/api.pl", - 'prefork', '--proxy', - '--listen' => "http://*:<%= @port %>", + 'exec', "${carton_path}/bin/plackup", + '--port' => <%= @port %>, '--workers' => $workers, + '-E' => $plack_env, + '-Ilib', + '-a' => 'app.psgi', + '-s', => 'Gazelle', + '--disable-proctitle', # so we know which processes are what ); # Puppet should be doing this with symlinks From 0d28e76558f87ee62745fce2cd7624a2793f2528 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Mon, 12 Nov 2018 14:53:55 -0500 Subject: [PATCH 043/147] Set X-Forwarded-Proto header in nginx proxy setup --- modules/metacpan_nginx/templates/proxy.conf.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/metacpan_nginx/templates/proxy.conf.erb b/modules/metacpan_nginx/templates/proxy.conf.erb index 17c02d6b..0d12a24e 100644 --- a/modules/metacpan_nginx/templates/proxy.conf.erb +++ b/modules/metacpan_nginx/templates/proxy.conf.erb @@ -8,4 +8,5 @@ location <%= @location %>/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Proto $scheme; } From 6301df587378542f2fa344be8db13112b72e1bf5 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Wed, 28 Nov 2018 21:38:51 +0000 Subject: [PATCH 044/147] new ssh key --- modules/metacpan/files/default/home/leo/ssh/authorized_keys | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/metacpan/files/default/home/leo/ssh/authorized_keys b/modules/metacpan/files/default/home/leo/ssh/authorized_keys index 057f7466..d4c9394a 100644 --- a/modules/metacpan/files/default/home/leo/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/leo/ssh/authorized_keys @@ -1,3 +1,2 @@ ssh-dss AAAAB3NzaC1kc3MAAACBAMVVQF8kPV35Rvici1BNbnDDnE00bH/GkiiatQOvjDgnCgngJjgf5z1ZaY0xisTgJHPmgS03PGDFksteqmvsGq2htrFBu306RzBSYMW1sxqzDfOwomwyS4luQSLwPZwulZyRSEn9FDdLUOg0fiYv1cI2b8xDYOThRRLVUz/tpdE9AAAAFQDUmfpPaFJ5ZF/vyUC7F0eGDw06jQAAAIBFyXGhFvjZX0/08Ea9Gw/6SOoAMd+WOaBw8HI8AFvhboLDzO6LZFOmSsVSoBjZQwvUo61gYtuJSYgGidhDNMidqvKDeKF5495fLGLRYNR0vTA6+LhQMEXbWl9scSFaMFy6ibsqy7+PPXOT6l6OzF/MVHdpAfO1u213EbeLX1ei0gAAAIEAw/LPeRH2iYju3ISIcj2nzg0N9vf/utj/hjtdZApy89R2YZjGOP8Y/r+c5R4MjwP+ElqoOtdeuHhplu6SmECR6Owlp87Jmdb7nBXK/dvga4MYpsc/gpFWdj+lGRRUD0JkM0ynLZ/rZS1515a4Q86pwjH1wy9sHGhzASJH+m9kXR0= leo@braga -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7Gn4SpdBj77tuj4HF1/iLO37tgtmT/xvChQcY6XNI6syzUsBLFidVBWHIkGGR6rELagqQS7cxS84qYTG7iXb0WCGnxbtMcssyQvwwKDlRQLD+AFCg0D9ys3nVkrposLJNrXZyW95S31D06ueu/B7iTQ8EEtZdBzXzn5PbuSKaUKjVVdJCWtj4YaDrto7lBbQyj4+IThfV4DBdXBbNf0KyXRP0jVnpdEaiP174oXKZ72Rc+lA0CGPQLBS3Cmvud1yca+1UKFH4gbhhxuf4OcNmTZrgiQRJclEdiUJx55QfYSXod81tyXKezYgqwLbzXLg+pXE1hR1KnZnLM/x8rY53w== leo@LapMBP.local -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDk04LFYclqhfh5UN7zp3c6jSkqybQKE0U5PHUIDDkz08zm5SEulY2Nka83iNUidy+I36sI/yjj5RoeM6BlWpKRpeOAibql1yoppNvGjMeLe6kqxTc5wvGVkLoIs7fQUe124aZ9Asm27bxI75+Ku1OiUEZBpZ3ucECBjgh+D7CpH4mVWNitgotYsg+uTcExU4QyHk+nuRki6ISJW/r0uIyacS934PW2OLZC05Wzc3kkRv+a6DqtFT4WXDp33rYgUYA5ZJE+3u/BFCaBdTUaAq1Kns8dVp533oYRsohcTt1MsJacr74DyNeGjHn3Ap5TngngIfHzkpK5E16dd9jaDwmTakvEddVE26LBH4zFX6v6VYUxVxa3t0MjD0Zk8mXOFl+FBOvZTcpsNGlvxD9fqADUUhP6v0KpgEWdxSrCpys/s4maoudcRcdIEBcvf4chH8MH6CUi1YGLlpGkefiD1DugsA9W0TWdsBA74DtvISYl9+u5LxMOy92G+v0xJ0z3e0qqNcGmfMuGQBRNKoRFoEi7sq7n/+tyDPiWvkuPGN0JPR23Yjca7jzLeVAFnxehHaaI1pfAmT+J2zV65/INA2l791KiW3ODsFO1UerSJ2i23YIuuon+Uu2mvQo8XZmdZfLxib+lyqJYWpsK3qaHqObxl3AU+AeJ1OqXL1SXQjI8ww== 20170402_leo_laptop +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDdRl+hCAXKoAoDZBXO7+C46AGLSniS+UqFQce3NHWVzZCAJgMXPNGv5FhWRZgUIcdWZKuizJlVAAXhexIB/Tg7u1YQBfBwMfTb8jab3GXtef9BKhPdcY+OLGY7LohiqT0XCt3g+u+bw1jpl/bumk/MZn35+K7BTOtbu/BnenH4ipd9L8md84RhAUPqCnj8wi3iHsDTt0+wiPW1VWaFAyvoWllDEzhGxjhHfxHAjozsQ/L/gJwLcrXL5NEpvncqlZU+T9dvEwVW5Y0UGMFmonqUfY9lne0lp36crK4p66joecjIr9Cs8thJrxhaQh0eviakI7oPK1jx29PLvouHfa3ZwtsRiiGUXNiwud5i/DU1n83e0qYBVZYDECvJWSt7HGx6yWllB9dEHm2cEPCRtHTwXuMdbTtN+STo+5d7t5e5BZphzVzvG2g/8zc/n205V1D0jhz+1sR6p6BDso4irvoXvfqYIjtkoaL1CF0mN4rTdU2r4v0RFkmUUpuvXasETuvClsPr3mYkq1hWWY+5/XbDk+qi2DDuENpYo2+Hjc4XQizs3WnVG5+j7brDCKYo8EQrne3OIOlov204IkjBZnc7/zVBmaSW6QaMgnPd3uBWqCY5RXTTwFJHXO0viV7xNvusGdGeXvYieBnOwDXvyE1w0YOIebMpq+bn+aOxJtO6wQ== leo@lapair \ No newline at end of file From 93b1c72b855d18f602ed09d08494a9443231eafb Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 17 Jan 2019 15:20:57 +0100 Subject: [PATCH 045/147] add hound.metacpan.org --- hieradata/nodes/lw-mc-02.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index c9cef64e..3f66b1fc 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -16,3 +16,18 @@ metacpan::crons::general: metacpan::crons::general: metacpan_sitemaps: minute : 25 + +metacpan_nginx::vhost: + + metacpan-hound: + ssl_only: true + bare: true + aliases: + - 'hound.metacpan.org' + +metacpan_nginx::proxy: + + proxy_metacpan-hound: + target: 'http://localhost:6080/' + site: 'metacpan-hound' + location: '' From 7b4c19d58c7ebde90acfdfca6a1ea50fd720d85b Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 17 Jan 2019 15:49:09 +0100 Subject: [PATCH 046/147] another try at hound --- hieradata/nodes/lw-mc-02.yaml | 16 +++------ modules/metacpan/manifests/web/proxy.pp | 47 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 modules/metacpan/manifests/web/proxy.pp diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index 3f66b1fc..aa27bf9f 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -17,17 +17,11 @@ metacpan::crons::general: metacpan_sitemaps: minute : 25 -metacpan_nginx::vhost: +metacpan::web::proxy: metacpan-hound: - ssl_only: true - bare: true - aliases: + vhost_ssl_only: true + vhost_bare: true + vhost_aliases: - 'hound.metacpan.org' - -metacpan_nginx::proxy: - - proxy_metacpan-hound: - target: 'http://localhost:6080/' - site: 'metacpan-hound' - location: '' + proxy_port: 6080 diff --git a/modules/metacpan/manifests/web/proxy.pp b/modules/metacpan/manifests/web/proxy.pp new file mode 100644 index 00000000..7e520c4f --- /dev/null +++ b/modules/metacpan/manifests/web/proxy.pp @@ -0,0 +1,47 @@ +# === Definition metacpan::web::proxy +# +# In Hiera: +# +# metacpan::web::proxy: +# +# +define metacpan::web::proxy ( + # nginx + $vhost_aliases, # Required as main domain now here + $vhost_html = '', + $vhost_ssl_only = false, + $vhost_ssl = $vhost_ssl_only, + $vhost_autoindex = false, + $vhost_bare = false, + $vhost_extra_proxies = {}, + $vhost_extra_configs = {}, + + $proxy_port = 'UNSET', +) { + metacpan_nginx::vhost { $name: + html => $vhost_html, + ssl => $vhost_ssl, + ssl_only => $vhost_ssl_only, + bare => $vhost_bare, + autoindex => $vhost_autoindex, + aliases => $vhost_aliases, + } + + # Add all the extra proxy / config gumpf + create_resources('metacpan_nginx::proxy', $vhost_extra_proxies, { + target => "http://localhost:${proxy_port}/", + site => $name, + location => '', + }) + + create_resources('metacpan::web::nginx_extra_confs', $vhost_extra_configs, { + site => $name, + }) + + # Setup rev-proxy to starman + metacpan_nginx::proxy { "proxy_${name}": + target => "http://localhost:${proxy_port}/", + site => $name, + location => '', + } +} From b1c0a863e8fd21bdd4417982d0b62e3125bccd33 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 17 Jan 2019 15:54:37 +0100 Subject: [PATCH 047/147] trying hound thing again --- modules/metacpan/manifests/init.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/metacpan/manifests/init.pp b/modules/metacpan/manifests/init.pp index b3235541..dd48355e 100644 --- a/modules/metacpan/manifests/init.pp +++ b/modules/metacpan/manifests/init.pp @@ -89,6 +89,10 @@ $git_repos = hiera_hash('metacpan::git::repo', {}) create_resources('metacpan::gitrepo', $git_repos) + # Proxy sites + $proxy = hiera_hash('metacpan::web::proxy', {}) + create_resources('metacpan::web::proxy', $proxy) + group { 'shellaccess': ensure => present; From e8bc1794368a4b715c7c66cb7ae1d2b9525969e1 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 15 Apr 2019 20:57:37 +0200 Subject: [PATCH 048/147] run api in production mode --- modules/starman/templates/init.api.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/starman/templates/init.api.erb b/modules/starman/templates/init.api.erb index e0eb3f27..2b1b4c76 100755 --- a/modules/starman/templates/init.api.erb +++ b/modules/starman/templates/init.api.erb @@ -38,6 +38,7 @@ $ENV{PERL_CARTON_PATH} = $carton_path; my @program_args = ( '--', "bin/api.pl", 'prefork', '--proxy', + '--mode' => 'production', '--listen' => "http://*:<%= @port %>", '--workers' => $workers, ); From 959a59821b4ecdaa9d69ded7cfc09e3a1fdc3d65 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 15 Apr 2019 21:26:41 +0200 Subject: [PATCH 049/147] exec when running carton commands --- modules/carton/templates/carton-exec.erb | 2 +- modules/carton/templates/carton.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/carton/templates/carton-exec.erb b/modules/carton/templates/carton-exec.erb index 2e843220..a104fbfc 100644 --- a/modules/carton/templates/carton-exec.erb +++ b/modules/carton/templates/carton-exec.erb @@ -1,3 +1,3 @@ #!/bin/sh -<%= @carton %> exec <%= @perlbin %>/perl -Ilib "$@" +exec <%= @carton %> exec <%= @perlbin %>/perl -Ilib "$@" diff --git a/modules/carton/templates/carton.erb b/modules/carton/templates/carton.erb index 8490d233..a5b188c4 100644 --- a/modules/carton/templates/carton.erb +++ b/modules/carton/templates/carton.erb @@ -1,4 +1,5 @@ #!/bin/sh cd /home/<%= @user %>/<%= @name %>/ -PERL_CARTON_PATH=<%= @carton_service_dir %> <%= @perlbin %>/carton "$@" +export PERL_CARTON_PATH=<%= @carton_service_dir %> +exec <%= @perlbin %>/carton "$@" From bd6dcad07a243e3de1b7ab1ee6b476f7a7e0dd3a Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Fri, 26 Apr 2019 13:40:10 +0100 Subject: [PATCH 050/147] add Docker and Docker Compose --- modules/metacpan/manifests/system/packages.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index 438aff2c..99653be7 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -3,6 +3,10 @@ # Editors package { 'vim': ensure => present } + # Docker Stuff + package { 'docker': ensure => present } + package { 'docker-compose': ensure => present } + # System Tools package { bzip2: ensure => present } package { curl: ensure => present } From 7aab54cf6a967721fa06a1cc62b3cc2715173290 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Fri, 26 Apr 2019 13:54:20 +0100 Subject: [PATCH 051/147] change of plan - using ansible --- modules/metacpan/manifests/system/packages.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/metacpan/manifests/system/packages.pp b/modules/metacpan/manifests/system/packages.pp index 99653be7..438aff2c 100644 --- a/modules/metacpan/manifests/system/packages.pp +++ b/modules/metacpan/manifests/system/packages.pp @@ -3,10 +3,6 @@ # Editors package { 'vim': ensure => present } - # Docker Stuff - package { 'docker': ensure => present } - package { 'docker-compose': ensure => present } - # System Tools package { bzip2: ensure => present } package { curl: ensure => present } From 1a9995df82f109b8905b0ec133f30ab0549790c7 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 28 Apr 2019 12:21:12 +0100 Subject: [PATCH 052/147] add cron to backup cpancover --- hieradata/nodes/bm-mc-03.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 038c22b5..58095604 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -25,6 +25,12 @@ metacpan::crons::general: metacpan_sitemaps: minute : 15 + backup_cpancover: + cmd : "rsync -q -a -e "ssh -i ~/.ssh/cpancover" metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ > /dev/null" + minute : 40 + user: "%{hiera('metacpan::user')}" + ensure : present + # Use this to run stage branch if required # metacpan::web::starman: # metacpan-web: From c6140d2628f960ec5ee90ea0d9046520aa2b7646 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 28 Apr 2019 12:23:34 +0100 Subject: [PATCH 053/147] stupid quote issue --- hieradata/nodes/bm-mc-03.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 58095604..3535c7ee 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -26,7 +26,7 @@ metacpan::crons::general: minute : 15 backup_cpancover: - cmd : "rsync -q -a -e "ssh -i ~/.ssh/cpancover" metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ > /dev/null" + cmd : "rsync -q -a -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ > /dev/null" minute : 40 user: "%{hiera('metacpan::user')}" ensure : present From 7628d9ede6891b5546ea979ce07ba34e03d2bb9e Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Wed, 1 May 2019 16:47:07 +0100 Subject: [PATCH 054/147] try make missing files message quiet --- hieradata/nodes/bm-mc-03.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 3535c7ee..d4252aee 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -26,7 +26,7 @@ metacpan::crons::general: minute : 15 backup_cpancover: - cmd : "rsync -q -a -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ > /dev/null" + cmd : "rsync -q -a --ignore-missing-args -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/" minute : 40 user: "%{hiera('metacpan::user')}" ensure : present From fb22ddba7e7aa2310ac21b549d3d0f5289061d9d Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Wed, 1 May 2019 22:50:58 +0100 Subject: [PATCH 055/147] ignore errors because files dissapear --- hieradata/nodes/bm-mc-03.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index d4252aee..f2afef56 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -26,7 +26,7 @@ metacpan::crons::general: minute : 15 backup_cpancover: - cmd : "rsync -q -a --ignore-missing-args -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/" + cmd : "rsync -q -a -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ >/dev/null 2>&1" minute : 40 user: "%{hiera('metacpan::user')}" ensure : present From 6288c5ab721d98461c0225bd9a63c0d7b93fce04 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Thu, 5 Dec 2019 07:03:18 -0800 Subject: [PATCH 056/147] Update my SSH Keys The old keys are for hardware I don't own anymore and have been lost to the bit buckets. --- .../metacpan/files/default/home/brad/ssh/authorized_keys | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/metacpan/files/default/home/brad/ssh/authorized_keys b/modules/metacpan/files/default/home/brad/ssh/authorized_keys index f730cd66..5bd2bd89 100644 --- a/modules/metacpan/files/default/home/brad/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/brad/ssh/authorized_keys @@ -1,2 +1,4 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvboGh/Ulrb6JzdNVwOEM1+YoixRxcJAK2KaY/a8Tm7S6PM0lcx5+IesG4nDV5zIA+6hikXTS4aE6itZJtXf4hH3vwWO+W7Tn/HcmduhbXmHvZ0/IuFaOU2xLMhSaDUMOmylytRTmFrnSppRErg0hpe5o6PE2zDFYCTwZu31YgDhgbgJKwDsEekp17VvwUo0sFeKdh72WAQ+sSzl7yVSZ6K+1RwsHn57Oq0aAJYJPfw1yRTCsqcNU8h+i1ul0AWt4+nzP6095jcTbXx7cfCcjfDcGXC/PleOo+aak0LiTf1EPI1WqcSqgec9y05RgdOfWAr895U+W6xTVB1dx3plrtwA7l+0ESiiEQQrc4Dft4Uws7jycODbL8UWPRroePNscDnqLG/FprD6Zz7/JG8iLwVhQS6T7bFHxKJPq0Q7VeTi2cQBt6yV1z35+3433cR2zR3vTtDkflbkBnbPwumXTCmaefcJP76yv/ZNkfYRM8rbqVLuUvzQOg8oepX/8TeevPdxHtkTkRnFc2wjN3ZXqMHlGDm6HaHsYdwHxixrZwm4TJM2lZD97e4S3QdLyr/j6ATrxizirzDBbTQVAZAbDWgHZk8vdAY5M1ZtuUz2fCV5nYTJ6CFvxHSVJXhYEYaVbirb7MbVm9Si8WQ5Tec23Ct1Nbig8Fc0LU4G5U6+XQPQ== Brad Lhotsky -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDL4q+2sevRNuJ4yM+fKbPVEhmZpqfetFJtb+PzRWPM2blPQvm0wXKzlzSk+I/7wDjrn7y9fZDcw7OBM5ywSvdkxERHpASnChr7dBHE/D7zZb8ek+/bOmnB2CqYb51hP26qExHo5aV99DmEjGLanmFZplTp8sKpcnCuJpD2G2BSQTvlQ1PVtsZZZN6MNI0L5a9aeHpWPZJkVgjfdz2RKsZ5G6ELgphOPBWEnURpreJZHpDHFWyNa1/ma9o13tizkFvf+v3aPEebEXJDt8aYRp0LXt40SG8XTjlD2a7Z6JsudmFcNJOcnRsJdz+EGDj2w/PplsqcV1MB/Z8a1ko6gPS1xFF25EekIYLA4ykCVVPwu82lbPOhQe5SxPK+TkNtGpL8gNqrZIoNqp1/Lufg1GGBB7rSN79MD9/c7eccfYW3DNRefqBje1ITNTs0qWtMOsuFNf6m5o8yTAyK+BAj/YPq8ItfVTlXFtPoFQ/LcOqkuM9/ZW1OGccdK93UuJSx8PXkOuoU1br8sQ6hJRFDb/hiGYffIwrZtB+HRAJeJ1dboZrt2JBls20VOiy1cbzoieFWAW9sSTyHBxTTxMi2WmYCcbr+lXDbtAouffKwrC1ZhKNgm2TqBfbMhMCV+F+JgMkoKmyO9TIOrrvuv0Sa3SvoUHNvgcYLO0G8K2lYSo+RjQ== Brad Lhotsky +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDLkwqliY0E+R9sqX20cAeRfSh+aRcliS5O6/xrgHXKhxCYSBldyXFZi9NJTnJSQsHoLPy7fr10wLGdFFZP+Rn+hh8Fx/4uMa8xxKShvpMyjsnrCsBmth/7S3AASa9LxS1rpJeTXUN0zwIkNvuB95orpSfH97OEoUXn3vOFn/oea2MwtJeaN/kMv9cJbmQmSQRE+1v408PK27T1TBawPTW9/QBntYcJAkp0dPpTL7RwkIS6P8fNNT/qZVxTZBmFMgk+Yn5akEWUt3hx+hPWaqzP0V/kLtjZt1Phq37HzbMqrxI4KiMkQVnjMjvYr9gTNu0wyN2H4xWZhaZ8IATQr/RbaR8CiCWrdnixB0cOEp6mJcpufDRf349E5B12amHaJAhF97d4Hsu9tpwpGC5pxF83TdA6p9+MX29PYPVmMlWL5/sFZj3A3gHWdeYkqZH3V5kRtD3JyF8vOu9Mrhct1qJ6kLcb9oeU9sXqVO0UB2J/XHfmVB0E2dJCiew+5MDQuw9bPlHfQQ9287pEYyX3MCEBxLBmstdLHoXvnihkUCYWT1Ljl3MQCSxfMjwJaafPqbYvHfDYeJ+X9S+4r+KM90fDTIzWZBurP2geNkh7wFxwzpaMxbMp15AmFQTKomda9TxYq35PYgaFJ18tg8GOhibdXVVrE0d7+N9usNEmUgVAqw== /Users/blhotsky/.ssh/blhotsky@spaceheater.rsa +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDIy3OrlYIivp3dosXzy1CCiCNcvEls/5fRcvFnU24Lc/G51yRIEtLImuH28lx4UWbqE88U8nVm16Fbu6pzh+cHv2cb5wZ0fXd8qYxQLnWMMA4xE0+BJ+bOU2WEHTIPZmWtQVTGpljYJQ9kGKjOr/25GYvbjJM/sRblracj4R5nu7ru+YZT4miU97+/el+2Ln4ln2qbrycmTdbse4JHOcP0r3k4jYDHLenH/XGKwJtN/aAZuv6gCHJkt2czk7NKwZTIocvlHSjMxhL9nRTZyUNGeHOpPWFGw+IMPLlaA7xzM0xwnpUe5CyabYJVwpNaoM722EbQJYiCWZQDCIWOKJTj0PHdnxxP19IRHpTnrgzzuJSjXFc7K6qugtS1c82fd4a3Bb0vMzG+O9ka/lnNqDmm2WyuBOuuEcyASLyB7fyoPA3ucvz6eI4dKnTU7DCSl5+AMnLSq72YkT1QcOb9KJF7tsRgBHQzdiUfJJDAUe5/Wbd+H2MgU3q2UwWt4+lDNBvaa+BgQgv00Crpuj8WvmhNd710+27pscolBIWug1z/I5+ldaG+e5EBY3yzaUyaQt1fT9WSwZVSIq/zktgNOAKmKxfuDSb/nW/NZ3drneQ3Qaq/02iEADI0TN9lQM6wJfKCNJpjPr3I6bCvJm0r9jfJeYr245+Yu71iHv6j7OTcSQ== .ssh/legacy.rsa +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDbjvdWSeP33rk4faRhTyXBOSIrMsRWrwf5PcIQ7CzpYlh+XtDNVgKWeDLrWzFYuTWXkP2c5+B2OfGaxPFUxpd+AfJo1sgM0um9e9vzPmKvcfh0jOsIcDgXGMZ/R5vceAPvIAE6UNIV8qDTvAdOeym4kvUmffiHWQ9gq+QkALz9DjzkZAbR7djjKrnrRA6xjqpYYUQjE57talE3vkvotNW63W0znATKR32Gr2vMNW7Py2XhUekAsR1a4b4l1rt4EqCzYRV5dDWBJajKAYy09rjwbvDwqXRunUsxRupCYXXl8mfYezUIb5JZYSXe4qn/P+d+7RosNnkgxLS5vy/qSnoQC71fmdovHQld5upq9C2mbfpdjBm5zF5b7puDXClfMil3FtgAV39BqJJpZ2l+o21R2CI3WsugDLGlyuUPDveY/pXVQeICzOFTWal5h/ATDskLibetuHsedO7lS1fhEFTkFocnGjKAGYJ531AY4gehIMVsI+U9CUMKiyAifxdUQKk076EviC/7DCvWXIubLMW02yLo3pgm03KWeGMWVcPpfsUEsUuaY+Ff/ZeABBbSgkzLm8IFzhvtiLc7iH+wDtdc9NhKWHeT/+wlikTzoBf+YY2ZR4qaaxDhtCya+YIL5nysLVZZ29UufWgxqwp6kvSdWSGot3OnXvMFXfK3yfbrkw== brad@last-unicorn.home.db0.us +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEWTimZbGAKEOMRoR8J1i3mMi+yi71KLQH7/UmJckFGD brad@mini.home.db0.us From f25205287ab2b018a2abf6b592a3065f19626a42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 15:18:36 +0000 Subject: [PATCH 057/147] Bump activesupport from 4.2.1 to 6.0.1 in /contrib-modules/file_concat Bumps [activesupport](https://github.com/rails/rails) from 4.2.1 to 6.0.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v6.0.1/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v4.2.1...v6.0.1) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 29da5e6c..9c15a822 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,12 +51,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (4.2.1) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) + activesupport (6.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) + zeitwerk (~> 2.2) addressable (2.3.7) autoparse (0.3.3) addressable (>= 2.3.1) @@ -80,6 +80,7 @@ GEM coderay (1.1.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) + concurrent-ruby (1.1.5) crack (0.4.2) safe_yaml (~> 1.0.0) descendants_tracker (0.0.4) @@ -198,12 +199,13 @@ GEM hiera (1.3.4) json_pure hocon (0.0.7) - i18n (0.7.0) + i18n (1.7.0) + concurrent-ruby (~> 1.0) ice_nine (0.11.1) inflecto (0.0.2) inifile (2.0.2) ipaddress (0.8.0) - json (1.8.2) + json (1.8.6) json_pure (1.8.2) jwt (1.4.1) launchy (2.4.3) @@ -217,7 +219,7 @@ GEM method_source (0.8.2) mime-types (2.4.3) mini_portile (0.6.2) - minitest (5.5.1) + minitest (5.13.0) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.11.0) @@ -296,9 +298,9 @@ GEM specinfra (2.26.1) net-scp net-ssh - thread_safe (0.3.5) + thread_safe (0.3.6) trollop (2.1.2) - tzinfo (1.2.2) + tzinfo (1.2.5) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -311,6 +313,7 @@ GEM webmock (1.20.4) addressable (>= 2.3.6) crack (>= 0.3.2) + zeitwerk (2.2.2) PLATFORMS ruby From b1da92ad8b92128ba2e618ad9485eb769220f5fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 15:52:27 +0000 Subject: [PATCH 058/147] Bump nokogiri from 1.6.6.2 to 1.10.7 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.6.6.2 to 1.10.7. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.6.6.2...v1.10.7) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 9c15a822..3a56cb1a 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -218,7 +218,7 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) - mini_portile (0.6.2) + mini_portile2 (2.4.0) minitest (5.13.0) mocha (1.1.0) metaclass (~> 0.0.1) @@ -227,8 +227,8 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) + nokogiri (1.10.7) + mini_portile2 (~> 2.4.0) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) From fd1f84962b1a7e8ce14b34f8b1ccb49ebc553781 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 08:27:41 -0800 Subject: [PATCH 059/147] Rotate the logs on the central log server I setup central logging, but blanked on setting up logrotate for those logs. The logs were also hidden on `bm-mc-03` in `/mnt/lv-metacpan--tmp/rsyslog_server` which isn't where anyone would look. This also install a symlink from `/var/log/remote` to `/mnt/lv-metacpan--tmp/rsyslog_server` to make this more obvious to folks. --- .../rsyslog_server/logrotate.d/central_logger | 15 +++++++++++++++ .../metacpan/manifests/system/rsyslog/server.pp | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 modules/metacpan/files/rsyslog_server/logrotate.d/central_logger diff --git a/modules/metacpan/files/rsyslog_server/logrotate.d/central_logger b/modules/metacpan/files/rsyslog_server/logrotate.d/central_logger new file mode 100644 index 00000000..d3923eba --- /dev/null +++ b/modules/metacpan/files/rsyslog_server/logrotate.d/central_logger @@ -0,0 +1,15 @@ +/var/log/remote/*/*.log +/var/log/remote/*/messages +/var/log/remote/*/syslog +{ + rotate 12 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + invoke-rc.d rsyslog rotate > /dev/null + endscript +} diff --git a/modules/metacpan/manifests/system/rsyslog/server.pp b/modules/metacpan/manifests/system/rsyslog/server.pp index 22bdd10d..4b294f3f 100644 --- a/modules/metacpan/manifests/system/rsyslog/server.pp +++ b/modules/metacpan/manifests/system/rsyslog/server.pp @@ -8,9 +8,9 @@ enable_relp => false, enable_onefile => false, server_dir => '/mnt/lv-metacpan--tmp/rsyslog_server/', + logdir_symlink => '/var/log/remote', custom_config => 'metacpan/rsyslog/server-metacpan.conf.erb', port => '514', -# relp_port => '20514', address => '*', high_precision_timestamps => false, log_templates => false, @@ -46,5 +46,19 @@ mode => '0555', notify => Service['rsyslog']; } + + # Handles the remote log storage and rotation + file { + # Drop a symlink somewhere that makes more sense + "$logdir_symlink": + ensure => 'link', + target => "$server_dir"; + # Rotate logs + "/etc/logrotate.d/central_logger": + source => "puppet:///modules/metacpan/rsyslog_server/central_logger", + owner => 'root', + group => 'root', + mode => '0444', + } } From ce83f1be4b21f1b887a49eb934add0b3756c3ae4 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 12:29:38 -0800 Subject: [PATCH 060/147] Don't auto-purge existing firewall rules --- manifests/site.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index 525f0200..47eaae79 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -6,10 +6,6 @@ mode => '0644', } -resources { "firewall": - purge => true -} - firewall { "000 accept related established rules": ensure => present, proto => 'all', From e5cd0409ead041f44bc685ef3584a8c898bd6890 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 13:42:49 -0800 Subject: [PATCH 061/147] Convert things to using ipaddress_eth0 When docker is installed, `docker0` comes before `eth0` the `ipaddress` fact is set to the IP of the `docker0` interface. This is because puppet is dumb and simply does an alphabetical sort for the node's IP address. --- hieradata/common.yaml | 2 +- modules/facts/lib/facter/datacenter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 4280ab5c..3dc2f645 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -440,7 +440,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - "%{ipaddress}/32" + - "%{ipaddress_eth0}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 diff --git a/modules/facts/lib/facter/datacenter.rb b/modules/facts/lib/facter/datacenter.rb index 4417e9d8..76ec0827 100644 --- a/modules/facts/lib/facter/datacenter.rb +++ b/modules/facts/lib/facter/datacenter.rb @@ -1,6 +1,6 @@ Facter.add(:datacenter) do setcode do - case Facter.value(:ipaddress) + case Facter.value(:ipaddress_eth0) when /^5\.153\.225\./ # bm-mc-01 and bm-mc-02 'bytemark-YO26-york' From 3b930a79469590168c4bd2d2456c8fcab64e7f0a Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 13:48:14 -0800 Subject: [PATCH 062/147] Override the GitHub Meets CPAN port on lw-mc-02 --- hieradata/nodes/lw-mc-02.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index aa27bf9f..76d0629f 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -25,3 +25,8 @@ metacpan::web::proxy: vhost_aliases: - 'hound.metacpan.org' proxy_port: 6080 + +metacpan::web::starman: + + github-meets-cpan: + starman_port: 3000 From 8167b479b6a82a7280fb0d6ef9c6e8137cd278a0 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 14:07:07 -0800 Subject: [PATCH 063/147] Hack to allow switching a service to docker without managing docker in puppet --- hieradata/nodes/lw-mc-02.yaml | 4 +++- modules/metacpan/manifests/web/starman.pp | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index 76d0629f..c1602c11 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -29,4 +29,6 @@ metacpan::web::proxy: metacpan::web::starman: github-meets-cpan: - starman_port: 3000 + git_enable: false + proxy_target_port: 3000 + service_enable: false diff --git a/modules/metacpan/manifests/web/starman.pp b/modules/metacpan/manifests/web/starman.pp index 6d3e10f3..1d90008e 100644 --- a/modules/metacpan/manifests/web/starman.pp +++ b/modules/metacpan/manifests/web/starman.pp @@ -29,6 +29,11 @@ $starman_port = 'UNSET', $starman_workers = 1, $starman_init_template = 'starman/init.pl.erb', + + # allow overriding the nginx target + $proxy_target_port = $starman_port, + $service_enable = true, + ) { $path = "/home/${owner}/${name}" @@ -64,7 +69,7 @@ # Add all the extra proxy / config gumpf create_resources('metacpan_nginx::proxy', $vhost_extra_proxies, { - target => "http://localhost:${starman_port}/", + target => "http://localhost:${proxy_target_port}/", site => $name, location => '', }) @@ -75,16 +80,17 @@ # Setup rev-proxy to starman metacpan_nginx::proxy { "proxy_${name}": - target => "http://localhost:${starman_port}/", + target => "http://localhost:${proxy_target_port}/", site => $name, location => '', } starman::service { $name: - root => $path, - port => $starman_port, - workers => $starman_workers, - init_template => $starman_init_template, + root => $path, + port => $starman_port, + workers => $starman_workers, + init_template => $starman_init_template, + service_enable => $service_enable, } From e4ddfc7417711d2f35a6807d4b1ab0814a50146c Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 14:14:32 -0800 Subject: [PATCH 064/147] It's not possible to disable gitrepo management --- hieradata/nodes/lw-mc-02.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index c1602c11..f5d81960 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -29,6 +29,5 @@ metacpan::web::proxy: metacpan::web::starman: github-meets-cpan: - git_enable: false proxy_target_port: 3000 service_enable: false From ae318c072c9d90f77f17658ba1f84b15beae91ee Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 14:34:21 -0800 Subject: [PATCH 065/147] Fix the bug I introduced I read the class instantiation as a class initialization and made a syntax error. This corrects it! --- modules/metacpan/manifests/system/rsyslog/server.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/metacpan/manifests/system/rsyslog/server.pp b/modules/metacpan/manifests/system/rsyslog/server.pp index 4b294f3f..a2cb793b 100644 --- a/modules/metacpan/manifests/system/rsyslog/server.pp +++ b/modules/metacpan/manifests/system/rsyslog/server.pp @@ -1,5 +1,6 @@ class metacpan::system::rsyslog::server( - + $server_dir = '/mnt/lv-metacpan--tmp/rsyslog_server/', + $logdir_symlink = '/var/log/remote', ) { class { '::rsyslog::server': @@ -7,8 +8,7 @@ enable_udp => false, enable_relp => false, enable_onefile => false, - server_dir => '/mnt/lv-metacpan--tmp/rsyslog_server/', - logdir_symlink => '/var/log/remote', + server_dir => $server_dir, custom_config => 'metacpan/rsyslog/server-metacpan.conf.erb', port => '514', address => '*', From 68ab0af71cec2cacbddbc356cab92732abd3706c Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Fri, 6 Dec 2019 14:37:58 -0800 Subject: [PATCH 066/147] Revert "Convert things to using ipaddress_eth0" This reverts commit e5cd0409ead041f44bc685ef3584a8c898bd6890. --- hieradata/common.yaml | 2 +- modules/facts/lib/facter/datacenter.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 3dc2f645..4280ab5c 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -440,7 +440,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - "%{ipaddress_eth0}/32" + - "%{ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 diff --git a/modules/facts/lib/facter/datacenter.rb b/modules/facts/lib/facter/datacenter.rb index 76ec0827..4417e9d8 100644 --- a/modules/facts/lib/facter/datacenter.rb +++ b/modules/facts/lib/facter/datacenter.rb @@ -1,6 +1,6 @@ Facter.add(:datacenter) do setcode do - case Facter.value(:ipaddress_eth0) + case Facter.value(:ipaddress) when /^5\.153\.225\./ # bm-mc-01 and bm-mc-02 'bytemark-YO26-york' From a3a43a0c1d02a2498289328d378e8e47fee59e0a Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 07:20:39 -0800 Subject: [PATCH 067/147] Add default_ipaddress fact There's a bug in our version of `facter` that causes `docker0` interfaces to override the routable public IP as the `ipaddress` fact. This code comes from [the PuppetLabs bug report](https://tickets.puppetlabs.com/browse/FACT-380) describing the problem. This is fixed in facter 3, but we are running v2.4.6. --- hieradata/common.yaml | 2 +- modules/facts/lib/facter/datacenter.rb | 15 ++++------ modules/facts/lib/facter/ipaddress.rb | 40 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 modules/facts/lib/facter/ipaddress.rb diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 4280ab5c..9c909cf7 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -440,7 +440,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - "%{ipaddress}/32" + - "%{default_ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 diff --git a/modules/facts/lib/facter/datacenter.rb b/modules/facts/lib/facter/datacenter.rb index 4417e9d8..34afe3a3 100644 --- a/modules/facts/lib/facter/datacenter.rb +++ b/modules/facts/lib/facter/datacenter.rb @@ -1,17 +1,12 @@ Facter.add(:datacenter) do setcode do - case Facter.value(:ipaddress) - when /^5\.153\.225\./ - # bm-mc-01 and bm-mc-02 + case Facter.value(:hostname) + when /^bm-mc-/ 'bytemark-YO26-york' - when /^46\.43\.35\.68/ - # bm-mc-03 - 'bytemark-YO26-york' - when /^89\.16\.178\.21/ - # bm-mc-04 - 'bytemark-YO26-york' - when /^50\.28\.18\./ + when /^lw-mc-/ 'liquidweb' + when /^hc-mc-/ + 'hivelocity' else 'development' end diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb new file mode 100644 index 00000000..4c171091 --- /dev/null +++ b/modules/facts/lib/facter/ipaddress.rb @@ -0,0 +1,40 @@ +require 'facter' +require 'facter/core/execution' + + +if File.exist? '/sbin/ip' + interfaces = Facter::Core::Execution.exec('/sbin/ip route show') + default_interface = nil + ipaddress = nil + + if interfaces + interfaces.each do |inf| + if inf.match(/^default/) + default_interface = inf.split()[-1] + end + end + end + + if default_interface + lines = Facter::Core::Execution.exec("/sbin/ip addr show dev #{default_interface}") + lines.each do |line| + line.strip! + + if line.match(/^inet .*#{default_interface}/) + ipaddress = line.split()[1].split('/')[0] + end + end + end + + Facter.add("default_interface") do + setcode do + default_interface + end + end + + Facter.add("default_ipaddress") do + setcode do + ipaddress + end + end +end From e44325519e20da7fb94f9a6f32975491b819fdf7 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 07:26:55 -0800 Subject: [PATCH 068/147] Fix logrotate locations --- modules/metacpan/manifests/system/rsyslog/server.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan/manifests/system/rsyslog/server.pp b/modules/metacpan/manifests/system/rsyslog/server.pp index a2cb793b..0f5906b6 100644 --- a/modules/metacpan/manifests/system/rsyslog/server.pp +++ b/modules/metacpan/manifests/system/rsyslog/server.pp @@ -55,7 +55,7 @@ target => "$server_dir"; # Rotate logs "/etc/logrotate.d/central_logger": - source => "puppet:///modules/metacpan/rsyslog_server/central_logger", + source => "puppet:///modules/metacpan/rsyslog_server/logrotate.d/central_logger", owner => 'root', group => 'root', mode => '0444', From b0d1de3b6ba2eb639c356cc0f0259c3a25787163 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 07:50:58 -0800 Subject: [PATCH 069/147] Sample code didn't work because String Use the `split()` function to make this work, maybe. --- modules/facts/lib/facter/ipaddress.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 4c171091..22888666 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -8,7 +8,7 @@ ipaddress = nil if interfaces - interfaces.each do |inf| + interfaces.split(/\n+/).each do |inf| if inf.match(/^default/) default_interface = inf.split()[-1] end @@ -17,7 +17,7 @@ if default_interface lines = Facter::Core::Execution.exec("/sbin/ip addr show dev #{default_interface}") - lines.each do |line| + lines.split(/\n+/).each do |line| line.strip! if line.match(/^inet .*#{default_interface}/) From 68c131d12e71327e7b6a0421e962fd5506ed590a Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 08:41:41 -0800 Subject: [PATCH 070/147] Fix bug in determining the default interface --- modules/facts/lib/facter/ipaddress.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 22888666..6db7abfe 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -10,7 +10,7 @@ if interfaces interfaces.split(/\n+/).each do |inf| if inf.match(/^default/) - default_interface = inf.split()[-1] + default_interface = inf.match(/dev (\w+)/).captures[0] end end end From 14e2e4994d3fe14f9f98a2c4630a426220a12bf7 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 09:08:18 -0800 Subject: [PATCH 071/147] Make script compatible with facter2 and facter3 --- modules/facts/lib/facter/ipaddress.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 6db7abfe..738b1209 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -1,5 +1,10 @@ -require 'facter' -require 'facter/core/execution' +begin + # facter version 2 needs these loads + require 'facter' + require 'facter/core/execution' +rescue LoadError => e + # No big defal, facter version 3 autloads these things differently +end if File.exist? '/sbin/ip' From 29caee14e1df6079355d008e8f46b026371b51a7 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 09:34:01 -0800 Subject: [PATCH 072/147] Simplify the fact --- modules/facts/lib/facter/ipaddress.rb | 29 ++++++++++----------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 738b1209..047cf9c5 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -1,16 +1,8 @@ -begin - # facter version 2 needs these loads - require 'facter' - require 'facter/core/execution' -rescue LoadError => e - # No big defal, facter version 3 autloads these things differently -end - +default_interface = nil +ipaddress = nil if File.exist? '/sbin/ip' interfaces = Facter::Core::Execution.exec('/sbin/ip route show') - default_interface = nil - ipaddress = nil if interfaces interfaces.split(/\n+/).each do |inf| @@ -31,15 +23,16 @@ end end - Facter.add("default_interface") do - setcode do - default_interface - end +end + +Facter.add("default_interface") do + setcode do + default_interface end +end - Facter.add("default_ipaddress") do - setcode do - ipaddress - end +Facter.add("default_ipaddress") do + setcode do + ipaddress end end From 4d7386b8ef62b95fe0c6044b3715b47834bbc3f9 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 10:52:48 -0800 Subject: [PATCH 073/147] This doesn't work exactly right For some reason, the `default_ipaddress` fact shows as loaded in Puppet before the `hieradata` is evaluated, but the value is always empty. Revert that back to the `ipaddress` fact. --- hieradata/common.yaml | 2 +- modules/facts/lib/facter/ipaddress.rb | 41 +++++---------------------- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 9c909cf7..4280ab5c 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -440,7 +440,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - "%{default_ipaddress}/32" + - "%{ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 047cf9c5..1ce199ec 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -1,38 +1,11 @@ -default_interface = nil -ipaddress = nil - -if File.exist? '/sbin/ip' - interfaces = Facter::Core::Execution.exec('/sbin/ip route show') - - if interfaces - interfaces.split(/\n+/).each do |inf| - if inf.match(/^default/) - default_interface = inf.match(/dev (\w+)/).captures[0] - end - end - end - - if default_interface - lines = Facter::Core::Execution.exec("/sbin/ip addr show dev #{default_interface}") - lines.split(/\n+/).each do |line| - line.strip! - - if line.match(/^inet .*#{default_interface}/) - ipaddress = line.split()[1].split('/')[0] - end - end - end - -end - -Facter.add("default_interface") do - setcode do - default_interface - end -end - Facter.add("default_ipaddress") do setcode do - ipaddress + if Facter.value('ipaddress_eth0') + Facter.value('ipaddress_eth0') + elsif Facter.value('ipaddress_bond0') + Facter.value('ipaddress_bond0') + else + Facter.value('ipaddress') + end end end From 84fb39a8e0d3351490945e92a29093e915f51088 Mon Sep 17 00:00:00 2001 From: Brad Lhotsky Date: Sat, 7 Dec 2019 12:27:00 -0800 Subject: [PATCH 074/147] Convert to using default_ipaddress This hack exposes heira to the facts in the `modules/facts` directory. --- hieradata/common.yaml | 2 +- hieradata/datacenter/bytemark-YO26-york.yaml | 2 +- hieradata/datacenter/liquidweb.yaml | 2 +- run.sh | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 4280ab5c..9c909cf7 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -440,7 +440,7 @@ nginx::allowed: - 192.168.0.0/16 - 127.0.0.1/32 # local machine's IP - - "%{ipaddress}/32" + - "%{default_ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 - 103.244.50.0/24 - 103.245.222.0/23 diff --git a/hieradata/datacenter/bytemark-YO26-york.yaml b/hieradata/datacenter/bytemark-YO26-york.yaml index a0a0a955..1c3ae94a 100644 --- a/hieradata/datacenter/bytemark-YO26-york.yaml +++ b/hieradata/datacenter/bytemark-YO26-york.yaml @@ -11,6 +11,6 @@ metacpan::postgres::access_hosts: # Run on our public IP address (firewall limits access # to other nodes in our cluster) -metacpan::elasticsearch::ipaddress: "%{::ipaddress}" +metacpan::elasticsearch::ipaddress: "%{::default_ipaddress}" metacpan::rsyslog::client::log_remote: true diff --git a/hieradata/datacenter/liquidweb.yaml b/hieradata/datacenter/liquidweb.yaml index e6d3e976..6c3a18f7 100644 --- a/hieradata/datacenter/liquidweb.yaml +++ b/hieradata/datacenter/liquidweb.yaml @@ -11,7 +11,7 @@ metacpan::postgres::access_hosts: # Run on our public IP address (firewall limits access # to other nodes in our cluster) -metacpan::elasticsearch::ipaddress: "%{::ipaddress}" +metacpan::elasticsearch::ipaddress: "%{::default_ipaddress}" metacpan::logstash::status: 'enabled' diff --git a/run.sh b/run.sh index 6f335d94..0bd3c3ff 100755 --- a/run.sh +++ b/run.sh @@ -38,5 +38,7 @@ fi # Stop complaints on vagrant mkdir -p private - +# Ugly hack to make a local class apply the facts +export FACTERLIB=/etc/puppet/modules/facts/lib/facter +# Run Puppet puppet apply --modulepath /etc/puppet/contrib-modules:/etc/puppet/modules --show_diff --certname=$CERTNAME manifests/site.pp $@ From c98184d91113bc19a76823eb799ad112cbf585f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2019 21:16:12 +0000 Subject: [PATCH 075/147] Bump excon from 0.44.4 to 0.71.0 in /contrib-modules/file_concat Bumps [excon](https://github.com/excon/excon) from 0.44.4 to 0.71.0. - [Release notes](https://github.com/excon/excon/releases) - [Changelog](https://github.com/excon/excon/blob/master/changelog.txt) - [Commits](https://github.com/excon/excon/compare/v0.44.4...v0.71.0) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 3a56cb1a..72475b5a 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -90,7 +90,7 @@ GEM excon (>= 0.38.0) json equalizer (0.0.11) - excon (0.44.4) + excon (0.71.0) extlib (0.9.16) facter (1.7.6) faraday (0.9.1) From cf169c65e525e47e8bfa36d68128049dbc941c14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 10:43:52 +0000 Subject: [PATCH 076/147] Bump nokogiri from 1.10.7 to 1.10.8 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.7 to 1.10.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.7...v1.10.8) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 72475b5a..6a02f680 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -227,7 +227,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.10.7) + nokogiri (1.10.8) mini_portile2 (~> 2.4.0) pry (0.10.1) coderay (~> 1.1.0) From fed1e893e181377cd6aa6125477532e1e3fcb6c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 29 Feb 2020 11:24:54 +0000 Subject: [PATCH 077/147] Bump rake from 10.4.2 to 12.3.3 in /contrib-modules/file_concat Bumps [rake](https://github.com/ruby/rake) from 10.4.2 to 12.3.3. - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v10.4.2...v12.3.3) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 6a02f680..35d97b37 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -251,7 +251,7 @@ GEM puppet-syntax rake rspec-puppet - rake (10.4.2) + rake (12.3.3) rbvmomi (1.8.2) builder nokogiri (>= 1.4.1) From a87eaac05dc378e326d3319afcac49169f34a6b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 May 2020 16:05:19 +0000 Subject: [PATCH 078/147] Bump activesupport from 6.0.1 to 6.0.3.1 in /contrib-modules/file_concat Bumps [activesupport](https://github.com/rails/rails) from 6.0.1 to 6.0.3.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v6.0.3.1/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v6.0.1...v6.0.3.1) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 35d97b37..70ea9ede 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,12 +51,12 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (6.0.1) + activesupport (6.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - zeitwerk (~> 2.2) + zeitwerk (~> 2.2, >= 2.2.2) addressable (2.3.7) autoparse (0.3.3) addressable (>= 2.3.1) @@ -80,7 +80,7 @@ GEM coderay (1.1.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.1.5) + concurrent-ruby (1.1.6) crack (0.4.2) safe_yaml (~> 1.0.0) descendants_tracker (0.0.4) @@ -199,7 +199,7 @@ GEM hiera (1.3.4) json_pure hocon (0.0.7) - i18n (1.7.0) + i18n (1.8.2) concurrent-ruby (~> 1.0) ice_nine (0.11.1) inflecto (0.0.2) @@ -219,7 +219,7 @@ GEM method_source (0.8.2) mime-types (2.4.3) mini_portile2 (2.4.0) - minitest (5.13.0) + minitest (5.14.1) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.11.0) @@ -300,7 +300,7 @@ GEM net-ssh thread_safe (0.3.6) trollop (2.1.2) - tzinfo (1.2.5) + tzinfo (1.2.7) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -313,7 +313,7 @@ GEM webmock (1.20.4) addressable (>= 2.3.6) crack (>= 0.3.2) - zeitwerk (2.2.2) + zeitwerk (2.3.0) PLATFORMS ruby From 08ffc136a38f9fcfafb9cf854467343521bb9c06 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sun, 28 Jun 2020 18:19:11 -0400 Subject: [PATCH 079/147] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..a96b5dbb --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,51 @@ +name: "Code scanning - action" + +on: + push: + pull_request: + schedule: + - cron: '0 23 * * 6' + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 0f2bce5f3a7dd6c00dae396a39c393d7edeb8d0d Mon Sep 17 00:00:00 2001 From: Ed J Date: Fri, 10 Jul 2020 21:35:50 +0100 Subject: [PATCH 080/147] add mohawk2 key --- modules/metacpan/files/default/home/mohawk2/ssh/authorized_keys | 1 + 1 file changed, 1 insertion(+) create mode 100644 modules/metacpan/files/default/home/mohawk2/ssh/authorized_keys diff --git a/modules/metacpan/files/default/home/mohawk2/ssh/authorized_keys b/modules/metacpan/files/default/home/mohawk2/ssh/authorized_keys new file mode 100644 index 00000000..6f0b78ae --- /dev/null +++ b/modules/metacpan/files/default/home/mohawk2/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGRMqZ5RPAvNBN6WIVlc/mxbncIj8tIcXtueak+Z/KX9OL2znIzzifnLx4iWUEwH2JxsIRorOf/qBeQ5ykLVyqS7clXA42rwvxE0E+qLyWzpPWTx6QsYJfdVkzhpkMt7lS6jWwHN4v0z3/2qADsoNQRIORsIhC82VdqWsYNQwGQRkQaubjA2fOTZBjV4JDMHzOQp5dmrgCdQGU0eQM1aVUXK1fIHpLfYjCKcw/xc8qVjcP7ABsoP62EBFO1YZ/yhcB/vRWs69huK7CZlb6UQjkWX26XJRw0SzRLwn+gKaVmN/RJm8Mw0/IUyzmRJ3qVGpY1EVO/qeDyZxEvgjKwuaDZwNQjxNvlfoNRl1mYv/6LJyiMkdxJi8SV64AzmFgeJgC6BGoEfFK0ne0X5wa5n/1WZLSIQFHJBRxSfm0699PIaTqQBd/hnFH4nE1LuC/Rs6fIalBc8vqlbIThhJ6II0snifTLuvvfSee0RD0uIi5nkvKfuruzFFRaWyR5CKuDjjsBwrmYCNVGXsG4OGNlxkFA+cCkluuyNjOD2UmLR/3Wg8uHln/yjs9lprstIzVRn9W3UPR165AhlBUuVQj1T7XKdlEAeGRcSD0pqj2wlKPm4aE/YpwIFZFjLL4J8jCdY83/IM4xOU7snkyRn/Yn9KcfVSJ49k6Uo2OG5hLjpQjjQ== your_email@example.com From cd9d2b742da5a6263a551898faec834c0b3bfa1c Mon Sep 17 00:00:00 2001 From: Ed J Date: Fri, 10 Jul 2020 22:31:32 +0100 Subject: [PATCH 081/147] add mohawk2 user --- hieradata/env/production.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index ffd27c13..15d0e38d 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -136,4 +136,7 @@ metacpan::users: jberger: admin : true fullname : "Joel Berger " + mohawk2: + admin : true + fullname : "Ed J " From b90863ef061e1e40f8eb466b9c5047e021adddde Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 21 Nov 2020 01:05:48 +0100 Subject: [PATCH 082/147] update fastly ip ranges --- hieradata/common.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 9c909cf7..3d80b188 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -442,22 +442,25 @@ nginx::allowed: # local machine's IP - "%{default_ipaddress}/32" # https://api.fastly.com/public-ip-list + 127.0.0.1/32 + - 23.235.32.0/20 + - 43.249.72.0/22 - 103.244.50.0/24 - 103.245.222.0/23 - 103.245.224.0/24 - 104.156.80.0/20 + - 146.75.0.0/16 - 151.101.0.0/16 - 157.52.64.0/18 + - 167.82.0.0/17 + - 167.82.128.0/20 + - 167.82.160.0/20 + - 167.82.224.0/20 - 172.111.64.0/18 - 185.31.16.0/22 - - 199.232.0.0/16 - 199.27.72.0/21 - - 202.21.128.11/32 - - 202.21.128.12/32 - - 203.57.145.11/32 - - 203.57.145.12/32 - - 23.235.32.0/20 - - 43.249.72.0/22 + - 199.232.0.0/16 + - 2a04:4e40::/32 + - 2a04:4e42::/32 # Disable the systemd imjournal rsyslog::im_journal_ratelimit_interval: false rsyslog::im_journal_statefile: false From 4cf3c92672d87bb33393df433e6aa27d3750cd7c Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 25 Feb 2021 21:37:37 -0500 Subject: [PATCH 083/147] Fix 02packages cache misses --- .../metacpan/templates/web/metacpan-cpan-static/fastly.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb index c0bf4ea0..9e05e26e 100644 --- a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb +++ b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb @@ -40,3 +40,9 @@ location ~ /authors/ { # anything else autoindex on; } + +# Try to mimic cpan.org's caching for 02packages +location ~ /modules/.*/$ { + autoindex on + add_header Cache-Control 'public, max-age=600, stale-while-revalidate=90, stale-if-error=172800'; +} From 827a76a0eda7612e571a94471269402a70056772 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 26 Feb 2021 10:36:46 -0500 Subject: [PATCH 084/147] Add missing semicolon to cpan.metacpan.org nginx config --- modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb index 9e05e26e..1c93c9e9 100644 --- a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb +++ b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb @@ -43,6 +43,6 @@ location ~ /authors/ { # Try to mimic cpan.org's caching for 02packages location ~ /modules/.*/$ { - autoindex on + autoindex on; add_header Cache-Control 'public, max-age=600, stale-while-revalidate=90, stale-if-error=172800'; } From e3028335cbcd85bb14978aee655fe9a00f99b9d4 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 26 Feb 2021 23:04:07 -0500 Subject: [PATCH 085/147] Omit trailing slash in match for 02packages --- modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb index 1c93c9e9..c367610d 100644 --- a/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb +++ b/modules/metacpan/templates/web/metacpan-cpan-static/fastly.erb @@ -42,7 +42,7 @@ location ~ /authors/ { } # Try to mimic cpan.org's caching for 02packages -location ~ /modules/.*/$ { +location ~ /modules/.*$ { autoindex on; add_header Cache-Control 'public, max-age=600, stale-while-revalidate=90, stale-if-error=172800'; } From 4a3146bc14ff4cb38e56853d96eb7c743e8f7957 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 15 Apr 2021 15:17:06 +0100 Subject: [PATCH 086/147] Disable the mirror cron Mirrors are no more: https://log.perl.org/2021/02/cpan-mirror-list-changes.html --- hieradata/nodes/bm-mc-01.yaml | 2 -- hieradata/nodes/lw-mc-03.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 22eb1048..2657e2c8 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -33,8 +33,6 @@ metacpan::crons::api: ensure : present ratings: ensure : absent - mirrors: - ensure : present cpantesters: ensure : present latest: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 8ecec621..2e9bc5c6 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -41,8 +41,6 @@ metacpan::crons::api: ensure : absent ratings: ensure : absent - mirrors: - ensure : present cpantesters: ensure : present latest: From 040d5bc5c290a96f921194b63b58e0b615091e84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Apr 2021 14:24:30 +0000 Subject: [PATCH 087/147] Bump nokogiri from 1.10.8 to 1.11.3 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.8 to 1.11.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.8...v1.11.3) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 70ea9ede..cd3b191d 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -218,7 +218,7 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) - mini_portile2 (2.4.0) + mini_portile2 (2.5.0) minitest (5.14.1) mocha (1.1.0) metaclass (~> 0.0.1) @@ -227,8 +227,9 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.10.8) - mini_portile2 (~> 2.4.0) + nokogiri (1.11.3) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -251,6 +252,7 @@ GEM puppet-syntax rake rspec-puppet + racc (1.5.2) rake (12.3.3) rbvmomi (1.8.2) builder From af671f7a4c04f27b87ea01fa6dffe2a4499ef2e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 09:05:48 +0000 Subject: [PATCH 088/147] Bump nokogiri from 1.11.3 to 1.11.4 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.3 to 1.11.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.3...v1.11.4) Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index cd3b191d..cef8c630 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -218,7 +218,7 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) - mini_portile2 (2.5.0) + mini_portile2 (2.5.1) minitest (5.14.1) mocha (1.1.0) metaclass (~> 0.0.1) @@ -227,7 +227,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.11.3) + nokogiri (1.11.4) mini_portile2 (~> 2.5.0) racc (~> 1.4) pry (0.10.1) From 4bf2b02704a83e6062da5550fcbc416d4aaadd16 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 26 Jun 2021 01:34:27 +0200 Subject: [PATCH 089/147] add new ssh keys for haarg --- modules/metacpan/files/default/home/haarg/ssh/authorized_keys | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys index b8a3c461..5b9ec433 100644 --- a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys @@ -2,3 +2,5 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6wBnxyfoyNIVcfaw07MwCdnrq5StFGTwXkU7Guh+fb ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH7JaCN6LRb/P2tjRVSNxZ5hEKJ3GRnYVyT/X2C4ePQHd3aNb1LyaI4DYo66t1VJUkduzXoQY0vPSlxOeBTr5L5Dzs36S6mMlU182XJ8YJwYYsSd7cwxR3cGBRlBGP8to+RnjkhQodRi5ozWTUVA9RNexCMHZwPPWJsxoKhUWsFiZE19c+eieRuA2rkOj7aQy6dz9vzu0a6uznby8XBDJC+6nw8SZRCw9aiiep07aGSA5kyz8LaxkQXfT7l/pPiwbqnTN6u0jF3VaImPB2ByT3QynUhNbkawixcr992yca0bRRS8cjnu4sgjipo2BN0dl6iPoamzmsAh5tdBlmRjoH gknop@cuneus ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0TF5TGxXB9JEprUeB4/dJQ3bhRKZDc89QAwz+0Fk0S gknop@C02QV2JTFVH6 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7o3RTCjabI0QGMYWHa6bP8OetQR03xPDO2puhoL3XsD0UX/sSEB3b6EWzih/1eSmxvAmfd7skKwVvW9u3ai607Gi82jtWlQB+KiJXodK7+XCM5S8F6SXFJ4kvsbF58a/08xWw9Vr2dULYu9ooSqaN2ogVchm3w86ZN0mpw8GNef9X3lnxaklbJBBF1LgtPE4+4AmnXKsU8Q0Bx8DH/D5ae1GkY/Kko2p+Iz0zLMvcK/5zlWQyfh7r4t0J5GdU8JQH76MzQIJ7rJp8tVoU22cev+BXIBSzRfEf8KmNEC+JhnJwRB8sS3mbhUCPkL5rnXwBa5nGXeAvD0DvC6zsVnUocWShcTkw/36Ero1QjJc5hYxu1LO/ZmHAl6D1UA0CYNF2i/9pxyJ+Srhfu1xu0bP3C14ND228BcOIbYZKxfH8MXWkhUSG94kCX6MagAqmykW1BkxpZgrY3rOOxkjQHTEVOCowwKtgCOfGPOouFaYeYzfkqiw2BeiYR6OjiwQoBubT04ekDSZk5f+yYM7mwBjrBJNMSv0Slz8ydFeuE1Gh63VgvnKtHTmMKfWHi/2KB7DPyEplyvTMI4D6O5uSuXQvybejuZEO35/7Jr922PbiuJA7BBwB9HWcyo3FDEiCqrJpLUdd+1m0VdxkmM7hxQ6MXgT+8/e/ERf4iKnv20+7sw== gknop@C02QV2JTFVH6 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIySfX93HCNv94OgeiybiObkUjlW3o4mnmG5PjOjoHNF gknop@FVFFN10WQ05Q +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1a+JAU9hP75dbJk0qtmwYa+cJa5bDKezFBp1geLZYW1IX2kxm26dNwz1r6UWiMyuGVj/ailAE+/Zf2cte1E9YTfGNQs3EhAy/Nqv4BThe7rHmfcEWxzPTCPET7M3buWPdTZDmVgANa/uXimzQP4mJclWUsfoB2/6uGceDih6snArmxeJFZptA6NUJ43EdvYhJRfH2CAGRrER2BxrDo/wKPSMu6laqwRvMLOPv+k+oqXB0I6aLjAaWk0BACT2evpBRWPl6/hDGGJiUK0sTXEs9DH4afjTJ6VGURbLIcPoIutDwzHo87wcgjqoGMPj6FfRy4UViSLHOrSidFHUGwOGuNPTSkeXnnzea/Ap/7brH7KAoZv0YVGcg9jx5JkT+4b/lVEr+L3ojZVYOD+Ek+uhmfbg40VE44XUe8ep4mNhlD2vAc43Cf5k8KJNfvBoHyFMK38zm/TXChzOKWZY1VKqQ9hN2MOwLNHiAyRMdXetA/21WYDbVQX1ku0KeDdvEbOrAf/VLkRL9CK2XUM+s0SdhJCRYR3yLIk8vIiIV7R3+9qOGxQn86eq0rAbZiWZEGGkJbK6bMYiaWEQnNPypw2v/6YmS1+1uG1T9ni9Rzz0/oiPPXUWUSZghDAo18v0uP7/y1anhJ89SHGUSd5GHlaJwTaOT8yNBwH7sfBhS5dx93w== gknop@FVFFN10WQ05Q From 8005b0e4df0574aa0c2ce25145e2320768f01ae6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:24:47 +0000 Subject: [PATCH 090/147] Bump addressable from 2.3.7 to 2.8.0 in /contrib-modules/file_concat Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.3.7 to 2.8.0. - [Release notes](https://github.com/sporkmonger/addressable/releases) - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.3.7...addressable-2.8.0) --- updated-dependencies: - dependency-name: addressable dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index cef8c630..8a352479 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -57,7 +57,8 @@ GEM minitest (~> 5.1) tzinfo (~> 1.1) zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.3.7) + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) autoparse (0.3.3) addressable (>= 2.3.1) extlib (>= 0.9.15) @@ -234,6 +235,7 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) + public_suffix (4.0.6) puppet (3.7.4) facter (> 1.6, < 3) hiera (~> 1.0) From f11e1b4dabdb27ea2f451366a3998bf0af1acad3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Sep 2021 21:31:54 +0000 Subject: [PATCH 091/147] Bump nokogiri from 1.11.4 to 1.12.5 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.4 to 1.12.5. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.4...v1.12.5) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 8a352479..d4d5c674 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -219,7 +219,7 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) - mini_portile2 (2.5.1) + mini_portile2 (2.6.1) minitest (5.14.1) mocha (1.1.0) metaclass (~> 0.0.1) @@ -228,8 +228,8 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.11.4) - mini_portile2 (~> 2.5.0) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) racc (~> 1.4) pry (0.10.1) coderay (~> 1.1.0) From 87955e3df801ee24be3d725bde213c3f058fb148 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 23:58:15 +0000 Subject: [PATCH 092/147] Bump nokogiri from 1.12.5 to 1.13.4 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.12.5 to 1.13.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.12.5...v1.13.4) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index d4d5c674..e9da2006 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -219,7 +219,7 @@ GEM metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) - mini_portile2 (2.6.1) + mini_portile2 (2.8.0) minitest (5.14.1) mocha (1.1.0) metaclass (~> 0.0.1) @@ -228,8 +228,8 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.4) + mini_portile2 (~> 2.8.0) racc (~> 1.4) pry (0.10.1) coderay (~> 1.1.0) @@ -254,7 +254,7 @@ GEM puppet-syntax rake rspec-puppet - racc (1.5.2) + racc (1.6.0) rake (12.3.3) rbvmomi (1.8.2) builder From 5252b0ee6151e788beb6bf5821886f168c717be0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 03:38:12 +0000 Subject: [PATCH 093/147] Bump nokogiri from 1.13.4 to 1.13.6 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.4 to 1.13.6. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.4...v1.13.6) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index e9da2006..5855ce12 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -228,7 +228,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.13.4) + nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) pry (0.10.1) From 886e36416dd599933e97f0c2698a36110d139fe5 Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Sun, 5 Jun 2022 12:27:05 -0400 Subject: [PATCH 094/147] Remove grep from bm-mc-02 This service has migrated to the hc-mc k8s cluster. --- hieradata/nodes/bm-mc-02.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index 8c2a6f03..f4bf05d6 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -19,20 +19,6 @@ metacpan::crons::general: metacpan_sitemaps: minute : 10 - -metacpan::web::starman: - - metacpan-grep-front-end: - git_source: 'https://github.com/metacpan/metacpan-grep-front-end.git' - git_revision: 'master' - git_enable: true - vhost_ssl_only: true - vhost_bare: true - vhost_aliases: - - 'grep.metacpan.org' - starman_port: 5006 - starman_workers: 20 - metacpan::git::repo: metacpan-cpan-extracted: From 20bc26634409a89b39a69a9281d6557f6542ea65 Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Mon, 6 Jun 2022 09:32:29 -0400 Subject: [PATCH 095/147] Remove cron configuration for git repo No longer needed as grep is running elsewhere. --- hieradata/nodes/bm-mc-02.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index f4bf05d6..65c61855 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -18,13 +18,3 @@ metacpan::users: metacpan::crons::general: metacpan_sitemaps: minute : 10 - -metacpan::git::repo: - - metacpan-cpan-extracted: - enable_git_repo: true - source: 'https://github.com/metacpan/metacpan-cpan-extracted.git' - revision: 'master' - path: '/mnt/lv-ssdscratch/metacpan-cpan-extracted' - owner: 'toddr' - group: 'toddr' From 5d76a53e64f20ca137a569f10b492b9dc558c73d Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 15 Jun 2022 00:14:09 +0200 Subject: [PATCH 096/147] update fastly ip list --- hieradata/common.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 3d80b188..41b1a764 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -441,14 +441,16 @@ nginx::allowed: - 127.0.0.1/32 # local machine's IP - "%{default_ipaddress}/32" - # https://api.fastly.com/public-ip-list + 127.0.0.1/32 + # https://api.fastly.com/public-ip-list - 23.235.32.0/20 - 43.249.72.0/22 - 103.244.50.0/24 - 103.245.222.0/23 - 103.245.224.0/24 - 104.156.80.0/20 - - 146.75.0.0/16 + - 140.248.64.0/18 + - 140.248.128.0/17 + - 146.75.0.0/17 - 151.101.0.0/16 - 157.52.64.0/18 - 167.82.0.0/17 From 2614a2fe7ff98d87ad75c06d6a78bd1d4e7cf716 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 01:33:51 +0000 Subject: [PATCH 097/147] Bump tzinfo from 1.2.7 to 2.0.5 in /contrib-modules/file_concat Bumps [tzinfo](https://github.com/tzinfo/tzinfo) from 1.2.7 to 2.0.5. - [Release notes](https://github.com/tzinfo/tzinfo/releases) - [Changelog](https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md) - [Commits](https://github.com/tzinfo/tzinfo/compare/v1.2.7...v2.0.5) --- updated-dependencies: - dependency-name: tzinfo dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 117 +++++++++++++---------- 1 file changed, 64 insertions(+), 53 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 5855ce12..41c354c8 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,18 +51,13 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (6.0.3.1) + activesupport (7.0.3.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) - autoparse (0.3.3) - addressable (>= 2.3.1) - extlib (>= 0.9.15) - multi_json (>= 1.0.0) aws-sdk (1.63.0) aws-sdk-v1 (= 1.63.0) aws-sdk-v1 (1.63.0) @@ -81,9 +76,10 @@ GEM coderay (1.1.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.10) crack (0.4.2) safe_yaml (~> 1.0.0) + declarative (0.0.20) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.2.5) @@ -92,10 +88,11 @@ GEM json equalizer (0.0.11) excon (0.71.0) - extlib (0.9.16) facter (1.7.6) - faraday (0.9.1) - multipart-post (>= 1.2, < 3) + faraday (2.3.0) + faraday-net_http (~> 2.0) + ruby2_keywords (>= 0.0.4) + faraday-net_http (2.0.3) fission (0.5.0) CFPropertyList (~> 2.2) fog (1.28.0) @@ -179,28 +176,39 @@ GEM fog-core nokogiri (~> 1.5, >= 1.5.11) formatador (0.2.5) - google-api-client (0.8.3) - activesupport (>= 3.2) - addressable (~> 2.3) - autoparse (~> 0.3) - extlib (~> 0.9) - faraday (~> 0.9) - googleauth (~> 0.3) - launchy (~> 2.4) - multi_json (~> 1.10) - retriable (~> 1.4) - signet (~> 0.6) - googleauth (0.3.0) - faraday (~> 0.9) - jwt (~> 1.4.1) - logging (~> 1.8) - memoist (~> 0.11.0) - multi_json (= 1.11.0) - signet (~> 0.6.0) + gems (1.2.0) + google-api-client (0.53.0) + google-apis-core (~> 0.1) + google-apis-generator (~> 0.1) + google-apis-core (0.7.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-discovery_v1 (0.11.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-generator (0.9.0) + activesupport (>= 5.0) + gems (~> 1.2) + google-apis-core (>= 0.7, < 2.a) + google-apis-discovery_v1 (~> 0.5) + thor (>= 0.20, < 2.a) + googleauth (1.2.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) hiera (1.3.4) json_pure hocon (0.0.7) - i18n (1.8.2) + httpclient (2.8.3) + i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.1) inflecto (0.0.2) @@ -208,34 +216,29 @@ GEM ipaddress (0.8.0) json (1.8.6) json_pure (1.8.2) - jwt (1.4.1) - launchy (2.4.3) - addressable (~> 2.3) - little-plugger (1.1.3) - logging (1.8.2) - little-plugger (>= 1.1.3) - multi_json (>= 1.8.4) - memoist (0.11.0) + jwt (2.4.1) + memoist (0.16.2) metaclass (0.0.4) method_source (0.8.2) mime-types (2.4.3) + mini_mime (1.1.2) mini_portile2 (2.8.0) - minitest (5.14.1) + minitest (5.16.2) mocha (1.1.0) metaclass (~> 0.0.1) - multi_json (1.11.0) - multipart-post (2.0.0) + multi_json (1.15.0) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) + os (1.1.4) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - public_suffix (4.0.6) + public_suffix (4.0.7) puppet (3.7.4) facter (> 1.6, < 3) hiera (~> 1.0) @@ -262,7 +265,12 @@ GEM trollop rdoc (3.12.2) json (~> 1.4) - retriable (1.4.1) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.5) rspec (3.2.0) rspec-core (~> 3.2.0) rspec-expectations (~> 3.2.0) @@ -283,6 +291,7 @@ GEM json rspec-support (3.2.2) rsync (1.0.9) + ruby2_keywords (0.0.5) rubysl-securerandom (2.0.0) safe_yaml (1.0.4) serverspec (2.13.0) @@ -290,11 +299,10 @@ GEM rspec (~> 3.0) rspec-its specinfra (~> 2.25) - signet (0.6.0) - addressable (~> 2.3) - extlib (~> 0.9) - faraday (~> 0.9) - jwt (~> 1.0) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) multi_json (~> 1.10) slop (3.6.0) spdx-licenses (1.0.0) @@ -302,10 +310,13 @@ GEM specinfra (2.26.1) net-scp net-ssh + thor (1.2.1) thread_safe (0.3.6) + trailblazer-option (0.1.2) trollop (2.1.2) - tzinfo (1.2.7) - thread_safe (~> 0.1) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + uber (0.1.0) unf (0.1.4) unf_ext unf_ext (0.0.6) @@ -317,7 +328,7 @@ GEM webmock (1.20.4) addressable (>= 2.3.6) crack (>= 0.3.2) - zeitwerk (2.3.0) + webrick (1.7.0) PLATFORMS ruby From 28b62b4da90d0b58ff16f77dfe7f8fd3b8e3f0e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 03:01:24 +0000 Subject: [PATCH 098/147] Bump nokogiri from 1.13.6 to 1.13.9 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.6 to 1.13.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.6...v1.13.9) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 41c354c8..a780cb6b 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -230,7 +230,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.13.6) + nokogiri (1.13.9) mini_portile2 (~> 2.8.0) racc (~> 1.4) os (1.1.4) From 0f7ead9d6c25e709d66017ce99bdb44e474b09fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 04:01:18 +0000 Subject: [PATCH 099/147] Bump nokogiri from 1.13.9 to 1.13.10 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.9 to 1.13.10. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.9...v1.13.10) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index a780cb6b..551166e3 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -230,7 +230,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.13.9) + nokogiri (1.13.10) mini_portile2 (~> 2.8.0) racc (~> 1.4) os (1.1.4) @@ -257,7 +257,7 @@ GEM puppet-syntax rake rspec-puppet - racc (1.6.0) + racc (1.6.1) rake (12.3.3) rbvmomi (1.8.2) builder From 6c743cda68c04b2912e3270409bf2de63720761c Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 9 Dec 2022 05:35:39 -0500 Subject: [PATCH 100/147] Don't run codeql on "push" events Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading Code Scanning results requires write access. To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See https://docs.github.com/en/code-security/secure-coding/configuring-code-scanning#scanning-on-push for more information on how to configure these events. --- .github/workflows/codeql-analysis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a96b5dbb..a708a59e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,7 +1,6 @@ name: "Code scanning - action" on: - push: pull_request: schedule: - cron: '0 23 * * 6' @@ -23,7 +22,7 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 From 8412db53ffd8ccc5850f2bd866f89da7f7b3ae5e Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 9 Dec 2022 05:37:19 -0500 Subject: [PATCH 101/147] Bump versions of GH actions --- .github/workflows/codeql-analysis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a708a59e..bc9fd2b0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -25,7 +25,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java @@ -33,7 +33,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -47,4 +47,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 67df317eaa91b75dfecefa4ba9461940e18d805b Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 9 Dec 2022 05:39:00 -0500 Subject: [PATCH 102/147] Tidy YAML in workflow --- .github/workflows/codeql-analysis.yml | 79 ++++++++++++++------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index bc9fd2b0..83e2827c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,4 +1,5 @@ -name: "Code scanning - action" +--- +name: 'Code scanning - action' on: pull_request: @@ -7,44 +8,44 @@ on: jobs: CodeQL-Build: - runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - # Override language selection by uncommenting this and choosing your languages - # with: - # languages: go, javascript, csharp, python, cpp, java - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + - name: Checkout repository + uses: actions/checkout@v3 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + # Override language selection by uncommenting this and choosing your + # languages with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or + # Java). If this step fails, then you should remove it and run the build + # manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following + # three lines and modify them (or add more) to build your code if your + # project uses a compiled language + + # - run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 From 390b6b82b05b0486653a7c3a6d75a9bd62fe1790 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 18:56:53 +0000 Subject: [PATCH 103/147] Bump activesupport in /contrib-modules/file_concat Bumps [activesupport](https://github.com/rails/rails) from 7.0.3.1 to 7.0.4.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.4.1/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.3.1...v7.0.4.1) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 551166e3..75df0d8a 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,7 +51,7 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (7.0.3.1) + activesupport (7.0.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -223,7 +223,7 @@ GEM mime-types (2.4.3) mini_mime (1.1.2) mini_portile2 (2.8.0) - minitest (5.16.2) + minitest (5.17.0) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.15.0) From 60e0c79c9923597d9e83de4fe8be38a2b5bdfafb Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 10 Mar 2023 05:39:12 +0100 Subject: [PATCH 104/147] fix elasticsearch daily log filenames --- contrib-modules/elasticsearch/data/common.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib-modules/elasticsearch/data/common.yaml b/contrib-modules/elasticsearch/data/common.yaml index 48408d51..59cf315a 100644 --- a/contrib-modules/elasticsearch/data/common.yaml +++ b/contrib-modules/elasticsearch/data/common.yaml @@ -11,8 +11,7 @@ elasticsearch::api_timeout: 10 elasticsearch::autoupgrade: false elasticsearch::config: {} elasticsearch::configdir: /etc/elasticsearch -elasticsearch::daily_rolling_date_pattern: < - "'.'yyyy-MM-dd" +elasticsearch::daily_rolling_date_pattern: "'.'yyyy-MM-dd" elasticsearch::datadir_instance_directories: true elasticsearch::default_logging_level: 'INFO' elasticsearch::defaults_location: ~ From 694fcb56726e28c499cc577f3cc516e41ca75617 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 05:53:17 +0000 Subject: [PATCH 105/147] Bump nokogiri from 1.13.10 to 1.14.3 in /contrib-modules/file_concat Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.10 to 1.14.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.10...v1.14.3) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 75df0d8a..fe0d4c5e 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -222,7 +222,7 @@ GEM method_source (0.8.2) mime-types (2.4.3) mini_mime (1.1.2) - mini_portile2 (2.8.0) + mini_portile2 (2.8.1) minitest (5.17.0) mocha (1.1.0) metaclass (~> 0.0.1) @@ -230,7 +230,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) - nokogiri (1.13.10) + nokogiri (1.14.3) mini_portile2 (~> 2.8.0) racc (~> 1.4) os (1.1.4) @@ -257,7 +257,7 @@ GEM puppet-syntax rake rspec-puppet - racc (1.6.1) + racc (1.6.2) rake (12.3.3) rbvmomi (1.8.2) builder From 51a876b08142a48d7ff7046658f9698da3117926 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 14:57:28 +0000 Subject: [PATCH 106/147] Bump activesupport in /contrib-modules/file_concat Bumps [activesupport](https://github.com/rails/rails) from 7.0.4.1 to 7.0.4.3. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.4.3/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.4.1...v7.0.4.3) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index fe0d4c5e..cf30bfc6 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,7 +51,7 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (7.0.4.1) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -76,7 +76,7 @@ GEM coderay (1.1.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) crack (0.4.2) safe_yaml (~> 1.0.0) declarative (0.0.20) @@ -223,7 +223,7 @@ GEM mime-types (2.4.3) mini_mime (1.1.2) mini_portile2 (2.8.1) - minitest (5.17.0) + minitest (5.18.0) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.15.0) @@ -314,7 +314,7 @@ GEM thread_safe (0.3.6) trailblazer-option (0.1.2) trollop (2.1.2) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unf (0.1.4) From 844973db5cce6872db2cc0ef2fd4fc707664d176 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 27 Apr 2023 23:08:11 +0100 Subject: [PATCH 107/147] Update authorized_keys for atoomic --- modules/metacpan/files/default/home/atoomic/ssh/authorized_keys | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/metacpan/files/default/home/atoomic/ssh/authorized_keys b/modules/metacpan/files/default/home/atoomic/ssh/authorized_keys index 102235d5..c20087e5 100644 --- a/modules/metacpan/files/default/home/atoomic/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/atoomic/ssh/authorized_keys @@ -1 +1,2 @@ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxf6B3zAlGVfWfUYQQ/r0bONyJzKLK/stf/RIUgGnEy6YOTxRF6i9uSwmaDUO7P4IPOuO9Hp2Qfuf0J2dOYCiYJXz97KRhW9UfxVIr8GSXm7VtXtnKicWrS8CtYKu1ZZt2bfF8/evHrQ/1ftQVLf/sgMfugmCMtq+jFuS+f9KUjAN5Nfg2lP0yqw+6vAHvT9YWuOcRRHJzaz4ngSl8EpvtxpCmXDXI4vGCwAXotMasgUASf5rvoXvOjOtwfMm0tEPbSqTBO0+pr2woQyCDo0IHUIAt/O49VSUE8pxvJTOJpkV65YpFdp8m3bCOmPTMOwlz7dohcTrfW6gQKAb3iZInw== nicolasrochelemagne@Nicolas-Rochelemagnes-Mac-Pro.local +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOjHgICDuipAQUGfY2vnieyxNqRA8iVICNJYKM+sZTwV metacpan-atoomic From 78b6cc77d1998289f180bccfb7babdb22bccb99e Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Fri, 28 Apr 2023 10:24:36 +0200 Subject: [PATCH 108/147] Update oalders SSH keys --- .../metacpan/files/default/home/olaf/ssh/authorized_keys | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/metacpan/files/default/home/olaf/ssh/authorized_keys b/modules/metacpan/files/default/home/olaf/ssh/authorized_keys index f815cff6..cac17c71 100644 --- a/modules/metacpan/files/default/home/olaf/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/olaf/ssh/authorized_keys @@ -1 +1,6 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv2nWlnwMiIwfTpClbqDwHWL/gI5Yk8SqBGA7GRL/dMO7USpqYl3xEcAAFRSjI89cqxpFumVQLbD5m3agIkMIaiMOlNUpdd3YWtvawPATXrZQ3HSbuFlJ2IPB2PdjD4Y37nlLLolCfnlHTK5tuTuUpv57k9JB/HDr+CJIBVgsnP8ox3RwhIRG0nIm7LkBcRGbM2TDCDWbFNd1Y3w1kHc3JK4r3ZAt5p/hZWK/8hf6emBMcflNalB3RWTR7sAeemVHClHu8n1UGQRDMrE9EX+HELcpxe8kGVAm7PyavbPoANJ92CoxV50wsNMDwHotBkh7ehmE0nl3Z5FCLVtpZsK/EQ== olaf@olaf-alderss-macbook-pro.local +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAv2nWlnwMiIwfTpClbqDwHWL/gI5Yk8SqBGA7GRL/dMO7USpqYl3xEcAAFRSjI89cqxpFumVQLbD5m3agIkMIaiMOlNUpdd3YWtvawPATXrZQ3HSbuFlJ2IPB2PdjD4Y37nlLLolCfnlHTK5tuTuUpv57k9JB/HDr+CJIBVgsnP8ox3RwhIRG0nIm7LkBcRGbM2TDCDWbFNd1Y3w1kHc3JK4r3ZAt5p/hZWK/8hf6emBMcflNalB3RWTR7sAeemVHClHu8n1UGQRDMrE9EX+HELcpxe8kGVAm7PyavbPoANJ92CoxV50wsNMDwHotBkh7ehmE0nl3Z5FCLVtpZsK/EQ== +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJUZ2XPn9YEbs8I+awgqv2fYjXv3fNZk11Ks5wKiW0w +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFxda6OaXjau0Oup7wUbYTsL2G6+ivnps9bqPwmCr9os +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGDig9jIff3XYX5WzBU+uJJZVA9b+DSQh8yUl6IkQ0An +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCcq2kEHOwl1HRgOgYkNoWqHD+FBJh/y5kg0FmovzH/czz1JpH3zVyW6KbxGbXo37VlUHQmtdn2ZFe7h3VRTjSHEsqBelzq7r8uVE5dIjVlkSlj8l+cJ4QPIOCJF8c6fTkVUX2FcPDkQVs+zsal6GxHUaf4ZwpNySig5NzNMYCduAdTWVpF7k99G03KKdwDuseZxU4jP52oenzlz+Zhq04r8zW+tdC3hn4DWoiMNlPJ6XuiPqoflHyTaHAk6xknfSrhaODnfmOPDtxwW5HKswu20pWgDw7uXina2meOup6zIBX7otozw9jHaMoBGFtmQYECvv+HDIxYgAD2OTzy2cIIBBwbDDjLXSB/5agQnsGSh5mvQFXg5OFcCOAsG1HwLd1olj6kOIC/pgkYiJn9gplmVqfVBSmwmb9vQwOamTn7c2WN4DN6B0YNO2hbGjEGrs6HeWx8V8IcebKfgPKDKAlRwJFHLaHmYKq9HSwq5cJtYTyIpLxrwQSZmgRKrTF7fCE= +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1hlJCH5JbR5GLX8/bGu035H5PIWLFE6MH1NDX5lKAA From ec8bdc3f4f619a93dd0e576e5271ba1a709e1cfe Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Fri, 28 Apr 2023 09:38:43 +0100 Subject: [PATCH 109/147] Disable passwd for sudo for Mickey --- hieradata/env/production.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 15d0e38d..2d3f3211 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -127,6 +127,7 @@ metacpan::users: mickey: admin : true fullname : "Mickey Nasriachi " + no_passwd_sudo : true # David Cantrell needs access for cpxxxan and cpan deps (rsync) davidc: fullname : "David Cantrell " From 3c43271786d1bef187bd97145abe0d3ca6cde52f Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 30 Apr 2023 11:27:19 +0100 Subject: [PATCH 110/147] step 1 - disable cron before actually deleting --- hieradata/nodes/bm-mc-01.yaml | 2 -- hieradata/nodes/lw-mc-03.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 2657e2c8..812312d7 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -11,8 +11,6 @@ minion_queue::service::enable: true metacpan::watcher::enable: true metacpan::crons::general: - swat_monitoring: - ensure : absent user_data_index_backups: ensure : absent import_authors: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 2e9bc5c6..65ce317c 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -23,8 +23,6 @@ munin::node::plugins: config: ['user metacpan'] metacpan::crons::general: - swat_monitoring: - ensure : present user_data_index_backups: ensure : present import_authors: From dcfd2d99aff86a6673ff690a8864712a23dbbff4 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 30 Apr 2023 11:35:07 +0100 Subject: [PATCH 111/147] step 2 - do not actually install swat --- hieradata/common.yaml | 7 ---- hieradata/nodes/lw-mc-03.yaml | 5 --- hieradata/nodes/metacpan-dev.yaml | 3 -- modules/metacpan/manifests/init.pp | 4 -- modules/metacpan/manifests/system/swat.pp | 47 ----------------------- 5 files changed, 66 deletions(-) delete mode 100644 modules/metacpan/manifests/system/swat.pp diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 41b1a764..8d68f5b4 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -253,13 +253,6 @@ metacpan::crons::general: hour : 1 ensure : absent - swat_monitoring: - cmd : "/bin/sh /home/%{hiera('metacpan::user')}/metacpan-monitoring/cron.sh" - minute : 37 - ensure : absent - - - # NOTE: set to `absent` here - turn on in the node metacpan::crons::api: # Remvoe author - now in wrapper script in general diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 65ce317c..ab657784 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -7,11 +7,6 @@ minion_queue::service::workers: 5 minion_queue::service::ensure: running minion_queue::service::enable: true -# Install swat on here -metacpan::system::swat: - metacpan-monitoring: - enable: true - # We want watcher enabled metacpan::watcher::enable: true diff --git a/hieradata/nodes/metacpan-dev.yaml b/hieradata/nodes/metacpan-dev.yaml index 591048b6..ea451a4c 100644 --- a/hieradata/nodes/metacpan-dev.yaml +++ b/hieradata/nodes/metacpan-dev.yaml @@ -37,9 +37,6 @@ metacpan::elasticsearch::env: 'dev' #metacpan::elasticsearch::cluster_hosts: # - 1.2.3.4 # - 1.2.3.5 -metacpan::system::swat: - metacpan-monitoring: - enable: true # Open up ports for development metacpan::fw_ports: diff --git a/modules/metacpan/manifests/init.pp b/modules/metacpan/manifests/init.pp index dd48355e..8b3ba1e9 100644 --- a/modules/metacpan/manifests/init.pp +++ b/modules/metacpan/manifests/init.pp @@ -69,10 +69,6 @@ $websites = hiera_hash('metacpan::web::starman', {}) create_resources('metacpan::web::starman', $websites) - # Swat site - $swat = hiera_hash('metacpan::system::swat', {}) - create_resources('metacpan::system::swat', $swat) - # Run any fire wall stuff here $fw_rules = hiera_hash('metacpan::fw_ports', {}) create_resources('metacpan::system::firewall', $fw_rules) diff --git a/modules/metacpan/manifests/system/swat.pp b/modules/metacpan/manifests/system/swat.pp deleted file mode 100644 index 78720019..00000000 --- a/modules/metacpan/manifests/system/swat.pp +++ /dev/null @@ -1,47 +0,0 @@ -# === Definition swat -# -# In Hiera: -# -# metacpan::system::swat: -# metacpan-monitoring: -# enable: true -# git_revision: 'master' -# -# -define metacpan::system::swat ( - $owner = hiera('metacpan::user', 'metacpan'), - $group = hiera('metacpan::group', 'metacpan'), - $git_revision = 'master', - $enable = false, -) { - - - $path = "/home/${owner}/${name}" - - if( $enable == true ) { - metacpan::gitrepo{ "gitrepo_${name}": - enable_git_repo => true, - path => $path, - source => 'https://github.com/metacpan/metacpan-monitoring.git', - revision => $git_revision, - owner => $owner, - group => $group, - ensure => latest, # force update - - # Should tell carton to run - notify => [ - Carton::Run[$name], - ], - require => [ Metacpan::User[$owner] ], - - } - } - carton::run { $name: - root => $path, - } - - # Cron - - - -} From 66e54f21c341642f90e7ee12aaac0accaad73e4e Mon Sep 17 00:00:00 2001 From: Mickey Nasriachi Date: Wed, 3 May 2023 07:23:59 +0200 Subject: [PATCH 112/147] Cleanup fedora cron references (logic was removed from api) --- hieradata/common.yaml | 5 ----- hieradata/nodes/bm-mc-01.yaml | 2 -- hieradata/nodes/lw-mc-03.yaml | 2 -- 3 files changed, 9 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8d68f5b4..2fa680d8 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -380,11 +380,6 @@ metacpan::crons::api: minute : 33 hour : 3 ensure : absent - external_fedora: - cmd : 'external --external_source fedora --email_to book@cpan.org' - minute : 35 - hour : 3 - ensure : absent favorite_hourly: cmd : 'favorite --check_missing --age 240 --queue' minute: '*/30' diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 812312d7..5ee7561e 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -56,8 +56,6 @@ metacpan::crons::api: external_cygwin: ensure : present # external_debian: -# ensure : present -# external_fedora: # ensure : present contributor_daily: ensure : present diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index ab657784..2d0d68dd 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -59,8 +59,6 @@ metacpan::crons::api: external_cygwin: ensure : present # external_debian: -# ensure : present -# external_fedora: # ensure : present contributor_daily: ensure : present From 92ae8cc6f7497c560216590615aeecd449f09cac Mon Sep 17 00:00:00 2001 From: Mickey Nasriachi Date: Wed, 3 May 2023 07:35:59 +0200 Subject: [PATCH 113/147] Added a an hourly cron to update the cve index --- hieradata/common.yaml | 4 ++++ hieradata/nodes/bm-mc-01.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8d68f5b4..2bd27d78 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -411,6 +411,10 @@ metacpan::crons::api: hour: 14 minute: 0 ensure : absent + cve_hourly: + cmd : 'cve' + minute: '*/45' + ensure : absent metacpan::fw_ports: http: diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 812312d7..ebdcd335 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -69,3 +69,5 @@ metacpan::crons::api: ensure : present cover_full: ensure : present + cve_hourly: + ensure : present From b984beed19e419115329fbeeef669903e0678e2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 15:09:44 +0000 Subject: [PATCH 114/147] Bump facter from 1.7.6 to 2.5.7 in /contrib-modules/file_concat Bumps [facter](https://github.com/puppetlabs/facter) from 1.7.6 to 2.5.7. - [Release notes](https://github.com/puppetlabs/facter/releases) - [Changelog](https://github.com/puppetlabs/facter/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppetlabs/facter/compare/1.7.6...2.5.7) --- updated-dependencies: - dependency-name: facter dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index cf30bfc6..6cbafd2f 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -88,7 +88,7 @@ GEM json equalizer (0.0.11) excon (0.71.0) - facter (1.7.6) + facter (2.5.7) faraday (2.3.0) faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) From 545cb6b1604e630319f97bd9330ee2cb9fcde106 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:42:22 +0000 Subject: [PATCH 115/147] Bump activesupport in /contrib-modules/file_concat Bumps [activesupport](https://github.com/rails/rails) from 7.0.4.3 to 7.0.7.2. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v7.0.7.2/activesupport/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.0.4.3...v7.0.7.2) --- updated-dependencies: - dependency-name: activesupport dependency-type: indirect ... Signed-off-by: dependabot[bot] --- contrib-modules/file_concat/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock index 6cbafd2f..07763183 100644 --- a/contrib-modules/file_concat/Gemfile.lock +++ b/contrib-modules/file_concat/Gemfile.lock @@ -51,7 +51,7 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.1) - activesupport (7.0.4.3) + activesupport (7.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -208,7 +208,7 @@ GEM json_pure hocon (0.0.7) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) ice_nine (0.11.1) inflecto (0.0.2) @@ -223,7 +223,7 @@ GEM mime-types (2.4.3) mini_mime (1.1.2) mini_portile2 (2.8.1) - minitest (5.18.0) + minitest (5.19.0) mocha (1.1.0) metaclass (~> 0.0.1) multi_json (1.15.0) From c44905379065af2ffd7af358feae0ca99ba91e85 Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Mon, 29 Jan 2024 21:17:11 +0100 Subject: [PATCH 116/147] add abraxxa user --- hieradata/env/production.yaml | 4 ++++ .../metacpan/files/default/home/abraxxa/ssh/authorized_keys | 1 + 2 files changed, 5 insertions(+) create mode 100644 modules/metacpan/files/default/home/abraxxa/ssh/authorized_keys diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 2d3f3211..eef4bdb7 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -140,4 +140,8 @@ metacpan::users: mohawk2: admin : true fullname : "Ed J " + abraxxa: + admin : true + fullname : "Alexander Hartmaier " + no_passwd_sudo : true diff --git a/modules/metacpan/files/default/home/abraxxa/ssh/authorized_keys b/modules/metacpan/files/default/home/abraxxa/ssh/authorized_keys new file mode 100644 index 00000000..08c02286 --- /dev/null +++ b/modules/metacpan/files/default/home/abraxxa/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAhICIg4VoTNMLXLS9NbdyBDTDie2fmmJMpk2Fy+KCNH abraxxa@cpan.org From e083d12e45f70674fa82e3e0e5e41dd1971272bd Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Mon, 29 Jan 2024 17:31:59 -0500 Subject: [PATCH 117/147] Enable account for alh --- hieradata/env/production.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index eef4bdb7..97c944d5 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -114,7 +114,6 @@ metacpan::users: admin : true fullname : "Graham Knop " mhorsfall: - ensure : absent admin : true fullname : "Matthew Horsfall (alh) " ben: From b9262d078a2a8a4b4187756a7051d2bf87f4b0e8 Mon Sep 17 00:00:00 2001 From: Alexander Hartmaier Date: Tue, 30 Jan 2024 21:55:00 +0100 Subject: [PATCH 118/147] fix default_ipaddress for Liquid web data center hosts because the Internet interface is eth2 and docker0 took precedence --- modules/facts/lib/facter/ipaddress.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/facts/lib/facter/ipaddress.rb b/modules/facts/lib/facter/ipaddress.rb index 1ce199ec..f9ca7924 100644 --- a/modules/facts/lib/facter/ipaddress.rb +++ b/modules/facts/lib/facter/ipaddress.rb @@ -4,6 +4,8 @@ Facter.value('ipaddress_eth0') elsif Facter.value('ipaddress_bond0') Facter.value('ipaddress_bond0') + elsif Facter.value('ipaddress_eth2') + Facter.value('ipaddress_eth2') else Facter.value('ipaddress') end From 1869925f895e78908543e7e5b49cce5676b156d1 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 25 Apr 2024 15:26:20 +0100 Subject: [PATCH 119/147] move cronjobs/postgres from bm-01 (having disk issues) to bm-02 --- hieradata/nodes/bm-mc-01.yaml | 61 +++-------------------------------- hieradata/nodes/bm-mc-02.yaml | 59 +++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 58 deletions(-) diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index d6da1bfa..35d45fe9 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -1,71 +1,20 @@ --- classes: - - metacpan_postgres + - metacpan_postgres::install_only + - metacpan_postgres::pgpass - minion_queue minion_queue::service::workers: 4 minion_queue::service::ensure: running minion_queue::service::enable: true -# We want watcher enabled -metacpan::watcher::enable: true +# Enabled on 02 now +metacpan::watcher::enable: false metacpan::crons::general: user_data_index_backups: ensure : absent import_authors: - ensure : present + ensure : absent metacpan_sitemaps: minute : 5 - -metacpan::crons::api: - snapshot_cover_index: - ensure : present - snapshot_contributor_index: - ensure : present - snapshot_cpan_index: - ensure : present - snapshot_user_index: - ensure : present - snapshot_purge_old: - ensure : present - ratings: - ensure : absent - cpantesters: - ensure : present - latest: - ensure : present - backup_purge: - ensure : present - session: - ensure : present - release: - ensure : present - package: - ensure : present - package_cleanup: - ensure : present - permission: - ensure : present - permission_cleanup: - ensure : present - tickets: - ensure : present - river: - ensure : present - external_cygwin: - ensure : present -# external_debian: -# ensure : present - contributor_daily: - ensure : present - contributor_weekly: - ensure : present - favorite_hourly: - ensure : present - favorite_weekly: - ensure : present - cover_full: - ensure : present - cve_hourly: - ensure : present diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index ba72d245..ca166dbe 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -1,7 +1,6 @@ --- classes: - - metacpan_postgres::install_only - - metacpan_postgres::pgpass + - metacpan_postgres - minion_queue minion_queue::service::workers: 5 @@ -18,3 +17,59 @@ metacpan::users: metacpan::crons::general: metacpan_sitemaps: minute : 10 + user_data_index_backups: + ensure : absent + import_authors: + ensure : present + +metacpan::crons::api: + snapshot_cover_index: + ensure : present + snapshot_contributor_index: + ensure : present + snapshot_cpan_index: + ensure : present + snapshot_user_index: + ensure : present + snapshot_purge_old: + ensure : present + ratings: + ensure : absent + cpantesters: + ensure : present + latest: + ensure : present + backup_purge: + ensure : present + session: + ensure : present + release: + ensure : present + package: + ensure : present + package_cleanup: + ensure : present + permission: + ensure : present + permission_cleanup: + ensure : present + tickets: + ensure : present + river: + ensure : present + external_cygwin: + ensure : present +# external_debian: +# ensure : present + contributor_daily: + ensure : present + contributor_weekly: + ensure : present + favorite_hourly: + ensure : present + favorite_weekly: + ensure : present + cover_full: + ensure : present + cve_hourly: + ensure : present From 86638f7aadacb0f07689becd644cb18e6aaf1331 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 25 Apr 2024 15:51:53 +0100 Subject: [PATCH 120/147] stop puppet moaning about unknown value we do not care about --- modules/metacpan_postgres/manifests/firewall.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/metacpan_postgres/manifests/firewall.pp b/modules/metacpan_postgres/manifests/firewall.pp index ac9fe5c5..f444a8a2 100644 --- a/modules/metacpan_postgres/manifests/firewall.pp +++ b/modules/metacpan_postgres/manifests/firewall.pp @@ -10,7 +10,7 @@ # outside of this. $local_net.each |$source| { - firewall{ "600 Postgres ${source} - ${name} (${module})": + firewall{ "600 Postgres ${source} - ${name}": ensure => present, dport => [ $port ], proto => tcp, From f46d1de46f89e65f2c54141363a0b4f1e98ce843 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 25 Apr 2024 16:01:03 +0100 Subject: [PATCH 121/147] Add the watcher as enabled on 02 --- hieradata/nodes/bm-mc-02.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index ca166dbe..61b122b3 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -7,6 +7,9 @@ minion_queue::service::workers: 5 minion_queue::service::ensure: running minion_queue::service::enable: true +# we do want this running +metacpan::watcher::enable: true + metacpan::users: toddr: admin: true From e55e2381c77805c862b77e37fa1e9b8ad5614ba0 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Thu, 25 Apr 2024 16:30:32 +0100 Subject: [PATCH 122/147] Stop trying to run metacpan-web - now in k8 and incompatible --- hieradata/common.yaml | 16 ---------------- hieradata/env/production.yaml | 4 ---- hieradata/nodes/bm-mc-03.yaml | 5 ----- 3 files changed, 25 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index bbfec8d0..cb9c38e6 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -112,22 +112,6 @@ metacpan::logstash::status: disabled metacpan::web::starman: - metacpan-web: - git_source: 'https://github.com/metacpan/metacpan-web.git' - git_revision: 'master' - vhost_ssl_only: true - vhost_bare: true - vhost_aliases: - - 'v1.metacpan.org' - - 'metacpan.org' - - "lo.metacpan.org" - - "%{hostname}.metacpan.org" - starman_port: 5001 - starman_workers: 3 - vhost_extra_configs: - trailing_slash_rewrite: - template: 'trailing_slash' - metacpan-api: git_source: 'https://github.com/metacpan/metacpan-api.git' git_revision: 'master' diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 97c944d5..05e77a7d 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -31,10 +31,6 @@ metacpan::crons::general: metacpan::web::starman: - metacpan-web: - git_enable: true - starman_workers: 10 - metacpan-api: git_enable: true starman_workers: 14 diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index f2afef56..1d4d3a43 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -31,8 +31,3 @@ metacpan::crons::general: user: "%{hiera('metacpan::user')}" ensure : present -# Use this to run stage branch if required -# metacpan::web::starman: -# metacpan-web: -# git_revision: 'stage' - From dbeff1cde508d946c163efe76e18e6732d1b1234 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 25 Apr 2024 17:55:00 +0100 Subject: [PATCH 123/147] Don't try to create metacpan_web_local.conf --- modules/metacpan/manifests/web/production.pp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/metacpan/manifests/web/production.pp b/modules/metacpan/manifests/web/production.pp index b4d124ab..0fc8e129 100644 --- a/modules/metacpan/manifests/web/production.pp +++ b/modules/metacpan/manifests/web/production.pp @@ -12,15 +12,6 @@ require => Metacpan::Gitrepo['gitrepo_metacpan-explorer'], # after repo created } - file { "/home/${user}/metacpan-web/metacpan_web_local.conf": - ensure => file, - owner => $user, - group => $group, - source => "puppet:///private/metacpan-web/metacpan_web_local.conf", - require => Metacpan::Gitrepo['gitrepo_metacpan-web'], # after repo created - notify => Starman::Service['metacpan-web'], - } - file { "/home/${user}/metacpan-api/metacpan_server_local.conf": ensure => file, owner => $user, From 6dc9129b71f287f1df1e22250e8de21ba1a5bf83 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 25 Apr 2024 17:56:03 +0100 Subject: [PATCH 124/147] Make Pg password available on bm-mc-02 --- hieradata/nodes/bm-mc-02.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index 61b122b3..aa39dab8 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -1,6 +1,7 @@ --- classes: - metacpan_postgres + - metacpan_postgres::pgpass - minion_queue minion_queue::service::workers: 5 From e008ea7c7a8e02c587e9006c1ee8133e47ab4b3d Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 7 May 2024 05:34:45 +0200 Subject: [PATCH 125/147] remove dead or moved services Remove the remains of metacpan-web, as well as github-meets-cpan and api-v0-shim. They have been removed or moved to kubernetes. --- hieradata/common.yaml | 12 ---------- hieradata/env/production.yaml | 23 -------------------- hieradata/nodes/lw-mc-02.yaml | 9 -------- hieradata/nodes/metacpan-dev.yaml | 6 ----- modules/metacpan/manifests/web.pp | 6 ----- modules/metacpan/manifests/web/production.pp | 10 --------- 6 files changed, 66 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index cb9c38e6..075af832 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -225,18 +225,6 @@ metacpan::crons::general: minute : 22 ensure : absent - metacpan_sitemaps: - cmd : "/home/%{hiera('metacpan::user')}/bin/metacpan-web-carton-exec bin/generate_sitemap.pl" - hour : 2 - minute : 0 - ensure : absent - - github-meets-cpan: - cmd : "/home/%{hiera('metacpan::user')}/bin/github-meets-cpan-carton-exec cron/update.pl" - minute : 20 - hour : 1 - ensure : absent - # NOTE: set to `absent` here - turn on in the node metacpan::crons::api: # Remvoe author - now in wrapper script in general diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 05e77a7d..7f402be5 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -35,29 +35,6 @@ metacpan::web::starman: git_enable: true starman_workers: 14 - api-v0-shim: - git_source: 'https://github.com/metacpan/metacpan-api-v0-shim.git' - git_revision: 'master' - vhost_bare: true - vhost_aliases: - - 'api-v0-shim.metacpan.org' - starman_port: 5003 - git_enable: true - starman_workers: 2 - - github-meets-cpan: - git_enable: true - starman_workers: 1 - git_source: 'https://github.com/metacpan/github-meets-cpan.git' - git_revision: 'master' - vhost_bare: true - vhost_aliases: - - 'gh.metacpan.org' - - "gh.lo.metacpan.org" - - "gh.%{hostname}.metacpan.org" - starman_port: 5002 - starman_workers: 1 - sco-redirect: git_enable: true starman_workers: 10 diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index f5d81960..49bd8480 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -9,10 +9,6 @@ minion_queue::service::ensure: running minion_queue::service::enable: true -metacpan::crons::general: - github-meets-cpan: - ensure : present - metacpan::crons::general: metacpan_sitemaps: minute : 25 @@ -26,8 +22,3 @@ metacpan::web::proxy: - 'hound.metacpan.org' proxy_port: 6080 -metacpan::web::starman: - - github-meets-cpan: - proxy_target_port: 3000 - service_enable: false diff --git a/hieradata/nodes/metacpan-dev.yaml b/hieradata/nodes/metacpan-dev.yaml index ea451a4c..c84d6287 100644 --- a/hieradata/nodes/metacpan-dev.yaml +++ b/hieradata/nodes/metacpan-dev.yaml @@ -40,14 +40,8 @@ metacpan::elasticsearch::env: 'dev' # Open up ports for development metacpan::fw_ports: - metacpan_web: - port: 5001 - source: '0.0.0.0/0' metacpan_api: port: 5000 source: '0.0.0.0/0' - github-meets-cpan: - port: 5002 - source: '0.0.0.0/0' starman::config::plack_env: development diff --git a/modules/metacpan/manifests/web.pp b/modules/metacpan/manifests/web.pp index 640935a8..bc53d947 100644 --- a/modules/metacpan/manifests/web.pp +++ b/modules/metacpan/manifests/web.pp @@ -4,10 +4,4 @@ $group = hiera('metacpan::group', 'metacpan'), ) { - file { "/home/${user}/metacpan-web/root/static/sitemaps": - ensure => directory, - owner => $user, - group => $group, - } - } diff --git a/modules/metacpan/manifests/web/production.pp b/modules/metacpan/manifests/web/production.pp index 0fc8e129..22b3be8b 100644 --- a/modules/metacpan/manifests/web/production.pp +++ b/modules/metacpan/manifests/web/production.pp @@ -21,14 +21,4 @@ notify => Starman::Service['metacpan-api'], } - file { "/home/${user}/github-meets-cpan/environment.json": - ensure => file, - owner => $user, - group => $group, - source => "puppet:///private/github-meets-cpan/environment.json", - require => Metacpan::Gitrepo['gitrepo_github-meets-cpan'], # after repo created - notify => Starman::Service['github-meets-cpan'], - } - - } From 39049bda9178aa9f20c3096b80f16a176f8a2667 Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sat, 8 Jun 2024 16:20:12 +0100 Subject: [PATCH 126/147] Remove all traces of sitemap Follows on from https://github.com/metacpan/metacpan-puppet/pull/244/commits/e008ea7c7a8e02c587e9006c1ee8133e47ab4b3d which didn't get these edge cases --- hieradata/env/production.yaml | 2 -- hieradata/nodes/bm-mc-01.yaml | 2 -- hieradata/nodes/bm-mc-02.yaml | 2 -- hieradata/nodes/bm-mc-03.yaml | 2 -- hieradata/nodes/bm-mc-04.yaml | 3 --- hieradata/nodes/lw-mc-01.yaml | 4 ---- hieradata/nodes/lw-mc-02.yaml | 4 ---- hieradata/nodes/lw-mc-03.yaml | 2 -- 8 files changed, 21 deletions(-) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 7f402be5..567d6ac6 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -26,8 +26,6 @@ metacpan::crons::general: ensure : present run_puppet: ensure : present - metacpan_sitemaps: - ensure : present metacpan::web::starman: diff --git a/hieradata/nodes/bm-mc-01.yaml b/hieradata/nodes/bm-mc-01.yaml index 35d45fe9..34424873 100644 --- a/hieradata/nodes/bm-mc-01.yaml +++ b/hieradata/nodes/bm-mc-01.yaml @@ -16,5 +16,3 @@ metacpan::crons::general: ensure : absent import_authors: ensure : absent - metacpan_sitemaps: - minute : 5 diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index aa39dab8..ee9619a8 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -19,8 +19,6 @@ metacpan::users: fullname : "Atoomic " metacpan::crons::general: - metacpan_sitemaps: - minute : 10 user_data_index_backups: ensure : absent import_authors: diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 1d4d3a43..5d90d859 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -22,8 +22,6 @@ rsyslog::extra_modules: - "omprog" metacpan::crons::general: - metacpan_sitemaps: - minute : 15 backup_cpancover: cmd : "rsync -q -a -e 'ssh -i ~/.ssh/cpancover' metacpan@cpancover.com:/cover/staging /mnt/lv-cpancover-html/ >/dev/null 2>&1" diff --git a/hieradata/nodes/bm-mc-04.yaml b/hieradata/nodes/bm-mc-04.yaml index 3a1f25d4..58a236b0 100644 --- a/hieradata/nodes/bm-mc-04.yaml +++ b/hieradata/nodes/bm-mc-04.yaml @@ -8,6 +8,3 @@ minion_queue::service::workers: 5 minion_queue::service::ensure: running minion_queue::service::enable: true -metacpan::crons::general: - metacpan_sitemaps: - minute : 35 diff --git a/hieradata/nodes/lw-mc-01.yaml b/hieradata/nodes/lw-mc-01.yaml index 87f89b42..a645ba33 100644 --- a/hieradata/nodes/lw-mc-01.yaml +++ b/hieradata/nodes/lw-mc-01.yaml @@ -10,7 +10,3 @@ classes: minion_queue::service::workers: 10 minion_queue::service::ensure: running minion_queue::service::enable: true - -metacpan::crons::general: - metacpan_sitemaps: - minute : 20 diff --git a/hieradata/nodes/lw-mc-02.yaml b/hieradata/nodes/lw-mc-02.yaml index 49bd8480..0af6270c 100644 --- a/hieradata/nodes/lw-mc-02.yaml +++ b/hieradata/nodes/lw-mc-02.yaml @@ -9,10 +9,6 @@ minion_queue::service::ensure: running minion_queue::service::enable: true -metacpan::crons::general: - metacpan_sitemaps: - minute : 25 - metacpan::web::proxy: metacpan-hound: diff --git a/hieradata/nodes/lw-mc-03.yaml b/hieradata/nodes/lw-mc-03.yaml index 2d0d68dd..b41a579c 100644 --- a/hieradata/nodes/lw-mc-03.yaml +++ b/hieradata/nodes/lw-mc-03.yaml @@ -22,8 +22,6 @@ metacpan::crons::general: ensure : present import_authors: ensure : present - metacpan_sitemaps: - minute : 30 metacpan::crons::api: snapshot_cpan_index: From dde6797e5e5fb92d17285c2a77905eae2488f493 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 30 Sep 2024 11:03:36 +0200 Subject: [PATCH 127/147] fix elasticsearch log file rotation Without quotes, the generated names end up looking like `bm.log< ".2023-08-29"` --- .../elasticsearch/templates/etc/elasticsearch/logging.yml.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib-modules/elasticsearch/templates/etc/elasticsearch/logging.yml.erb b/contrib-modules/elasticsearch/templates/etc/elasticsearch/logging.yml.erb index 795fa78a..9679aa36 100644 --- a/contrib-modules/elasticsearch/templates/etc/elasticsearch/logging.yml.erb +++ b/contrib-modules/elasticsearch/templates/etc/elasticsearch/logging.yml.erb @@ -35,7 +35,7 @@ appender: type: <%= @file_rolling_type %> file: ${path.logs}/${cluster.name}.log <%- if @file_rolling_type == 'dailyRollingFile' -%> - datePattern: <%= @daily_rolling_date_pattern %> + datePattern: "<%= @daily_rolling_date_pattern %>" <%- elsif @file_rolling_type == 'rollingFile' -%> maxBackupIndex: <%= @rolling_file_max_backup_index %> maxFileSize: <%= @rolling_file_max_file_size %> From 159c6dd8954e423a53c5427bc41bdcaf24b3f211 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 30 Sep 2024 22:36:27 +0200 Subject: [PATCH 128/147] run the metacpan-api app.psgi, not the api.pl Currently, metacpan-api has an app.psgi for the Catalyst app. This has most of the end points. There is also an api.pl script which runs Mojolicious. This hosts a Minion admin interface, a few end points which are duplicates of the Catalyst end points, and mounts the app.psgi to handle everything else. This setup uses the Mojolicious MountPSGI plugin. This plugin is rather limited and has some issues. It ends up loading the PSGI app the first time it is requested. This means in a prefork setup, none of the memory is shared. This is wasteful, but also means creating worker processes is very slow. And if it is slow enough, the worker won't respond to the heartbeat check, and the parent process will kill it before it is even ready. The problems with MountPSGI could be fixed, but the Mojolicious app is also just adding complexity without providing any real value in its current state. The end points it provides are duplicates. We aren't using the Minion integration to dispatch tasks anywhere in the API. And its admin interface doesn't really belong in the same service as the API server. Simplify the way metacpan-api is hosted by just running the Catalyst app. This avoids the problems with the MountPSGI plugin. Replacing the Minion admin interface is a task left for a different time. Using Mojolicous in the future would be reasonable, but it should be done as a proper conversion. --- hieradata/common.yaml | 2 +- hieradata/env/production.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 075af832..0b5af13f 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -125,7 +125,7 @@ metacpan::web::starman: - "st.aticpan.org" starman_port: 5000 starman_workers: 2 - starman_init_template: 'starman/init.api.erb' + starman_init_template: 'starman/init.pl.erb' vhost_extra_proxies: proxy_cpan_index: location: '/v1/cpan' diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 567d6ac6..75691ab9 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -31,7 +31,7 @@ metacpan::web::starman: metacpan-api: git_enable: true - starman_workers: 14 + starman_workers: 30 sco-redirect: git_enable: true From 13e796a70706f0cdd9a3423ef0bddf9c60db4114 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 30 Sep 2024 23:54:58 +0200 Subject: [PATCH 129/147] remove search.cpan.org redirector It has been moved to k8s. It can be manually cleaned up from the servers. --- hieradata/env/production.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 567d6ac6..9b54a12a 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -33,22 +33,6 @@ metacpan::web::starman: git_enable: true starman_workers: 14 - sco-redirect: - git_enable: true - starman_workers: 10 - git_source: 'https://github.com/metacpan/sco-redirect.git' - git_revision: 'master' - vhost_bare: true - vhost_aliases: - - 'search.cpan.org' - - "cpansearch.perl.org" # not fastly - - 'sco.metacpan.org' - - "sco.lo.metacpan.org" - - "sco.%{hostname}.metacpan.org" - - ".mcpan.org" - starman_port: 5005 - - metacpan::web::static: metacpan-explorer: git_enable: true From ee0757f163ed80f9fa58e092a65c004e0efbede7 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 1 Oct 2024 00:02:15 +0200 Subject: [PATCH 130/147] remove file_concat module It was a dependency of the logstash module, but it isn't anymore. The module is out of date, so just remove it rather than updating it. --- bin/install-modules.sh | 1 - contrib-modules/file_concat/CHANGELOG.md | 64 ---- contrib-modules/file_concat/Gemfile | 22 -- contrib-modules/file_concat/Gemfile.lock | 353 ------------------ contrib-modules/file_concat/LICENSE | 15 - contrib-modules/file_concat/Modulefile | 8 - contrib-modules/file_concat/README.md | 50 --- contrib-modules/file_concat/checksums.json | 61 --- .../lib/puppet/provider/file_concat.rb | 32 -- .../lib/puppet/provider/file_concat/posix.rb | 8 - .../puppet/provider/file_concat/windows.rb | 8 - .../lib/puppet/type/file_concat.rb | 161 -------- .../lib/puppet/type/file_fragment.rb | 47 --- .../log/2015-03-18_00_35_41/sut.log | 2 - .../log/2015-03-18_00_39_07/sut.log | 2 - .../log/2015-03-18_00_45_00/sut.log | 2 - .../log/2015-03-18_01_09_54/sut.log | 2 - .../log/2015-03-18_01_41_55/sut.log | 2 - .../log/2015-03-18_17_42_16/sut.log | 2 - .../log/2015-03-18_17_50_12/sut.log | 2 - .../log/2015-03-18_17_55_18/sut.log | 2 - .../log/2015-03-18_18_13_04/sut.log | 2 - .../log/2015-03-18_18_23_51/sut.log | 0 .../log/2015-03-18_18_27_03/sut.log | 1 - .../log/2015-03-18_18_37_20/sut.log | 2 - .../log/2015-03-18_20_04_23/sut.log | 2 - .../log/2015-03-18_20_15_16/sut.log | 2 - .../log/2015-03-18_20_42_00/sut.log | 2 - .../log/2015-03-18_20_50_08/sut.log | 2 - .../log/2015-03-18_20_59_53/sut.log | 2 - .../log/2015-03-18_21_27_02/sut.log | 2 - .../log/2015-03-18_21_35_20/sut.log | 2 - .../log/2015-03-18_21_44_16/sut.log | 2 - .../log/2015-03-18_21_56_31/sut.log | 2 - .../log/2015-03-23_10_50_54/sut.log | 2 - .../log/2015-03-23_11_04_06/sut.log | 2 - .../log/2015-03-23_11_13_16/sut.log | 2 - .../log/2015-03-23_11_17_28/sut.log | 2 - .../log/2015-03-23_11_26_46/sut.log | 2 - .../log/2015-03-23_12_55_57/sut.log | 2 - .../log/2015-03-23_13_09_27/sut.log | 2 - .../log/2015-03-23_13_14_16/sut.log | 2 - .../centos-6-x64/2015-03-25_11_02_28/sut.log | 0 .../centos-6-x64/2015-03-25_11_03_01/sut.log | 2 - .../centos-6-x64/2015-03-25_16_36_05/sut.log | 0 .../centos-6-x64/2015-03-25_16_38_13/sut.log | 0 .../centos-6-x64/2015-03-25_17_11_33/sut.log | 2 - .../centos-6-x64/2015-03-26_12_29_34/sut.log | 2 - .../debian-7-x64/2015-03-25_14_17_32/sut.log | 0 .../debian-7-x64/2015-03-25_14_19_41/sut.log | 0 .../debian-7-x64/2015-03-25_14_28_39/sut.log | 2 - .../debian-7-x64/2015-03-25_14_37_14/sut.log | 1 - .../debian-7-x64/2015-03-25_14_46_35/sut.log | 1 - .../debian-7-x64/2015-03-25_16_11_35/sut.log | 1 - .../debian-7-x64/2015-03-25_16_19_02/sut.log | 1 - .../debian-7-x64/2015-03-25_16_21_36/sut.log | 2 - .../2015-03-26_12_43_00/sut.log | 2 - .../2015-03-26_12_49_39/sut.log | 2 - .../2015-03-26_13_13_31/sut.log | 2 - .../2015-03-25_16_26_15/sut.log | 2 - contrib-modules/file_concat/metadata.json | 88 ----- 61 files changed, 995 deletions(-) delete mode 100644 contrib-modules/file_concat/CHANGELOG.md delete mode 100644 contrib-modules/file_concat/Gemfile delete mode 100644 contrib-modules/file_concat/Gemfile.lock delete mode 100644 contrib-modules/file_concat/LICENSE delete mode 100644 contrib-modules/file_concat/Modulefile delete mode 100644 contrib-modules/file_concat/README.md delete mode 100644 contrib-modules/file_concat/checksums.json delete mode 100644 contrib-modules/file_concat/lib/puppet/provider/file_concat.rb delete mode 100644 contrib-modules/file_concat/lib/puppet/provider/file_concat/posix.rb delete mode 100644 contrib-modules/file_concat/lib/puppet/provider/file_concat/windows.rb delete mode 100644 contrib-modules/file_concat/lib/puppet/type/file_concat.rb delete mode 100644 contrib-modules/file_concat/lib/puppet/type/file_fragment.rb delete mode 100644 contrib-modules/file_concat/log/2015-03-18_00_35_41/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_00_39_07/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_00_45_00/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_01_09_54/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_01_41_55/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_17_42_16/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_17_50_12/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_17_55_18/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_18_13_04/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_18_23_51/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_18_27_03/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_18_37_20/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_20_04_23/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_20_15_16/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_20_42_00/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_20_50_08/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_20_59_53/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_21_27_02/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_21_35_20/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_21_44_16/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-18_21_56_31/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_10_50_54/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_11_04_06/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_11_13_16/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_11_17_28/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_11_26_46/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_12_55_57/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_13_09_27/sut.log delete mode 100644 contrib-modules/file_concat/log/2015-03-23_13_14_16/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_02_28/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_03_01/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_36_05/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_38_13/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-25_17_11_33/sut.log delete mode 100644 contrib-modules/file_concat/log/centos-6-x64/2015-03-26_12_29_34/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_17_32/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_19_41/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_28_39/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_37_14/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_46_35/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_11_35/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_19_02/sut.log delete mode 100644 contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_21_36/sut.log delete mode 100644 contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_43_00/sut.log delete mode 100644 contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_49_39/sut.log delete mode 100644 contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_13_13_31/sut.log delete mode 100644 contrib-modules/file_concat/log/ubuntu-server-1404-x64/2015-03-25_16_26_15/sut.log delete mode 100644 contrib-modules/file_concat/metadata.json diff --git a/bin/install-modules.sh b/bin/install-modules.sh index 3386c90d..5b003fae 100755 --- a/bin/install-modules.sh +++ b/bin/install-modules.sh @@ -16,7 +16,6 @@ $PUPPET elastic-elasticsearch $PUPPET elastic-elastic_stack # elastic-logstash $PUPPET puppet-tea # elastic-elasticsearch $PUPPET richardc-datacat -$PUPPET ispavailability-file_concat $PUPPET elastic-logstash $PUPPET saz-rsyslog $PUPPET bashtoni-timezone diff --git a/contrib-modules/file_concat/CHANGELOG.md b/contrib-modules/file_concat/CHANGELOG.md deleted file mode 100644 index ffa6f5dc..00000000 --- a/contrib-modules/file_concat/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -##0.3.0 ( Mar 26, 2015 ) - -###Summary -This release adds windows support to the library. - -####Features -* Added windows support to the library. - -####Bugfixes - -####Changes - -####Testing changes - -####Known bugs - -##0.2.1 ( Mar 25, 2015 ) - -###Summary -Bugfix release - -####Features - -####Bugfixes -* Fix a bug caused by some refactoring - -####Changes - -####Testing changes - -####Known bugs -* Windows is not supported yet - -##0.2.0 ( Mar 25, 2015 ) - -###Summary -With this release Ive done several code cleanups and added some basic tests. -Also support for puppet-server has been fixed - -####Features - -####Bugfixes -* Remove unnecessary require which fixed support for puppet-server - -####Changes -* Added some basic files -* Implemented rubocop for style checking - -####Testing changes -* Implemented basic acceptance tests - -####Known bugs -* Windows is not supported yet - -##0.1.0 ( Jan 21, 2014 ) - Rewrite of the fragment ordering part. - Fragments are now first ordered based on the order number and then on the resource name. - Convert `order` parameter to string to support integer values when using Hiera/YAML ( PR#3 by Michael G. Noll ) - -##0.0.2 ( Mar 03, 2013 ) - Adding source variable option to file_fragment type - -##0.0.1 ( Jan 13, 2013 ) - Initial release of the module diff --git a/contrib-modules/file_concat/Gemfile b/contrib-modules/file_concat/Gemfile deleted file mode 100644 index b7684251..00000000 --- a/contrib-modules/file_concat/Gemfile +++ /dev/null @@ -1,22 +0,0 @@ -source 'https://rubygems.org/' - -puppetversion = ENV['PUPPET_VERSION'] || '~> 3.7.0' -gem 'puppet', puppetversion, :require => false - -gem 'beaker', :git => 'git@github.com:puppetlabs/beaker.git', :branch => 'master' -gem 'beaker-rspec', :git => 'git@github.com:puppetlabs/beaker-rspec.git', :branch => 'master' -gem 'metadata-json-lint', :git => 'https://github.com/nibalizer/metadata-json-lint.git', :branch => 'master' -gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git', :branch => 'master' - -gem 'pry' -gem 'docker-api', '~> 1.0' -gem 'rubysl-securerandom' -gem 'ci_reporter_rspec' -gem 'rspec', '~> 3.0' -gem 'rake' -gem 'puppet-doc-lint' -gem 'puppet-lint' -gem 'puppetlabs_spec_helper' -gem 'puppet-syntax' -gem 'rspec-puppet-facts' -gem 'webmock' diff --git a/contrib-modules/file_concat/Gemfile.lock b/contrib-modules/file_concat/Gemfile.lock deleted file mode 100644 index 07763183..00000000 --- a/contrib-modules/file_concat/Gemfile.lock +++ /dev/null @@ -1,353 +0,0 @@ -GIT - remote: git@github.com:puppetlabs/beaker-rspec.git - revision: c4c43fd726c4910f38585c30177f088596ce1872 - branch: master - specs: - beaker-rspec (5.0.1) - beaker (~> 2.0) - rspec - serverspec (~> 2) - specinfra (~> 2) - -GIT - remote: git@github.com:puppetlabs/beaker.git - revision: 0ac1460dc3af4d4e10062333c8d931351157d71d - branch: master - specs: - beaker (2.7.1) - aws-sdk (~> 1.57) - docker-api - fission (~> 0.4) - fog (~> 1.25) - google-api-client (~> 0.8) - hocon (~> 0.0.4) - inifile (~> 2.0) - json (~> 1.8) - minitest (~> 5.4) - net-scp (~> 1.2) - net-ssh (~> 2.9) - rbvmomi (~> 1.8) - rsync (~> 1.0.9) - unf (~> 0.1) - -GIT - remote: https://github.com/nibalizer/metadata-json-lint.git - revision: c2225fed4b88aef1945e8da3f8580709939371cd - branch: master - specs: - metadata-json-lint (0.0.6) - json - spdx-licenses (~> 1.0) - -GIT - remote: https://github.com/rodjek/rspec-puppet.git - revision: a9a837669cf6955279f02d1d9b524dc140b9d3e8 - branch: master - specs: - rspec-puppet (2.0.1) - rspec - -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (2.3.1) - activesupport (7.0.7.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - aws-sdk (1.63.0) - aws-sdk-v1 (= 1.63.0) - aws-sdk-v1 (1.63.0) - json (~> 1.4) - nokogiri (>= 1.4.4) - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) - builder (3.2.2) - ci_reporter (2.0.0) - builder (>= 2.1.2) - ci_reporter_rspec (1.0.0) - ci_reporter (~> 2.0) - rspec (>= 2.14, < 4) - coderay (1.1.0) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - concurrent-ruby (1.2.2) - crack (0.4.2) - safe_yaml (~> 1.0.0) - declarative (0.0.20) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - diff-lcs (1.2.5) - docker-api (1.20.0) - excon (>= 0.38.0) - json - equalizer (0.0.11) - excon (0.71.0) - facter (2.5.7) - faraday (2.3.0) - faraday-net_http (~> 2.0) - ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.3) - fission (0.5.0) - CFPropertyList (~> 2.2) - fog (1.28.0) - fog-atmos - fog-aws (~> 0.0) - fog-brightbox (~> 0.4) - fog-core (~> 1.27, >= 1.27.3) - fog-ecloud - fog-json - fog-profitbricks - fog-radosgw (>= 0.0.2) - fog-riakcs - fog-sakuracloud (>= 0.0.4) - fog-serverlove - fog-softlayer - fog-storm_on_demand - fog-terremark - fog-vmfusion - fog-voxel - fog-xml (~> 0.1.1) - ipaddress (~> 0.5) - nokogiri (~> 1.5, >= 1.5.11) - fog-atmos (0.1.0) - fog-core - fog-xml - fog-aws (0.1.1) - fog-core (~> 1.27) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-brightbox (0.7.1) - fog-core (~> 1.22) - fog-json - inflecto (~> 0.0.2) - fog-core (1.29.0) - builder - excon (~> 0.38) - formatador (~> 0.2) - mime-types - net-scp (~> 1.1) - net-ssh (>= 2.1.3) - fog-ecloud (0.0.2) - fog-core - fog-xml - fog-json (1.0.0) - multi_json (~> 1.0) - fog-profitbricks (0.0.2) - fog-core - fog-xml - nokogiri - fog-radosgw (0.0.3) - fog-core (>= 1.21.0) - fog-json - fog-xml (>= 0.0.1) - fog-riakcs (0.1.0) - fog-core - fog-json - fog-xml - fog-sakuracloud (1.0.0) - fog-core - fog-json - fog-serverlove (0.1.1) - fog-core - fog-json - fog-softlayer (0.4.1) - fog-core - fog-json - fog-storm_on_demand (0.1.0) - fog-core - fog-json - fog-terremark (0.0.4) - fog-core - fog-xml - fog-vmfusion (0.0.1) - fission - fog-core - fog-voxel (0.0.2) - fog-core - fog-xml - fog-xml (0.1.1) - fog-core - nokogiri (~> 1.5, >= 1.5.11) - formatador (0.2.5) - gems (1.2.0) - google-api-client (0.53.0) - google-apis-core (~> 0.1) - google-apis-generator (~> 0.1) - google-apis-core (0.7.0) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-discovery_v1 (0.11.0) - google-apis-core (>= 0.7, < 2.a) - google-apis-generator (0.9.0) - activesupport (>= 5.0) - gems (~> 1.2) - google-apis-core (>= 0.7, < 2.a) - google-apis-discovery_v1 (~> 0.5) - thor (>= 0.20, < 2.a) - googleauth (1.2.0) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - hiera (1.3.4) - json_pure - hocon (0.0.7) - httpclient (2.8.3) - i18n (1.14.1) - concurrent-ruby (~> 1.0) - ice_nine (0.11.1) - inflecto (0.0.2) - inifile (2.0.2) - ipaddress (0.8.0) - json (1.8.6) - json_pure (1.8.2) - jwt (2.4.1) - memoist (0.16.2) - metaclass (0.0.4) - method_source (0.8.2) - mime-types (2.4.3) - mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.19.0) - mocha (1.1.0) - metaclass (~> 0.0.1) - multi_json (1.15.0) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (2.9.2) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - os (1.1.4) - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - public_suffix (4.0.7) - puppet (3.7.4) - facter (> 1.6, < 3) - hiera (~> 1.0) - json_pure - puppet-doc-lint (0.3.0) - facter - puppet - rdoc (>= 3.12, < 4.0) - virtus (~> 1.0.1) - puppet-lint (1.1.0) - puppet-syntax (2.0.0) - rake - puppetlabs_spec_helper (0.10.1) - mocha - puppet-lint - puppet-syntax - rake - rspec-puppet - racc (1.6.2) - rake (12.3.3) - rbvmomi (1.8.2) - builder - nokogiri (>= 1.4.1) - trollop - rdoc (3.12.2) - json (~> 1.4) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.5) - rspec (3.2.0) - rspec-core (~> 3.2.0) - rspec-expectations (~> 3.2.0) - rspec-mocks (~> 3.2.0) - rspec-core (3.2.2) - rspec-support (~> 3.2.0) - rspec-expectations (3.2.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) - rspec-its (1.2.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.2.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) - rspec-puppet-facts (0.6.0) - facter - json - rspec-support (3.2.2) - rsync (1.0.9) - ruby2_keywords (0.0.5) - rubysl-securerandom (2.0.0) - safe_yaml (1.0.4) - serverspec (2.13.0) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.25) - signet (0.17.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - slop (3.6.0) - spdx-licenses (1.0.0) - json - specinfra (2.26.1) - net-scp - net-ssh - thor (1.2.1) - thread_safe (0.3.6) - trailblazer-option (0.1.2) - trollop (2.1.2) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.6) - virtus (1.0.5) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) - webmock (1.20.4) - addressable (>= 2.3.6) - crack (>= 0.3.2) - webrick (1.7.0) - -PLATFORMS - ruby - -DEPENDENCIES - beaker! - beaker-rspec! - ci_reporter_rspec - docker-api (~> 1.0) - metadata-json-lint! - pry - puppet (~> 3.7.0) - puppet-doc-lint - puppet-lint - puppet-syntax - puppetlabs_spec_helper - rake - rspec (~> 3.0) - rspec-puppet! - rspec-puppet-facts - rubysl-securerandom - webmock diff --git a/contrib-modules/file_concat/LICENSE b/contrib-modules/file_concat/LICENSE deleted file mode 100644 index 42bb34ba..00000000 --- a/contrib-modules/file_concat/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -Copyright (c) 2013-2015 Richard Pijnenbug -Copyright (c) 2012 Simon Effenberg -Copyright (c) 2012 Uwe Stuehler - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/contrib-modules/file_concat/Modulefile b/contrib-modules/file_concat/Modulefile deleted file mode 100644 index 75df0bd1..00000000 --- a/contrib-modules/file_concat/Modulefile +++ /dev/null @@ -1,8 +0,0 @@ -name 'ispavailability-file_concat' -version '0.3.0' -source 'https://github.com/electrical/puppet-lib-file_concat' -author 'ispavailability' -license 'Apache License, Version 2.0' -summary 'Library for concatenating different files into 1' -description 'Library for concatenating different files into 1' -project_page 'https://github.com/electrical/puppet-lib-file_concat' diff --git a/contrib-modules/file_concat/README.md b/contrib-modules/file_concat/README.md deleted file mode 100644 index d234c0f7..00000000 --- a/contrib-modules/file_concat/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# puppet-lib-file_concat - -#### Table of Contents - -1. [Overview](#overview) -2. [Usage - Configuration options and additional functionality](#usage) -3. [Limitations - OS compatibility, etc.](#limitations) -4. [Development - Guide for contributing to the module](#development) - -## Overview - -Library for concatenating multiple files into 1. - -## Usage - -### Creating a file fragment - -Creates a file fragment to be collected by file_concat based on the tag. - -Example with exported resource: - - @@file_fragment { "uniqe_name_${::fqdn}": - tag => 'unique_tag', # Mandatory - order => 10, # Optional. Default to 10 - content => 'some content' # OR - content => template('template.erb') # OR - source => 'puppet:///path/to/file' - } - -### Concatenating file fragments into one file - -Gets all the file fragments and puts these into the target file. -This will mostly be used with exported resources. - -example: - - File_fragment <<| tag == 'unique_tag' |>> - - file_concat { '/tmp/file': - tag => 'unique_tag', # Mandatory - path => '/tmp/file', # Optional. If given it overrides the resource name - owner => 'root', # Optional. Default to root - group => 'root', # Optional. Default to root - mode => '0644' # Optional. Default to 0644 - } - -## Limitations - -## Development - diff --git a/contrib-modules/file_concat/checksums.json b/contrib-modules/file_concat/checksums.json deleted file mode 100644 index 7b1ffacf..00000000 --- a/contrib-modules/file_concat/checksums.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "CHANGELOG.md": "e7021ab14ff8b206bde9679c12986541", - "Gemfile": "4be55511a7990290d9693eb8131d3767", - "Gemfile.lock": "7b35e41f2d88fa16baecdef1974cd90f", - "LICENSE": "059fc300cde532dad4e48cf131ad9a89", - "Modulefile": "f6098517bcfa8268b23420b75a5a8014", - "README.md": "c301952bad01fe7b36db5ab6c5091a62", - "lib/puppet/provider/file_concat/posix.rb": "ea625b2d39b5c9cf465c16f255ec4ac8", - "lib/puppet/provider/file_concat/windows.rb": "391be4c58692c4f8e249c01b54424939", - "lib/puppet/provider/file_concat.rb": "8b17e578772685fd31aa5b5c1e795f38", - "lib/puppet/type/file_concat.rb": "849b7a58b659e49f1571f7029d93f7f7", - "lib/puppet/type/file_fragment.rb": "51cf10358174ebc3b4b086120f33f6e9", - "log/2015-03-18_00_35_41/sut.log": "f1af5edb481246a07bfc70f521e33679", - "log/2015-03-18_00_39_07/sut.log": "82144bf68f97fa720db8b243a5941c18", - "log/2015-03-18_00_45_00/sut.log": "358fcb7a8b923bfb33e177aebc2776e3", - "log/2015-03-18_01_09_54/sut.log": "8c97e61d27de900adf72fd321536b087", - "log/2015-03-18_01_41_55/sut.log": "6ece297699914fe9874a2fba433a0b1a", - "log/2015-03-18_17_42_16/sut.log": "6db2ef3246ec2d357f75f400285f7c1e", - "log/2015-03-18_17_50_12/sut.log": "776f5b32c51a9737a6ee1b4123d6b41f", - "log/2015-03-18_17_55_18/sut.log": "5e4ba8cd6e5fdc9e14206011da504631", - "log/2015-03-18_18_13_04/sut.log": "0a8b9d20d09add28f350fb764e3af072", - "log/2015-03-18_18_23_51/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/2015-03-18_18_27_03/sut.log": "7b78ea51873a09e559bd5e93c2495a13", - "log/2015-03-18_18_37_20/sut.log": "299b77a5df223c18c27db3cb03c30a4f", - "log/2015-03-18_20_04_23/sut.log": "86a6584a00bd0328ee9b9761ce7b9503", - "log/2015-03-18_20_15_16/sut.log": "9aa5eeaca87e389068bcd09ba346e2ba", - "log/2015-03-18_20_42_00/sut.log": "4f9847ac4c23a664baf6a935eabe19d7", - "log/2015-03-18_20_50_08/sut.log": "07058438f8a4f429a672d156732657aa", - "log/2015-03-18_20_59_53/sut.log": "e009506c62232050033050c0b2fdeb61", - "log/2015-03-18_21_27_02/sut.log": "7cd3aca765b6fda841a041c601758cc2", - "log/2015-03-18_21_35_20/sut.log": "68063fedb01820e1a5744533fa20c1a2", - "log/2015-03-18_21_44_16/sut.log": "8454b1e0225c23d3aeb94cdf7f3ae92b", - "log/2015-03-18_21_56_31/sut.log": "e2f96ab1ef58e474a955b6a30f45b1d3", - "log/2015-03-23_10_50_54/sut.log": "cafa5c8b3301336d362afe2b15a53eb7", - "log/2015-03-23_11_04_06/sut.log": "9418ded750168e7eae09993f5a09566e", - "log/2015-03-23_11_13_16/sut.log": "031eda5b89a9f02186eb90f14fa37f46", - "log/2015-03-23_11_17_28/sut.log": "06402f09b72bc268df2705bab0864cdd", - "log/2015-03-23_11_26_46/sut.log": "91dd92c3f9002a2e518cb41edb1b43e8", - "log/2015-03-23_12_55_57/sut.log": "d40d5fd0b18e609bb8b63d20e4c5f912", - "log/2015-03-23_13_09_27/sut.log": "8096eae3d3a4560e8cfd7f42c36a79b8", - "log/2015-03-23_13_14_16/sut.log": "794e5b9f20c0b3ef53763787b96d9a5b", - "log/centos-6-x64/2015-03-25_11_02_28/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/centos-6-x64/2015-03-25_11_03_01/sut.log": "aaad5a0d717fb90b47d76652307d2604", - "log/centos-6-x64/2015-03-25_16_36_05/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/centos-6-x64/2015-03-25_16_38_13/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/centos-6-x64/2015-03-25_17_11_33/sut.log": "58a13967e7de564966c020d7ee8e9020", - "log/centos-6-x64/2015-03-26_12_29_34/sut.log": "a5d9ef13764315328c0ecf6af13e1f30", - "log/debian-7-x64/2015-03-25_14_17_32/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/debian-7-x64/2015-03-25_14_19_41/sut.log": "d41d8cd98f00b204e9800998ecf8427e", - "log/debian-7-x64/2015-03-25_14_28_39/sut.log": "2d082d592aae3b36f7b8ea648333c797", - "log/debian-7-x64/2015-03-25_14_37_14/sut.log": "a2c5fa692339e7fce23da14b886dbdfb", - "log/debian-7-x64/2015-03-25_14_46_35/sut.log": "2668d83c81282c27cc8d302f183f772e", - "log/debian-7-x64/2015-03-25_16_11_35/sut.log": "b248b6808bd7f018a273cbf634ca5db6", - "log/debian-7-x64/2015-03-25_16_19_02/sut.log": "f2eb8f96fb6ce8cd3d4beeead2925347", - "log/debian-7-x64/2015-03-25_16_21_36/sut.log": "847edee5372e3b65c00c4756469770c1", - "log/ubuntu-server-1204-x64/2015-03-26_12_43_00/sut.log": "d3214b4070fa65be0d3d97375dfb7345", - "log/ubuntu-server-1204-x64/2015-03-26_12_49_39/sut.log": "6578d513c9fd5fdf60ef5ffbbfb1e626", - "log/ubuntu-server-1204-x64/2015-03-26_13_13_31/sut.log": "35a96353a26ee46f3ac962ffd9f3ec87", - "log/ubuntu-server-1404-x64/2015-03-25_16_26_15/sut.log": "d9bdb284438efcff096c986014674f7f", - "metadata.json": "64de4c277988653e077a2e11d9a89644" -} \ No newline at end of file diff --git a/contrib-modules/file_concat/lib/puppet/provider/file_concat.rb b/contrib-modules/file_concat/lib/puppet/provider/file_concat.rb deleted file mode 100644 index dba2198f..00000000 --- a/contrib-modules/file_concat/lib/puppet/provider/file_concat.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Puppet::Provider::File_concat - def exists? - resource.stat ? true : false - end - - def create - # FIXME: security issue because the file won't necessarily - # be created with the specified mode/owner/group if they - # are specified - send("content=", resource.should_content) - resource.property_fix - end - - def destroy - File.unlink(resource[:path]) if exists? - end - - def content - begin - actual = File.read(resource[:path]) - rescue - nil - end - (actual == resource.should_content) ? resource.no_content : actual - end - - def content=(*) - File.open(resource[:path], 'w') do |fh| - fh.write resource.should_content - end - end -end diff --git a/contrib-modules/file_concat/lib/puppet/provider/file_concat/posix.rb b/contrib-modules/file_concat/lib/puppet/provider/file_concat/posix.rb deleted file mode 100644 index 59e395f4..00000000 --- a/contrib-modules/file_concat/lib/puppet/provider/file_concat/posix.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'puppet/provider/file_concat' - -Puppet::Type.type(:file_concat).provide(:posix, :parent => Puppet::Type.type(:file).provider(:posix)) do - confine :feature => :posix - defaultfor :feature => :posix - - include Puppet::Provider::File_concat -end diff --git a/contrib-modules/file_concat/lib/puppet/provider/file_concat/windows.rb b/contrib-modules/file_concat/lib/puppet/provider/file_concat/windows.rb deleted file mode 100644 index 242ac7fe..00000000 --- a/contrib-modules/file_concat/lib/puppet/provider/file_concat/windows.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'puppet/provider/file_concat' - -Puppet::Type.type(:file_concat).provide(:windows, :parent => Puppet::Type.type(:file).provider(:windows)) do - confine :feature => :windows - defaultfor :feature => :windows - - include Puppet::Provider::File_concat -end diff --git a/contrib-modules/file_concat/lib/puppet/type/file_concat.rb b/contrib-modules/file_concat/lib/puppet/type/file_concat.rb deleted file mode 100644 index c8f16775..00000000 --- a/contrib-modules/file_concat/lib/puppet/type/file_concat.rb +++ /dev/null @@ -1,161 +0,0 @@ -require 'puppet/type/file/owner' -require 'puppet/type/file/group' -require 'puppet/type/file/mode' -require 'puppet/util/checksums' -require 'puppet/type/file/source' - -Puppet::Type.newtype(:file_concat) do - @doc = "Gets all the file fragments and puts these into the target file. - This will mostly be used with exported resources. - - example: - File_fragment <<| tag == 'unique_tag' |>> - - file_concat { '/tmp/file: - tag => 'unique_tag', # Mandatory - path => '/tmp/file', # Optional. If given it overrides the resource name - owner => 'root', # Optional. Default to root - group => 'root', # Optional. Default to root - mode => '0644' # Optional. Default to 0644 - } - " - ensurable do - defaultvalues - - defaultto { :present } - end - - # the file/posix provider will check for the :links property - # which does not exist - def [](value) - return false if value == :links - super - end - - newparam(:name, :namevar => true) do - desc "Resource name" - end - - newparam(:tag) do - desc "Tag reference to collect all file_fragment's with the same tag" - end - - newparam(:path) do - desc "The output file" - defaultto do - resource.value(:name) - end - end - - newproperty(:owner, :parent => Puppet::Type::File::Owner) do - desc "Desired file owner." - defaultto 'root' - end - - newproperty(:group, :parent => Puppet::Type::File::Group) do - desc "Desired file group." - defaultto 'root' - end - - newproperty(:mode, :parent => Puppet::Type::File::Mode) do - desc "Desired file mode." - defaultto '0644' - end - - newproperty(:content) do - desc "Read only attribute. Represents the content." - - include Puppet::Util::Diff - include Puppet::Util::Checksums - - defaultto do - # only be executed if no :content is set - @content_default = true - @resource.no_content - end - - validate do |val| - fail "read-only attribute" unless @content_default - end - - def insync?(is) - result = super - string_file_diff(@resource[:path], @resource.should_content) if result - result - end - - def is_to_s(value) - md5(value) - end - - def should_to_s(value) - md5(value) - end - end - - def no_content - "\0PLEASE_MANAGE_THIS_WITH_FILE_CONCAT\0" - end - - def should_content - return @generated_content if @generated_content - @generated_content = "" - content_fragments = [] - - resources = catalog.resources.select do |r| - r.is_a?(Puppet::Type.type(:file_fragment)) && r[:tag] == self[:tag] - end - - resources.each do |r| - content_fragments << ["#{r[:order]}___#{r[:name]}", fragment_content(r)] - end - - sorted = content_fragments.sort do |a, b| - def decompound(d) - d.split('___').map { |v| v =~ /^\d+$/ ? v.to_i : v } - end - - decompound(a[0]) <=> decompound(b[0]) - end - - @generated_content = sorted.map { |cf| cf[1] }.join - - @generated_content - end - - def fragment_content(r) - if r[:content].nil? == false - fragment_content = r[:content] - elsif r[:source].nil? == false - tmp = Puppet::FileServing::Content.indirection.find(r[:source], :environment => catalog.environment) - fragment_content = tmp.content unless tmp.nil? - end - fragment_content - end - - def stat(*) - return @stat if @stat && !@stat == :needs_stat - @stat = begin - ::File.stat(self[:path]) - rescue Errno::ENOENT - nil - rescue Errno::EACCES - warning "Could not stat; permission denied" - nil - end - end - - ### took from original type/file - # There are some cases where all of the work does not get done on - # file creation/modification, so we have to do some extra checking. - def property_fix - properties.each do |thing| - next unless [:mode, :owner, :group].include?(thing.name) - - # Make sure we get a new stat object - @stat = :needs_stat - currentvalue = thing.retrieve - thing.sync unless thing.safe_insync?(currentvalue) - end - end -end diff --git a/contrib-modules/file_concat/lib/puppet/type/file_fragment.rb b/contrib-modules/file_concat/lib/puppet/type/file_fragment.rb deleted file mode 100644 index 0e54fe85..00000000 --- a/contrib-modules/file_concat/lib/puppet/type/file_fragment.rb +++ /dev/null @@ -1,47 +0,0 @@ -Puppet::Type.newtype(:file_fragment) do - @doc = "Create a file fragment to be used by file_concat. - the `file_fragment` type creates a file fragment to be collected by file_concat based on the tag. - The example is based on exported resources. - - Example: - @@file_fragment { \"uniqe_name_${::fqdn}\": - tag => 'unique_name', - order => 10, # Optional. Default to 10 - content => 'some content' # OR - content => template('template.erb') # OR - source => 'puppet:///path/to/file' - } - " - - newparam(:name, :namevar => true) do - desc "Unique name" - end - - newparam(:content) do - desc "Content" - end - - newparam(:source) do - desc "Source" - end - - newparam(:order) do - desc "Order" - defaultto '10' - validate do |val| - fail Puppet::ParseError, "only integers > 0 are allowed and not '#{val}'" if val.to_s !~ /^\d+$/ - end - end - - newparam(:tag) do - desc "Tag name to be used by file_concat to collect all file_fragments by tag name" - end - - validate do - # Check if either source or content is set. raise error if none is set - fail Puppet::ParseError, "Set either 'source' or 'content'" if self[:source].nil? && self[:content].nil? - - # Check if both are set, if so rais error - fail Puppet::ParseError, "Can't use 'source' and 'content' at the same time" if !self[:source].nil? && !self[:content].nil? - end -end diff --git a/contrib-modules/file_concat/log/2015-03-18_00_35_41/sut.log b/contrib-modules/file_concat/log/2015-03-18_00_35_41/sut.log deleted file mode 100644 index 07b453ff..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_00_35_41/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 00:35:42 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 00:38:06 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_00_39_07/sut.log b/contrib-modules/file_concat/log/2015-03-18_00_39_07/sut.log deleted file mode 100644 index 68816885..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_00_39_07/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 00:39:08 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 00:41:22 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_00_45_00/sut.log b/contrib-modules/file_concat/log/2015-03-18_00_45_00/sut.log deleted file mode 100644 index 088c4520..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_00_45_00/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 00:45:01 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 00:47:25 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_01_09_54/sut.log b/contrib-modules/file_concat/log/2015-03-18_01_09_54/sut.log deleted file mode 100644 index f3a84e37..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_01_09_54/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 01:09:55 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 01:12:18 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_01_41_55/sut.log b/contrib-modules/file_concat/log/2015-03-18_01_41_55/sut.log deleted file mode 100644 index 168361f5..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_01_41_55/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 01:41:57 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 01:44:21 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_17_42_16/sut.log b/contrib-modules/file_concat/log/2015-03-18_17_42_16/sut.log deleted file mode 100644 index 32dd2cea..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_17_42_16/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 17:42:18 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 17:44:35 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_17_50_12/sut.log b/contrib-modules/file_concat/log/2015-03-18_17_50_12/sut.log deleted file mode 100644 index d8879621..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_17_50_12/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 17:50:14 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 17:52:36 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_17_55_18/sut.log b/contrib-modules/file_concat/log/2015-03-18_17_55_18/sut.log deleted file mode 100644 index 3c88d8d3..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_17_55_18/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 17:55:20 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 17:57:57 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_18_13_04/sut.log b/contrib-modules/file_concat/log/2015-03-18_18_13_04/sut.log deleted file mode 100644 index 2e82f21f..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_18_13_04/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 18:13:05 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 18:15:46 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_18_23_51/sut.log b/contrib-modules/file_concat/log/2015-03-18_18_23_51/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/2015-03-18_18_27_03/sut.log b/contrib-modules/file_concat/log/2015-03-18_18_27_03/sut.log deleted file mode 100644 index 5510de21..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_18_27_03/sut.log +++ /dev/null @@ -1 +0,0 @@ -2015-03-18 18:27:04 [+] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_18_37_20/sut.log b/contrib-modules/file_concat/log/2015-03-18_18_37_20/sut.log deleted file mode 100644 index 924aa972..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_18_37_20/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 18:37:22 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 18:40:19 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_20_04_23/sut.log b/contrib-modules/file_concat/log/2015-03-18_20_04_23/sut.log deleted file mode 100644 index 133acae2..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_20_04_23/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 20:04:25 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 20:07:22 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_20_15_16/sut.log b/contrib-modules/file_concat/log/2015-03-18_20_15_16/sut.log deleted file mode 100644 index a10f475b..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_20_15_16/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 20:15:17 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 20:18:13 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_20_42_00/sut.log b/contrib-modules/file_concat/log/2015-03-18_20_42_00/sut.log deleted file mode 100644 index b880785a..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_20_42_00/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 20:42:01 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 20:44:52 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_20_50_08/sut.log b/contrib-modules/file_concat/log/2015-03-18_20_50_08/sut.log deleted file mode 100644 index 56777d28..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_20_50_08/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 20:50:10 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 20:52:51 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_20_59_53/sut.log b/contrib-modules/file_concat/log/2015-03-18_20_59_53/sut.log deleted file mode 100644 index 1653bb17..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_20_59_53/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 20:59:54 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 21:02:47 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_21_27_02/sut.log b/contrib-modules/file_concat/log/2015-03-18_21_27_02/sut.log deleted file mode 100644 index 567bcde0..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_21_27_02/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 21:27:03 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 21:29:56 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_21_35_20/sut.log b/contrib-modules/file_concat/log/2015-03-18_21_35_20/sut.log deleted file mode 100644 index 2eb46572..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_21_35_20/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 21:35:21 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 21:38:31 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_21_44_16/sut.log b/contrib-modules/file_concat/log/2015-03-18_21_44_16/sut.log deleted file mode 100644 index d8f4d5cc..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_21_44_16/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 21:44:18 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 21:47:35 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-18_21_56_31/sut.log b/contrib-modules/file_concat/log/2015-03-18_21_56_31/sut.log deleted file mode 100644 index fe443a66..00000000 --- a/contrib-modules/file_concat/log/2015-03-18_21_56_31/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-18 21:56:32 [+] docker el-6-x86_64 centos-6-x64 -2015-03-18 21:59:49 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_10_50_54/sut.log b/contrib-modules/file_concat/log/2015-03-23_10_50_54/sut.log deleted file mode 100644 index f30bab4b..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_10_50_54/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 10:50:55 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 10:54:08 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_11_04_06/sut.log b/contrib-modules/file_concat/log/2015-03-23_11_04_06/sut.log deleted file mode 100644 index 1766e19a..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_11_04_06/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 11:04:08 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 11:07:34 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_11_13_16/sut.log b/contrib-modules/file_concat/log/2015-03-23_11_13_16/sut.log deleted file mode 100644 index 0eecb770..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_11_13_16/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 11:13:17 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 11:16:34 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_11_17_28/sut.log b/contrib-modules/file_concat/log/2015-03-23_11_17_28/sut.log deleted file mode 100644 index d35581d1..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_11_17_28/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 11:17:29 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 11:20:56 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_11_26_46/sut.log b/contrib-modules/file_concat/log/2015-03-23_11_26_46/sut.log deleted file mode 100644 index 5fbd0383..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_11_26_46/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 11:26:48 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 11:30:08 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_12_55_57/sut.log b/contrib-modules/file_concat/log/2015-03-23_12_55_57/sut.log deleted file mode 100644 index 7c5d9955..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_12_55_57/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 12:55:59 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 12:59:14 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_13_09_27/sut.log b/contrib-modules/file_concat/log/2015-03-23_13_09_27/sut.log deleted file mode 100644 index 2b33748d..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_13_09_27/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 13:09:28 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 13:12:51 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/2015-03-23_13_14_16/sut.log b/contrib-modules/file_concat/log/2015-03-23_13_14_16/sut.log deleted file mode 100644 index 0120a0a7..00000000 --- a/contrib-modules/file_concat/log/2015-03-23_13_14_16/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-23 13:14:17 [+] docker el-6-x86_64 centos-6-x64 -2015-03-23 13:17:34 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_02_28/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_02_28/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_03_01/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_03_01/sut.log deleted file mode 100644 index 88c5f73b..00000000 --- a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_11_03_01/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-25 11:03:02 [+] docker el-6-x86_64 centos-6-x64 -2015-03-25 11:06:25 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_36_05/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_36_05/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_38_13/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_16_38_13/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_17_11_33/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_17_11_33/sut.log deleted file mode 100644 index b2679ff6..00000000 --- a/contrib-modules/file_concat/log/centos-6-x64/2015-03-25_17_11_33/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-25 17:15:20 [+] docker el-6-x86_64 centos-6-x64 -2015-03-25 17:18:59 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/centos-6-x64/2015-03-26_12_29_34/sut.log b/contrib-modules/file_concat/log/centos-6-x64/2015-03-26_12_29_34/sut.log deleted file mode 100644 index 17e42249..00000000 --- a/contrib-modules/file_concat/log/centos-6-x64/2015-03-26_12_29_34/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-26 12:29:50 [+] docker el-6-x86_64 centos-6-x64 -2015-03-26 12:33:21 [-] docker el-6-x86_64 centos-6-x64 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_17_32/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_17_32/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_19_41/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_19_41/sut.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_28_39/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_28_39/sut.log deleted file mode 100644 index b2aeaad3..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_28_39/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-25 14:31:47 [+] docker debian-7-amd64 debian-7 -2015-03-25 14:32:50 [-] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_37_14/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_37_14/sut.log deleted file mode 100644 index ca559f46..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_37_14/sut.log +++ /dev/null @@ -1 +0,0 @@ -2015-03-25 14:37:15 [+] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_46_35/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_46_35/sut.log deleted file mode 100644 index 5b285ad5..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_14_46_35/sut.log +++ /dev/null @@ -1 +0,0 @@ -2015-03-25 14:46:36 [+] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_11_35/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_11_35/sut.log deleted file mode 100644 index 8ccc700d..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_11_35/sut.log +++ /dev/null @@ -1 +0,0 @@ -2015-03-25 16:11:36 [+] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_19_02/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_19_02/sut.log deleted file mode 100644 index 0bbea670..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_19_02/sut.log +++ /dev/null @@ -1 +0,0 @@ -2015-03-25 16:19:03 [+] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_21_36/sut.log b/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_21_36/sut.log deleted file mode 100644 index df3d7ee0..00000000 --- a/contrib-modules/file_concat/log/debian-7-x64/2015-03-25_16_21_36/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-25 16:21:37 [+] docker debian-7-amd64 debian-7 -2015-03-25 16:23:26 [-] docker debian-7-amd64 debian-7 diff --git a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_43_00/sut.log b/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_43_00/sut.log deleted file mode 100644 index 7abdf5b1..00000000 --- a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_43_00/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-26 12:44:58 [+] docker ubuntu-12.04-amd64 ubuntu-12-04 -2015-03-26 12:47:14 [-] docker ubuntu-12.04-amd64 ubuntu-12-04 diff --git a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_49_39/sut.log b/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_49_39/sut.log deleted file mode 100644 index 5547c66b..00000000 --- a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_12_49_39/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-26 12:49:40 [+] docker ubuntu-12.04-amd64 ubuntu-12-04 -2015-03-26 12:52:11 [-] docker ubuntu-12.04-amd64 ubuntu-12-04 diff --git a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_13_13_31/sut.log b/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_13_13_31/sut.log deleted file mode 100644 index 51d59ed7..00000000 --- a/contrib-modules/file_concat/log/ubuntu-server-1204-x64/2015-03-26_13_13_31/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-26 13:13:32 [+] docker ubuntu-12.04-amd64 ubuntu-12-04 -2015-03-26 13:16:04 [-] docker ubuntu-12.04-amd64 ubuntu-12-04 diff --git a/contrib-modules/file_concat/log/ubuntu-server-1404-x64/2015-03-25_16_26_15/sut.log b/contrib-modules/file_concat/log/ubuntu-server-1404-x64/2015-03-25_16_26_15/sut.log deleted file mode 100644 index c033e1b4..00000000 --- a/contrib-modules/file_concat/log/ubuntu-server-1404-x64/2015-03-25_16_26_15/sut.log +++ /dev/null @@ -1,2 +0,0 @@ -2015-03-25 16:31:37 [+] docker ubuntu-14.04-amd64 ubuntu-14-04 -2015-03-25 16:33:55 [-] docker ubuntu-14.04-amd64 ubuntu-14-04 diff --git a/contrib-modules/file_concat/metadata.json b/contrib-modules/file_concat/metadata.json deleted file mode 100644 index 0d3829c9..00000000 --- a/contrib-modules/file_concat/metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "ispavailability-file_concat", - "version": "0.3.0", - "author": "ispavailability", - "summary": "Library for concatenating different files into 1", - "license": "Apache License, Version 2.0", - "source": "https://github.com/electrical/puppet-lib-file_concat", - "project_page": "https://github.com/electrical/puppet-lib-file_concat", - "issues_url": "https://github.com/electrical/puppet-lib-file_concat/issues", - "operatingsystem_support": [ - { - "operatingsystem": "RedHat", - "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "CentOS", - "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "OracleLinux", - "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "SLES", - "operatingsystemrelease": [ - "10 SP4", - "11 SP1", - "12" - ] - }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ - "6", - "7" - ] - }, - { - "operatingsystem": "Ubuntu", - "operatingsystemrelease": [ - "10.04", - "12.04", - "14.04" - ] - }, - { - "operatingsystem": "Solaris", - "operatingsystemrelease": [ - "10", - "11" - ] - } - ], - "requirements": [ - { - "name": "pe", - "version_requirement": "3.x" - }, - { - "name": "puppet", - "version_requirement": "3.x" - } - ], - "description": "Library for concatenating different files into 1", - "dependencies": [ - - ] -} From 00be9e91c1023707ee5a07e3fa6412824e7a56e1 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 2 Oct 2024 15:35:31 +0200 Subject: [PATCH 131/147] update codeql and ignore contrib code Update the CodeQL workflow to use newer versions of the actions. Configure it to directly check out the correct commit. And configure it to ignore the contrib-modules directory. --- .github/workflows/codeql-analysis.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 83e2827c..735189c1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,20 +12,19 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + ref: ${{ ( github.event_name == 'pull_request' && github.event.pull_request.head.sha ) || github.context.ref }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 + with: + config: | + paths-ignore: + - contrib-modules # Override language selection by uncommenting this and choosing your # languages with: # languages: go, javascript, csharp, python, cpp, java @@ -34,7 +33,7 @@ jobs: # Java). If this step fails, then you should remove it and run the build # manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # â„šī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -48,4 +47,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 524493795463ba5a4468a7e9af9e6e58f106d38f Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 4 Nov 2024 19:27:29 +0100 Subject: [PATCH 132/147] snapshot all indices, not just a selection --- hieradata/common.yaml | 5 +++++ hieradata/nodes/bm-mc-02.yaml | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 0b5af13f..7b9d8ae4 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -254,6 +254,11 @@ metacpan::crons::api: cmd : 'latest >>/var/log/starman/metacpan-api/latest.log 2>&1' minute : 30 ensure : absent + snapshot_full: + cmd : snapshot --snap --snap-stub full --date-format '\%Y-\%m-\%d' + hour : 2 + minute : 0 + ensure : absent snapshot_cpan_index: cmd : snapshot --snap --indices 'cpan' --snap-stub cpan --date-format '\%Y-\%m-\%d' hour : 2 diff --git a/hieradata/nodes/bm-mc-02.yaml b/hieradata/nodes/bm-mc-02.yaml index ee9619a8..8227656b 100644 --- a/hieradata/nodes/bm-mc-02.yaml +++ b/hieradata/nodes/bm-mc-02.yaml @@ -25,13 +25,7 @@ metacpan::crons::general: ensure : present metacpan::crons::api: - snapshot_cover_index: - ensure : present - snapshot_contributor_index: - ensure : present - snapshot_cpan_index: - ensure : present - snapshot_user_index: + snapshot_full: ensure : present snapshot_purge_old: ensure : present From 39076ae63b3bde66de5f798f83d48120fd1c8bea Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 9 Nov 2024 21:58:39 +0100 Subject: [PATCH 133/147] disable elasticsearch --- hieradata/env/production.yaml | 1 + modules/metacpan_elasticsearch/manifests/instance.pp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index ea9e2aed..515df70d 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -10,6 +10,7 @@ exim::relayhost: '*.mailgun.org' metacpan::carton_args: '--deployment' +metacpan::elasticsearch::status: 'disabled' metacpan::elasticsearch::memory: '10g' # Let's have rrr on all machines for now diff --git a/modules/metacpan_elasticsearch/manifests/instance.pp b/modules/metacpan_elasticsearch/manifests/instance.pp index da3b6bef..2b382d4e 100644 --- a/modules/metacpan_elasticsearch/manifests/instance.pp +++ b/modules/metacpan_elasticsearch/manifests/instance.pp @@ -2,6 +2,7 @@ $version = hiera('metacpan::elasticsearch::version'), $autoupgrade = hiera('metacpan::elasticsearch::autoupgrade', false), $ensure = hiera('metacpan::elasticsearch::ensure', 'present'), + $status = hiera('metacpan::elasticsearch::status', 'enabled'), $memory = hiera('metacpan::elasticsearch::memory', '64'), $ip_address = hiera('metacpan::elasticsearch::ipaddress', '127.0.0.1'), $data_dir = hiera('metacpan::elasticsearch::datadir', '/var/elasticsearch'), @@ -117,6 +118,7 @@ config => $config_hash, init_defaults => $init_hash, datadir => $data_dir, + status => $status, } } From ed511745a26f6540370676df49c79e2a801a71e4 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 27 Dec 2024 14:40:20 +0100 Subject: [PATCH 134/147] add new key for haarg --- modules/metacpan/files/default/home/haarg/ssh/authorized_keys | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys index 5b9ec433..03c413cb 100644 --- a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys @@ -4,3 +4,4 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0TF5TGxXB9JEprUeB4/dJQ3bhRKZDc89QAwz+0Fk0S ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7o3RTCjabI0QGMYWHa6bP8OetQR03xPDO2puhoL3XsD0UX/sSEB3b6EWzih/1eSmxvAmfd7skKwVvW9u3ai607Gi82jtWlQB+KiJXodK7+XCM5S8F6SXFJ4kvsbF58a/08xWw9Vr2dULYu9ooSqaN2ogVchm3w86ZN0mpw8GNef9X3lnxaklbJBBF1LgtPE4+4AmnXKsU8Q0Bx8DH/D5ae1GkY/Kko2p+Iz0zLMvcK/5zlWQyfh7r4t0J5GdU8JQH76MzQIJ7rJp8tVoU22cev+BXIBSzRfEf8KmNEC+JhnJwRB8sS3mbhUCPkL5rnXwBa5nGXeAvD0DvC6zsVnUocWShcTkw/36Ero1QjJc5hYxu1LO/ZmHAl6D1UA0CYNF2i/9pxyJ+Srhfu1xu0bP3C14ND228BcOIbYZKxfH8MXWkhUSG94kCX6MagAqmykW1BkxpZgrY3rOOxkjQHTEVOCowwKtgCOfGPOouFaYeYzfkqiw2BeiYR6OjiwQoBubT04ekDSZk5f+yYM7mwBjrBJNMSv0Slz8ydFeuE1Gh63VgvnKtHTmMKfWHi/2KB7DPyEplyvTMI4D6O5uSuXQvybejuZEO35/7Jr922PbiuJA7BBwB9HWcyo3FDEiCqrJpLUdd+1m0VdxkmM7hxQ6MXgT+8/e/ERf4iKnv20+7sw== gknop@C02QV2JTFVH6 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIySfX93HCNv94OgeiybiObkUjlW3o4mnmG5PjOjoHNF gknop@FVFFN10WQ05Q ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1a+JAU9hP75dbJk0qtmwYa+cJa5bDKezFBp1geLZYW1IX2kxm26dNwz1r6UWiMyuGVj/ailAE+/Zf2cte1E9YTfGNQs3EhAy/Nqv4BThe7rHmfcEWxzPTCPET7M3buWPdTZDmVgANa/uXimzQP4mJclWUsfoB2/6uGceDih6snArmxeJFZptA6NUJ43EdvYhJRfH2CAGRrER2BxrDo/wKPSMu6laqwRvMLOPv+k+oqXB0I6aLjAaWk0BACT2evpBRWPl6/hDGGJiUK0sTXEs9DH4afjTJ6VGURbLIcPoIutDwzHo87wcgjqoGMPj6FfRy4UViSLHOrSidFHUGwOGuNPTSkeXnnzea/Ap/7brH7KAoZv0YVGcg9jx5JkT+4b/lVEr+L3ojZVYOD+Ek+uhmfbg40VE44XUe8ep4mNhlD2vAc43Cf5k8KJNfvBoHyFMK38zm/TXChzOKWZY1VKqQ9hN2MOwLNHiAyRMdXetA/21WYDbVQX1ku0KeDdvEbOrAf/VLkRL9CK2XUM+s0SdhJCRYR3yLIk8vIiIV7R3+9qOGxQn86eq0rAbZiWZEGGkJbK6bMYiaWEQnNPypw2v/6YmS1+1uG1T9ni9Rzz0/oiPPXUWUSZghDAo18v0uP7/y1anhJ89SHGUSd5GHlaJwTaOT8yNBwH7sfBhS5dx93w== gknop@FVFFN10WQ05Q +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM4LPAllkzgRIAtsWU02IIjUJ4SAHzaEkUZYbUU8qcMG haarg@fishsticks From 2825f583315ab042d5d96ecbc71639e64c244efe Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 2 Jan 2025 15:22:57 +0100 Subject: [PATCH 135/147] update keys for haarg --- .../metacpan/files/default/home/haarg/ssh/authorized_keys | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys index 03c413cb..aa7d17ba 100644 --- a/modules/metacpan/files/default/home/haarg/ssh/authorized_keys +++ b/modules/metacpan/files/default/home/haarg/ssh/authorized_keys @@ -1,7 +1 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6wBnxyfoyNIVcfaw07MwCdnrq5StFGTwXkU7Guh+fb gknop@cuneus -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH7JaCN6LRb/P2tjRVSNxZ5hEKJ3GRnYVyT/X2C4ePQHd3aNb1LyaI4DYo66t1VJUkduzXoQY0vPSlxOeBTr5L5Dzs36S6mMlU182XJ8YJwYYsSd7cwxR3cGBRlBGP8to+RnjkhQodRi5ozWTUVA9RNexCMHZwPPWJsxoKhUWsFiZE19c+eieRuA2rkOj7aQy6dz9vzu0a6uznby8XBDJC+6nw8SZRCw9aiiep07aGSA5kyz8LaxkQXfT7l/pPiwbqnTN6u0jF3VaImPB2ByT3QynUhNbkawixcr992yca0bRRS8cjnu4sgjipo2BN0dl6iPoamzmsAh5tdBlmRjoH gknop@cuneus -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0TF5TGxXB9JEprUeB4/dJQ3bhRKZDc89QAwz+0Fk0S gknop@C02QV2JTFVH6 -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC7o3RTCjabI0QGMYWHa6bP8OetQR03xPDO2puhoL3XsD0UX/sSEB3b6EWzih/1eSmxvAmfd7skKwVvW9u3ai607Gi82jtWlQB+KiJXodK7+XCM5S8F6SXFJ4kvsbF58a/08xWw9Vr2dULYu9ooSqaN2ogVchm3w86ZN0mpw8GNef9X3lnxaklbJBBF1LgtPE4+4AmnXKsU8Q0Bx8DH/D5ae1GkY/Kko2p+Iz0zLMvcK/5zlWQyfh7r4t0J5GdU8JQH76MzQIJ7rJp8tVoU22cev+BXIBSzRfEf8KmNEC+JhnJwRB8sS3mbhUCPkL5rnXwBa5nGXeAvD0DvC6zsVnUocWShcTkw/36Ero1QjJc5hYxu1LO/ZmHAl6D1UA0CYNF2i/9pxyJ+Srhfu1xu0bP3C14ND228BcOIbYZKxfH8MXWkhUSG94kCX6MagAqmykW1BkxpZgrY3rOOxkjQHTEVOCowwKtgCOfGPOouFaYeYzfkqiw2BeiYR6OjiwQoBubT04ekDSZk5f+yYM7mwBjrBJNMSv0Slz8ydFeuE1Gh63VgvnKtHTmMKfWHi/2KB7DPyEplyvTMI4D6O5uSuXQvybejuZEO35/7Jr922PbiuJA7BBwB9HWcyo3FDEiCqrJpLUdd+1m0VdxkmM7hxQ6MXgT+8/e/ERf4iKnv20+7sw== gknop@C02QV2JTFVH6 -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIySfX93HCNv94OgeiybiObkUjlW3o4mnmG5PjOjoHNF gknop@FVFFN10WQ05Q -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1a+JAU9hP75dbJk0qtmwYa+cJa5bDKezFBp1geLZYW1IX2kxm26dNwz1r6UWiMyuGVj/ailAE+/Zf2cte1E9YTfGNQs3EhAy/Nqv4BThe7rHmfcEWxzPTCPET7M3buWPdTZDmVgANa/uXimzQP4mJclWUsfoB2/6uGceDih6snArmxeJFZptA6NUJ43EdvYhJRfH2CAGRrER2BxrDo/wKPSMu6laqwRvMLOPv+k+oqXB0I6aLjAaWk0BACT2evpBRWPl6/hDGGJiUK0sTXEs9DH4afjTJ6VGURbLIcPoIutDwzHo87wcgjqoGMPj6FfRy4UViSLHOrSidFHUGwOGuNPTSkeXnnzea/Ap/7brH7KAoZv0YVGcg9jx5JkT+4b/lVEr+L3ojZVYOD+Ek+uhmfbg40VE44XUe8ep4mNhlD2vAc43Cf5k8KJNfvBoHyFMK38zm/TXChzOKWZY1VKqQ9hN2MOwLNHiAyRMdXetA/21WYDbVQX1ku0KeDdvEbOrAf/VLkRL9CK2XUM+s0SdhJCRYR3yLIk8vIiIV7R3+9qOGxQn86eq0rAbZiWZEGGkJbK6bMYiaWEQnNPypw2v/6YmS1+1uG1T9ni9Rzz0/oiPPXUWUSZghDAo18v0uP7/y1anhJ89SHGUSd5GHlaJwTaOT8yNBwH7sfBhS5dx93w== gknop@FVFFN10WQ05Q -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM4LPAllkzgRIAtsWU02IIjUJ4SAHzaEkUZYbUU8qcMG haarg@fishsticks +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILHbegp/btybKKX6zr2izDyfPnBX2IeekOJLf1SxkjLV haarg@cuneus From 071f50dd08ff7d9fe6a0be4632b703a356d16b1a Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Fri, 20 Jun 2025 16:56:18 +0100 Subject: [PATCH 136/147] Stop runniung ES on bm03 --- hieradata/nodes/bm-mc-03.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hieradata/nodes/bm-mc-03.yaml b/hieradata/nodes/bm-mc-03.yaml index 5d90d859..1b95eac8 100644 --- a/hieradata/nodes/bm-mc-03.yaml +++ b/hieradata/nodes/bm-mc-03.yaml @@ -1,22 +1,22 @@ --- classes: - metacpan::system::rsyslog::server - - metacpan_kibana + # - metacpan_kibana -metacpan::elasticsearch::cluster_name: 'meta_log' -metacpan::elasticsearch::master_nodes: 1 -metacpan::elasticsearch::expected_nodes: 1 -metacpan::elasticsearch::replicas: 0 -metacpan::elasticsearch::recover_after_nodes: 1 -metacpan::elasticsearch::cluster_hosts: - - 46.43.35.68 # bm-mc-03 -metacpan::elasticsearch::auto_create_indexes: 'syslog-*,app-*,access-*' +# metacpan::elasticsearch::cluster_name: 'meta_log' +# metacpan::elasticsearch::master_nodes: 1 +# metacpan::elasticsearch::expected_nodes: 1 +# metacpan::elasticsearch::replicas: 0 +# metacpan::elasticsearch::recover_after_nodes: 1 +# metacpan::elasticsearch::cluster_hosts: +# - 46.43.35.68 # bm-mc-03 +# metacpan::elasticsearch::auto_create_indexes: 'syslog-*,app-*,access-*' metacpan::fw_ports: rsyslog: order: 120 port: 514 - source: '0.0.0.0/0' + source: '0.0.0.0/0' rsyslog::extra_modules: - "omprog" From 4f5d656b7bda9c856b5ea8067854553b8d2bcb4e Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Fri, 20 Jun 2025 16:56:42 +0100 Subject: [PATCH 137/147] Increase nginx buffer proxy... Was seeing lots of... 2025/06/20 16:07:59 [warn] 524#524: *1922124040 an upstream response is buffered to a temporary file /var/lib/nginx/proxy/8/84/0013573848 while reading upstream, client: 157.52.67.80, server: api.metacpan.org, request: "POST /author/by_user HTTP/1.1", upstream: "http://127.0.0.1:5000/author/by_user", host: "fastapi.metacpan.org" This change hasn't stopped them, but probably doesn't hurt! --- modules/metacpan_nginx/templates/proxy.conf.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/metacpan_nginx/templates/proxy.conf.erb b/modules/metacpan_nginx/templates/proxy.conf.erb index 0d12a24e..a0534752 100644 --- a/modules/metacpan_nginx/templates/proxy.conf.erb +++ b/modules/metacpan_nginx/templates/proxy.conf.erb @@ -9,4 +9,7 @@ location <%= @location %>/ { proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffer_size 128k; + proxy_buffers 40 128k; + proxy_busy_buffers_size 256k; } From 67620f44f67a06ecf70fa233b01179dd932f825c Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 22 Jun 2025 15:08:49 +0100 Subject: [PATCH 138/147] Add Rhodri user --- hieradata/env/production.yaml | 4 ++++ modules/metacpan/files/default/rhodri/ssh/authorized_keys | 1 + 2 files changed, 5 insertions(+) create mode 100644 modules/metacpan/files/default/rhodri/ssh/authorized_keys diff --git a/hieradata/env/production.yaml b/hieradata/env/production.yaml index 515df70d..61c04f6c 100644 --- a/hieradata/env/production.yaml +++ b/hieradata/env/production.yaml @@ -43,6 +43,10 @@ metacpan::users: admin : true fullname : "Leo Lapworth " no_passwd_sudo : true + rhodri: + admin : true + fullname : "Rhodri Metcalfe-Davies " + no_passwd_sudo : true olaf: admin : true fullname : "Olaf Alders " diff --git a/modules/metacpan/files/default/rhodri/ssh/authorized_keys b/modules/metacpan/files/default/rhodri/ssh/authorized_keys new file mode 100644 index 00000000..6e87017f --- /dev/null +++ b/modules/metacpan/files/default/rhodri/ssh/authorized_keys @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEAsScGB6Xzpp5UDTfbsdmFm/pskF6T3zxw5j4RU29QEenk377sSofbN5E5D7u5+SDa21pcU+Rps3eJy1BF7fUOKctkvNsgi6Eva3B60ndIvmtdXVWIh5vwuw/eIBGoWVE8Pr1lkwRLhXQ7HkNHPuq0qoypGIupH+QDdz73T2/hxEUets3DGYQSk8Jet5YBN9Ma7nGTV8HskK5sNs2CqdtaJiKY3WX4wmmgHrCp5kHgcNgUgUhN1BHpvMN6al84htFiwNj54vvv7TQu+p71ar8rcGnQxw76fu9A+JLGCNgRcy2MTc9ccZ32ICpnK4M4DoseOEuHJU7kmxB0oYsztMd4oZY1w59ynK8W/O/uv+gsQlN90tC2TZ8aPDTluGD0Q90ACTjGFoKykj83wvlaAF1jvbBAW4cTiPLWWq516rOG7M2BUwV9sKuGABnbm6pLk+UxdGWjOZr0Whrs82Ch+CA9uHND9IgsFM+8UMyCRzrY+Z/C5+TF/ID/aRYiUXQpersZ+wQZQiZA9I6FMTghERUs+CT5TGQ8gx/LdT/2WPXSx+/PbTZ5lp5XVhwjZvpvViHKHhxMrCpzCdTQ2w2AI59CjZb1pBRGwE/e9Xg9nBbm4WOyCe/1/cTto+Rm7gjepCtpXtmEqOWsJwnT1eTRSH7xnO2u9xmfZuw/toJojUocMps= From 9c475107053d1c395983d05331fe72f7e58c6abc Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 22 Jun 2025 15:15:57 +0100 Subject: [PATCH 139/147] Oops - make right place! --- .../metacpan/files/default/{ => home}/rhodri/ssh/authorized_keys | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename modules/metacpan/files/default/{ => home}/rhodri/ssh/authorized_keys (100%) diff --git a/modules/metacpan/files/default/rhodri/ssh/authorized_keys b/modules/metacpan/files/default/home/rhodri/ssh/authorized_keys similarity index 100% rename from modules/metacpan/files/default/rhodri/ssh/authorized_keys rename to modules/metacpan/files/default/home/rhodri/ssh/authorized_keys From e8c9e6e7bc404e237642c208c67ad148683aa69f Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 16:01:06 +0100 Subject: [PATCH 140/147] Temporarily switch to a new CPAN rsync host We will revert this once the main mirror is back online, so we don't need to use a variable for the hostname in this case. --- modules/rrrclient/manifests/cron.pp | 2 +- modules/rrrclient/templates/init.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index faf15586..af436cc3 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,7 +29,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index 01158b10..e325137a 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source 23.29.118.28::PAUSE/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From e746cb64757f464d51efa26a8a47b36d6fd90095 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 16:04:39 -0400 Subject: [PATCH 141/147] run rsync throughout the day as a stopgap We cannot run rrr-client on the top level pop-up-pause-rsync because it contains some fails which may or may not still be in CPAN. Instead we need to mirror ./modules and ./authors. It would complicate the init script for the rrr-client to do it there, so let's just run rsync every 15 minutes or so to start with and see if that works. --- modules/rrrclient/manifests/cron.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index af436cc3..1543e4ed 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,9 +29,8 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", - hour => '23', - minute => '13', + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", + minute => '*/15', ensure => $ensure; } } From d9354fc83206ab4188b53d0803140b10053f0887 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 7 Oct 2025 18:37:49 -0400 Subject: [PATCH 142/147] Explicitly set wildcard for cron hour puppet leaves the hour untouches if it's not provided, so we ended up with a cron that ran every 15 minutes only in the 23rd hour --- modules/rrrclient/manifests/cron.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 1543e4ed..8ffec418 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -30,6 +30,7 @@ user => $user, # NOTE: No "--delete" arg since we're also a backpan. command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", + hour => '*', minute => '*/15', ensure => $ensure; } From 57c492aed40f0845c58e2e8100d0b6b47d0d6fee Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:10 +0100 Subject: [PATCH 143/147] Revert "Explicitly set wildcard for cron hour" This reverts commit d9354fc83206ab4188b53d0803140b10053f0887. --- modules/rrrclient/manifests/cron.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 8ffec418..1543e4ed 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -30,7 +30,6 @@ user => $user, # NOTE: No "--delete" arg since we're also a backpan. command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", - hour => '*', minute => '*/15', ensure => $ensure; } From bebce0c10b690b22b32371b88c9f11d9452ebe46 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:30 +0100 Subject: [PATCH 144/147] Revert "run rsync throughout the day as a stopgap" This reverts commit e746cb64757f464d51efa26a8a47b36d6fd90095. --- modules/rrrclient/manifests/cron.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index 1543e4ed..af436cc3 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,8 +29,9 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE/authors/ ${cpan_mirror}/authors/ && /usr/bin/rsync -a 23.29.118.28::PAUSE/modules/ ${cpan_mirror}/modules/", - minute => '*/15', + command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", + hour => '23', + minute => '13', ensure => $ensure; } } From 0fadb837465c29027da9e3f5069bd25a74fa9a89 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Thu, 9 Oct 2025 22:10:48 +0100 Subject: [PATCH 145/147] Revert "Temporarily switch to a new CPAN rsync host" This reverts commit e8c9e6e7bc404e237642c208c67ad148683aa69f. --- modules/rrrclient/manifests/cron.pp | 2 +- modules/rrrclient/templates/init.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index af436cc3..faf15586 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -29,7 +29,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a 23.29.118.28::PAUSE ${cpan_mirror}", + command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index e325137a..01158b10 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source 23.29.118.28::PAUSE/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From ff0536d334ab0b4cddd9f1d5a8304ff5fe304ddf Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 26 Oct 2025 08:30:30 +0000 Subject: [PATCH 146/147] Make rrr and the rsync cron user a variable for the server --- hieradata/common.yaml | 2 ++ modules/rrrclient/manifests/cron.pp | 3 ++- modules/rrrclient/manifests/service.pp | 1 + modules/rrrclient/templates/init.erb | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 7b9d8ae4..56a78225 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -86,6 +86,8 @@ metacpan::watcher::enable: false # We don't want to have CPAN synced metacpan::rrrclient::enable: false +# Default server to use +metacpan::rrrclient::server: 'cpan-rsync.perl.org' # Elasticsearch basic options metacpan::elasticsearch::version: 2.4.3 diff --git a/modules/rrrclient/manifests/cron.pp b/modules/rrrclient/manifests/cron.pp index faf15586..acc5fdf5 100644 --- a/modules/rrrclient/manifests/cron.pp +++ b/modules/rrrclient/manifests/cron.pp @@ -2,6 +2,7 @@ $ensure = absent, $cpan_mirror, $user = hiera('metacpan::user', 'metacpan'), + $rrr_server = hiera('metacpan::rrrclient::server'), ) { # BARBIE pointed out an issue where rrr_client misses arbitrary uploads. He and @@ -29,7 +30,7 @@ 'metacpan_daily_rsync': user => $user, # NOTE: No "--delete" arg since we're also a backpan. - command => "/usr/bin/rsync -a cpan-rsync.perl.org::CPAN ${cpan_mirror}", + command => "/usr/bin/rsync -a ${rrr_server}::CPAN ${cpan_mirror}", hour => '23', minute => '13', ensure => $ensure; diff --git a/modules/rrrclient/manifests/service.pp b/modules/rrrclient/manifests/service.pp index 0993dedc..0e64b15a 100644 --- a/modules/rrrclient/manifests/service.pp +++ b/modules/rrrclient/manifests/service.pp @@ -3,6 +3,7 @@ $cpan_mirror, $pid_file = "/var/run/rrrclient-$name.pid", $enable = false, + $rrr_server = hiera('metacpan::rrrclient::server'), ) { include perl perl::module{ 'File::Rsync::Mirror::Recent': diff --git a/modules/rrrclient/templates/init.erb b/modules/rrrclient/templates/init.erb index 01158b10..e42f9adb 100755 --- a/modules/rrrclient/templates/init.erb +++ b/modules/rrrclient/templates/init.erb @@ -30,7 +30,7 @@ test -x $BIN || { echo "$BIN not installed"; case "$1" in start) echo -n "Starting <%= @filename %> " - start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source cpan-rsync.perl.org::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes + start-stop-daemon --start --background -c <%= @owner %> -m -p <%= @pid_file %> --startas <%= @bin %> -- --source <%= @rrr_server %>::CPAN/RECENT.recent --target <%= @cpan_mirror %> --skip-deletes ;; stop) echo -n "Shutting down <%= @filename %> " From 61c2e7dff18b1f72b547dd2aa05e240da8ca6dca Mon Sep 17 00:00:00 2001 From: Leo Lapworth Date: Sun, 26 Oct 2025 08:31:12 +0000 Subject: [PATCH 147/147] Get puppet looking for a private hiera file which we can symlink in --- hiera.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/hiera.yaml b/hiera.yaml index 4305924d..117e5cc2 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -8,4 +8,5 @@ - "nodes/%{hostname}" - "datacenter/%{datacenter}" - "env/%{env}" + - private/common - common