From 0f3b898dd40868dd60c5a6a3ef70d8635c34cfc7 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Wed, 27 Oct 2021 19:55:43 -0400 Subject: [PATCH 01/25] Added params for metrics section in config file --- manifests/init.pp | 4 ++++ manifests/params.pp | 5 +++++ manifests/profile/server.pp | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 7ef0181a..d18db75c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -343,6 +343,10 @@ $scheduler_num = $st2::params::scheduler_num, $rulesengine_num = $st2::params::rulesengine_num, $notifier_num = $st2::params::notifier_num, + $metrics_include = $st2::params::metrics_include, + $metric_driver = $st2::params::metric_driver, + $metric_host = $st2::params::metric_host, + $metric_port = $st2::params::metric_port, ) inherits st2::params { ######################################## diff --git a/manifests/params.pp b/manifests/params.pp index b04d7b18..df365d4c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -217,4 +217,9 @@ $chatops_adapter_conf = { 'HUBOT_ADAPTER' => 'slack', } + + $metrics_include = false + $metric_driver = 'statsd' + $metric_host = '127.0.0.1' + $metric_port = '8125' } diff --git a/manifests/profile/server.pp b/manifests/profile/server.pp index 0b82bf2a..5ff509a0 100644 --- a/manifests/profile/server.pp +++ b/manifests/profile/server.pp @@ -67,6 +67,10 @@ $redis_hostname = $st2::redis_hostname, $redis_port = $st2::redis_port, $redis_password = $st2::redis_password, + $metrics_include = $st2::metrics_include, + $metric_driver = $st2::metric_driver, + $metric_host = $st2::metric_host, + $metric_port = $st2::metric_port, $index_url = $st2::index_url, $packs_group = $st2::packs_group_name, ) inherits st2 { @@ -283,6 +287,34 @@ tag => 'st2::config', } + ## Metrics Settings + if $metrics_include { + ini_setting { 'metrics_driver': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'driver', + value => $metric_driver, + tag => 'st2::config', + } + + ini_setting { 'metrics_host': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'host', + value => $metric_host, + tag => 'st2::config', + } + + ini_setting { 'metrics_port': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'port', + value => $metric_port, + tag => 'st2::config', + } + } + + ## Resultstracker Settings ini_setting { 'resultstracker_logging': ensure => present, From 233e8dfaf78f5a16b2a3b9bde7b9e4854eb53f81 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 14:53:27 -0500 Subject: [PATCH 02/25] Adding route to /basic_status to get stub_status metrics from nginx --- spec/classes/profile/web_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 56b5887a..d9230c0c 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -149,6 +149,34 @@ }, tag: ['st2', 'st2::backend', 'st2::backend::api']) end + it do + is_expected.to contain_nginx__resource__location('@basic_statusError') + .with(ensure: 'present', + server: 'ssl-st2webui', + ssl: true, + ssl_only: true, + index_files: [], + add_header: { + 'Content-Type' => 'application/json always', + }, + location_cfg_append: { + 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', + }, + tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) + end + it do + is_expected.to contain_nginx__resource__location('/basic_status/') + .with(ensure: 'present', + server: 'ssl-st2webui', + ssl: true, + ssl_only: true, + index_files: ['index.html'], + www_root: '/opt/stackstorm/static/webui/', + location_cfg_append: { + 'stub_status' => 'on', + }, + tag: ['st2', 'st2::backend', 'st2::backend::basic_status']) + end it do is_expected.to contain_nginx__resource__location('@streamError') .with(ensure: 'present', From d497ab65ec916a124f0d36e64af08a43dec40387 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 15:02:16 -0500 Subject: [PATCH 03/25] removing extra spaces --- spec/classes/profile/web_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index d9230c0c..a3576c90 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -173,7 +173,7 @@ index_files: ['index.html'], www_root: '/opt/stackstorm/static/webui/', location_cfg_append: { - 'stub_status' => 'on', + 'stub_status' => 'on', }, tag: ['st2', 'st2::backend', 'st2::backend::basic_status']) end From 92f48042ce211584e5d95f49dfd0fcd076f0c1d3 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 15:31:00 -0500 Subject: [PATCH 04/25] Adding resource location for nginx stub status module --- manifests/params.pp | 2 ++ manifests/profile/web.pp | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/manifests/params.pp b/manifests/params.pp index df365d4c..29cc6352 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -46,6 +46,8 @@ # stream settings $stream_port = 9102 + $basicstatus_port = 9103 + # Non-user configurable parameters $repository = 'stable' $conf_dir = '/etc/st2' diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index aedb11d5..42c69d84 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -237,6 +237,32 @@ }, } + nginx::resource::location { '@basic_statusError': + * => $location_defaults + { + add_header => { + 'Content-Type' => 'application/json always', + }, + location_cfg_append => { + 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', + }, + tag => ['st2', 'st2::backend', 'st2::backend::basicstatuserror'], + }, + } + + nginx::resource::location { '/basic_status/': + * => $proxy_defaults + { + rewrite_rules => [ + '^/api/(.*) /$1 break', + ], + proxy => "http://127.0.0.1:${st2::params::basicstatus_port}", + location_cfg_append => { + 'error_page' => '502 = @apiError', + 'stub_status' => 'on', + }, + tag => ['st2', 'st2::backend', 'st2::backend::basic_status'], + }, + } + nginx::resource::location { '@streamError': * => $location_defaults + { add_header => { From 0819c467723215f9e1ca71b3e3e3ac5b1a716962 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 15:41:17 -0500 Subject: [PATCH 05/25] syntax fixes --- manifests/profile/web.pp | 2 +- spec/classes/profile/web_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index 42c69d84..2a6e684c 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -256,7 +256,7 @@ ], proxy => "http://127.0.0.1:${st2::params::basicstatus_port}", location_cfg_append => { - 'error_page' => '502 = @apiError', + 'error_page' => '502 = @basic_statusError', 'stub_status' => 'on', }, tag => ['st2', 'st2::backend', 'st2::backend::basic_status'], diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index a3576c90..9bf88e27 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -173,6 +173,7 @@ index_files: ['index.html'], www_root: '/opt/stackstorm/static/webui/', location_cfg_append: { + 'error_page' => '502 = @basic_statusError', 'stub_status' => 'on', }, tag: ['st2', 'st2::backend', 'st2::backend::basic_status']) From 1ee4a47fce118078c961ed7a23a3b6ba966fad80 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 15:45:53 -0500 Subject: [PATCH 06/25] removing index.html from index_files --- spec/classes/profile/web_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 9bf88e27..9ecfb770 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -170,7 +170,7 @@ server: 'ssl-st2webui', ssl: true, ssl_only: true, - index_files: ['index.html'], + index_files: [], www_root: '/opt/stackstorm/static/webui/', location_cfg_append: { 'error_page' => '502 = @basic_statusError', From f76a11daa96f91004712d20ef280ded7ba579dfb Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 10 Nov 2021 15:51:33 -0500 Subject: [PATCH 07/25] removing more copy/paste errors (www_root) --- spec/classes/profile/web_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 9ecfb770..2ee26fd3 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -171,7 +171,6 @@ ssl: true, ssl_only: true, index_files: [], - www_root: '/opt/stackstorm/static/webui/', location_cfg_append: { 'error_page' => '502 = @basic_statusError', 'stub_status' => 'on', From ce5fdc6a1291356bf26ca480999883e6df6cb1a7 Mon Sep 17 00:00:00 2001 From: Alex Chrystal Date: Wed, 17 Nov 2021 10:30:21 -0500 Subject: [PATCH 08/25] adding nginx basic_status port to init. updating CHANGELOG and metadata --- CHANGELOG.md | 7 +++++++ manifests/init.pp | 1 + manifests/params.pp | 1 + metadata.json | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 702f370e..b9061051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ - Add configuration for redis based coordination and remove old style `$::osfamily` references. Contributed by @rush-skills +## 2.4.0 (Nov 17, 2021) + +- Added the ability to manage StackStack metrics giving options for the metric driver, host and port number; defined + in st2.conf. Contributed by @bishopbm1 + +- Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis + ## 2.3.0 (Sep 15, 2021) - Remove tests for Ubuntu 18.04 and Python3.6, since it's already default. Contributed by @rush-skills. diff --git a/manifests/init.pp b/manifests/init.pp index d18db75c..6b6ea770 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -302,6 +302,7 @@ $ng_init = true, $datastore_keys_dir = $st2::params::datstore_keys_dir, $datastore_key_path = "${st2::params::datstore_keys_dir}/datastore_key.json", + $nginx_basicstatus_port = $st2::params::basicstatus_port, $nginx_manage_repo = true, $nginx_client_max_body_size = $st2::params::nginx_client_max_body_size, $nginx_ssl_ciphers = $st2::params::nginx_ssl_ciphers, diff --git a/manifests/params.pp b/manifests/params.pp index 29cc6352..7bb7180b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -46,6 +46,7 @@ # stream settings $stream_port = 9102 + # nginx basic status port $basicstatus_port = 9103 # Non-user configurable parameters diff --git a/metadata.json b/metadata.json index 677e9b09..53891274 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "stackstorm-st2", - "version": "2.3.0", + "version": "2.4.0", "author": "stackstorm", "summary": "Puppet module to manage/configure StackStorm", "license": "Apache-2.0", From f14581490f0761ffc7a35ec32b287aa5b43c952a Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Tue, 23 Nov 2021 16:41:37 -0500 Subject: [PATCH 09/25] Fixing syntax --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9061051..9fec3706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ ## 2.4.0 (Nov 17, 2021) -- Added the ability to manage StackStack metrics giving options for the metric driver, host and port number; defined - in st2.conf. Contributed by @bishopbm1 +- Added the ability to manage StackStack metrics giving options for the metric driver, + host and port number defined in st2.conf. Contributed by @bishopbm1 - Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis From b862bd2c0d0de9a58a588861976a76a5f828c928 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Tue, 23 Nov 2021 16:47:56 -0500 Subject: [PATCH 10/25] Fixing input --- manifests/profile/web.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index 2a6e684c..a21c1fb6 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -71,6 +71,7 @@ String $ssl_key = $st2::ssl_key, String $version = $st2::version, String $web_root = $st2::web_root, + String $basicstatus_port = $st2::nginx_basicstatus_port, ) inherits st2 { # include nginx here only # if we include this in st2::profile::fullinstall Anchor['pre_reqs'] then @@ -254,7 +255,7 @@ rewrite_rules => [ '^/api/(.*) /$1 break', ], - proxy => "http://127.0.0.1:${st2::params::basicstatus_port}", + proxy => "http://127.0.0.1:${basicstatus_port}", location_cfg_append => { 'error_page' => '502 = @basic_statusError', 'stub_status' => 'on', From 062831b7b216828d049f4b543e9081e9accb9b45 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Tue, 23 Nov 2021 16:51:36 -0500 Subject: [PATCH 11/25] Fixing type --- manifests/profile/web.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index a21c1fb6..f0799849 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -71,7 +71,7 @@ String $ssl_key = $st2::ssl_key, String $version = $st2::version, String $web_root = $st2::web_root, - String $basicstatus_port = $st2::nginx_basicstatus_port, + Integer $basicstatus_port = $st2::nginx_basicstatus_port, ) inherits st2 { # include nginx here only # if we include this in st2::profile::fullinstall Anchor['pre_reqs'] then From 1948db613efa3340cf7972f7f30fa78128f5aa71 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Tue, 23 Nov 2021 17:08:52 -0500 Subject: [PATCH 12/25] Fixing tests --- manifests/profile/web.pp | 2 +- test/integration/stackstorm/controls/services_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index f0799849..6c0e1192 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -71,7 +71,7 @@ String $ssl_key = $st2::ssl_key, String $version = $st2::version, String $web_root = $st2::web_root, - Integer $basicstatus_port = $st2::nginx_basicstatus_port, + Integer $basicstatus_port = $st2::nginx_basicstatus_port, ) inherits st2 { # include nginx here only # if we include this in st2::profile::fullinstall Anchor['pre_reqs'] then diff --git a/test/integration/stackstorm/controls/services_test.rb b/test/integration/stackstorm/controls/services_test.rb index 35e5c3a7..99baf030 100644 --- a/test/integration/stackstorm/controls/services_test.rb +++ b/test/integration/stackstorm/controls/services_test.rb @@ -27,14 +27,14 @@ # st2auth describe port(9100) do it { should be_listening } - its('addresses') { should include '127.0.0.1' } + its('addresses') { should include '0.0.0.0' } its('protocols') { should cmp 'tcp' } end # st2api describe port(9101) do it { should be_listening } - its('addresses') { should include '127.0.0.1' } + its('addresses') { should include '0.0.0.0' } its('protocols') { should cmp 'tcp' } end From 7b7b055b2fb68db7f4cce5bfcc2c0569ee5c3b9a Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Fri, 20 May 2022 14:56:18 -0400 Subject: [PATCH 13/25] Added metrics to its own file. Fixed RabbitMQ errors. Fixed failing and incorrect tests. Updated tests to support new python version. Fixed all failing builds --- .github/workflows/build.yaml | 4 +- .kitchen.yml | 4 +- CHANGELOG.md | 16 +++--- build/centos7-puppet6/Puppetfile | 9 ++- build/centos7-puppet7/Puppetfile | 9 ++- build/ubuntu18-puppet6/Puppetfile | 9 ++- build/ubuntu18-puppet7/Puppetfile | 9 ++- build/ubuntu20-puppet6/Puppetfile | 9 ++- build/ubuntu20-puppet7/Puppetfile | 9 ++- manifests/init.pp | 4 ++ manifests/params.pp | 6 +- manifests/profile/metrics.pp | 55 +++++++++++++++++++ manifests/profile/rabbitmq.pp | 41 ++++++++------ manifests/profile/server.pp | 33 +---------- ...ll_python36.pp => fullinstall_python38.pp} | 4 +- metadata.json | 2 +- .../stackstorm/controls/services_test.rb | 4 +- test/unit/st2_test_case.py | 25 ++++++++- 18 files changed, 174 insertions(+), 78 deletions(-) create mode 100644 manifests/profile/metrics.pp rename manifests/test/{fullinstall_python36.pp => fullinstall_python38.pp} (81%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a534cee9..ff3902b3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -83,7 +83,7 @@ jobs: matrix: include: # note: actions/setup-python only allows using a major.minor releases - - python: '3.6' + - python: '3.8' make_target: 'python3' name: 'bolt tasks' steps: @@ -122,7 +122,7 @@ jobs: - ruby: '2.7' name: 'centos7-puppet7' - ruby: '2.7' - name: 'centos7-puppet7-python36' + name: 'centos7-puppet7-python38' - ruby: '2.7' name: 'ubuntu18-puppet6' - ruby: '2.7' diff --git a/.kitchen.yml b/.kitchen.yml index c4b84d07..899747d2 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -62,7 +62,7 @@ platforms: puppetfile_path: build/centos7-puppet7/Puppetfile # CentOS7 with Systemd - Puppet 7 - Python 3.6 - - name: centos7-puppet7-python36 + - name: centos7-puppet7-python38 driver: platform: centos dockerfile: build/centos7-puppet7/Dockerfile.kitchen @@ -71,7 +71,7 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:ro provisioner: puppetfile_path: build/centos7-puppet7/Puppetfile - manifest: test/fullinstall_python36.pp + manifest: test/fullinstall_python38.pp # Ubuntu Bionic with Systemd - Puppet 6 - name: ubuntu18-puppet6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 688e9c17..3dd7262e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Development +- Added the ability to manage StackStack metrics giving options for the metric driver, + host and port number defined in st2.conf. Contributed by @bishopbm1 + +- Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis + +- Fixed issues with RabbitMQ @bishopbm1 + +- Fixed and updated all tests @bishopbm1 + ## 2.4.0 (Mar 1, 2022) - Update RabbitMQ installer to use latest Erlang from RabbitMQ repos. Contributed by @rush-skills @@ -22,13 +31,6 @@ - Add configuration for redis based coordination and remove old style `$::osfamily` references. Contributed by @rush-skills -## 2.4.0 (Nov 17, 2021) - -- Added the ability to manage StackStack metrics giving options for the metric driver, - host and port number defined in st2.conf. Contributed by @bishopbm1 - -- Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis - ## 2.3.0 (Sep 15, 2021) - Remove tests for Ubuntu 18.04 and Python3.6, since it's already default. Contributed by @rush-skills. diff --git a/build/centos7-puppet6/Puppetfile b/build/centos7-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/centos7-puppet6/Puppetfile +++ b/build/centos7-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/centos7-puppet7/Puppetfile b/build/centos7-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/centos7-puppet7/Puppetfile +++ b/build/centos7-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet6/Puppetfile b/build/ubuntu18-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu18-puppet6/Puppetfile +++ b/build/ubuntu18-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet7/Puppetfile b/build/ubuntu18-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu18-puppet7/Puppetfile +++ b/build/ubuntu18-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet6/Puppetfile b/build/ubuntu20-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu20-puppet6/Puppetfile +++ b/build/ubuntu20-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet7/Puppetfile b/build/ubuntu20-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu20-puppet7/Puppetfile +++ b/build/ubuntu20-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/manifests/init.pp b/manifests/init.pp index 389c1436..bc4c8cf5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -325,6 +325,10 @@ $erlang_key_id = $st2::params::erlang_key_id, $erlang_key_source = $st2::params::erlang_key_source, $erlang_packages = $st2::params::erlang_packages, + $erlang_rhel_sslcacert_location = $st2::params::erlang_rhel_sslcacert_location, + $erlang_rhel_sslverify = $st2::params::erlang_rhel_sslverify, + $erlang_rhel_gpgcheck = $st2::params::erlang_rhel_gpgcheck, + $erlang_rhel_repo_gpgcheck = $st2::params::erlang_rhel_repo_gpgcheck, $redis_bind_ip = $st2::params::redis_bind_ip, $redis_hostname = $st2::params::redis_hostname, $redis_port = $st2::params::redis_port, diff --git a/manifests/params.pp b/manifests/params.pp index f76abac3..375a44e5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -195,9 +195,13 @@ 'Debian' => "http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/${osname}", 'RedHat' => "https://packagecloud.io/rabbitmq/erlang/el/${facts['os'][release][major]}/\$basearch", } - $erlang_key = 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey' + $erlang_key = 'https://packagecloud.io/rabbitmq/erlang/gpgkey' $erlang_key_id = 'B279943D2A549531E144B875F77F1EDA57EBB1CC' $erlang_key_source = 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc' + $erlang_rhel_sslcacert_location = '/etc/pki/tls/certs/ca-bundle.crt' + $erlang_rhel_sslverify = 1 + $erlang_rhel_gpgcheck = 0 + $erlang_rhel_repo_gpgcheck = 1 $erlang_packages = [ 'erlang', ] diff --git a/manifests/profile/metrics.pp b/manifests/profile/metrics.pp new file mode 100644 index 00000000..8b420243 --- /dev/null +++ b/manifests/profile/metrics.pp @@ -0,0 +1,55 @@ +# @summary StackStorm compatable installation of MongoDB and dependencies. +# +# @param metrics_include +# Should metrics be enabled +# @param metric_driver +# The driver to use for the metrics. Default='statsd' +# @param metric_host +# The host to pull metrics from. Default='127.0.0.1' +# @param metric_port +# The port for the metrics. Default='8125' +# +# @example Basic Usage +# include st2::profile::metrics +# +# @example Customize (done via st2) +# class { 'st2': +# metrics_include => true, +# metric_driver => 'statsd', +# metric_host => '127.0.0.1', +# metric_port => '8125', +# } +# include st2::profile::metrics +# +class st2::profile::metrics ( + $metrics_include = $st2::metrics_include, + $metric_driver = $st2::metric_driver, + $metric_host = $st2::metric_host, + $metric_port = $st2::metric_port, +) inherits st2 { + if $metrics_include { + ini_setting { 'metrics_driver': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'driver', + value => $metric_driver, + tag => 'st2::config', + } + + ini_setting { 'metrics_host': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'host', + value => $metric_host, + tag => 'st2::config', + } + + ini_setting { 'metrics_port': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'port', + value => $metric_port, + tag => 'st2::config', + } + } +} diff --git a/manifests/profile/rabbitmq.pp b/manifests/profile/rabbitmq.pp index f5a78199..e5c6eeab 100644 --- a/manifests/profile/rabbitmq.pp +++ b/manifests/profile/rabbitmq.pp @@ -22,16 +22,20 @@ # include st2::profile::rabbitmq # class st2::profile::rabbitmq ( - $username = $st2::rabbitmq_username, - $password = $st2::rabbitmq_password, - $port = $st2::rabbitmq_port, - $bind_ip = $st2::rabbitmq_bind_ip, - $vhost = $st2::rabbitmq_vhost, - $erlang_url = $st2::erlang_url, - $erlang_key = $st2::erlang_key, - $erlang_key_id = $st2::erlang_key_id, - $erlang_key_source = $st2::erlang_key_source, - $erlang_packages = $st2::erlang_packages, + $username = $st2::rabbitmq_username, + $password = $st2::rabbitmq_password, + $port = $st2::rabbitmq_port, + $bind_ip = $st2::rabbitmq_bind_ip, + $vhost = $st2::rabbitmq_vhost, + $erlang_url = $st2::erlang_url, + $erlang_key = $st2::erlang_key, + $erlang_key_id = $st2::erlang_key_id, + $erlang_key_source = $st2::erlang_key_source, + $erlang_packages = $st2::erlang_packages, + $erlang_rhel_sslcacert_location = $st2::erlang_rhel_sslcacert_location, + $erlang_rhel_sslverify = $st2::erlang_rhel_sslverify, + $erlang_rhel_gpgcheck = $st2::erlang_rhel_gpgcheck, + $erlang_rhel_repo_gpgcheck = $st2::erlang_rhel_repo_gpgcheck, ) inherits st2 { # RHEL 8 Requires another repo in addition to epel to be installed @@ -41,13 +45,16 @@ # This is required because when using the latest version of rabbitmq because the latest version in EPEL # for Erlang is 22.0.7 which is not compatible: https://www.rabbitmq.com/which-erlang.html yumrepo { 'erlang': - ensure => present, - name => 'rabbitmq_erlang', - baseurl => $erlang_url, - gpgkey => $erlang_key, - enabled => 1, - gpgcheck => 1, - before => Class['rabbitmq::repo::rhel'], + ensure => present, + name => 'rabbitmq_erlang', + baseurl => $erlang_url, + gpgkey => $erlang_key, + enabled => 1, + gpgcheck => $erlang_rhel_gpgcheck, + repo_gpgcheck => $erlang_rhel_repo_gpgcheck, + before => Class['rabbitmq::repo::rhel'], + sslverify => $erlang_rhel_sslverify, + sslcacert => $erlang_rhel_sslcacert_location, } } elsif ($facts['os']['family'] == 'Debian') { diff --git a/manifests/profile/server.pp b/manifests/profile/server.pp index 3cf2ade3..35b12c18 100644 --- a/manifests/profile/server.pp +++ b/manifests/profile/server.pp @@ -67,10 +67,6 @@ $redis_hostname = $st2::redis_hostname, $redis_port = $st2::redis_port, $redis_password = $st2::redis_password, - $metrics_include = $st2::metrics_include, - $metric_driver = $st2::metric_driver, - $metric_host = $st2::metric_host, - $metric_port = $st2::metric_port, $index_url = $st2::index_url, $packs_group = $st2::packs_group_name, $validate_output_schema = $st2::validate_output_schema, @@ -292,33 +288,6 @@ tag => 'st2::config', } - ## Metrics Settings - if $metrics_include { - ini_setting { 'metrics_driver': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'driver', - value => $metric_driver, - tag => 'st2::config', - } - - ini_setting { 'metrics_host': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'host', - value => $metric_host, - tag => 'st2::config', - } - - ini_setting { 'metrics_port': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'port', - value => $metric_port, - tag => 'st2::config', - } - } - ## Resultstracker Settings ini_setting { 'resultstracker_logging': @@ -360,6 +329,8 @@ tag => 'st2::config', } + class { 'st2::profile::metrics': } + ## Syslog Settings ini_setting { 'syslog_host': ensure => present, diff --git a/manifests/test/fullinstall_python36.pp b/manifests/test/fullinstall_python38.pp similarity index 81% rename from manifests/test/fullinstall_python36.pp rename to manifests/test/fullinstall_python38.pp index e8fba26a..d98fa13d 100644 --- a/manifests/test/fullinstall_python36.pp +++ b/manifests/test/fullinstall_python38.pp @@ -1,7 +1,7 @@ # Test for installing standalone StackStorm using Python 3.6 $st2_python_version = $facts['os']['family'] ? { - 'RedHat' => '3.6', - 'Debian' => 'python3.6', + 'RedHat' => '3.8', + 'Debian' => 'python3.8', } class { 'st2': python_version => $st2_python_version, diff --git a/metadata.json b/metadata.json index 53891274..c5ce336a 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "stackstorm-st2", - "version": "2.4.0", + "version": "2.5.0", "author": "stackstorm", "summary": "Puppet module to manage/configure StackStorm", "license": "Apache-2.0", diff --git a/test/integration/stackstorm/controls/services_test.rb b/test/integration/stackstorm/controls/services_test.rb index 99baf030..35e5c3a7 100644 --- a/test/integration/stackstorm/controls/services_test.rb +++ b/test/integration/stackstorm/controls/services_test.rb @@ -27,14 +27,14 @@ # st2auth describe port(9100) do it { should be_listening } - its('addresses') { should include '0.0.0.0' } + its('addresses') { should include '127.0.0.1' } its('protocols') { should cmp 'tcp' } end # st2api describe port(9101) do it { should be_listening } - its('addresses') { should include '0.0.0.0' } + its('addresses') { should include '127.0.0.1' } its('protocols') { should cmp 'tcp' } end diff --git a/test/unit/st2_test_case.py b/test/unit/st2_test_case.py index 5a92fd44..bdc9209d 100644 --- a/test/unit/st2_test_case.py +++ b/test/unit/st2_test_case.py @@ -1,8 +1,10 @@ import yaml import json import logging +import os +import inspect -from unittest import TestCase +from unittest2 import TestCase class St2TestCase(TestCase): @@ -16,6 +18,27 @@ def tearDown(self): super(St2TestCase, self).tearDown() logging.disable(logging.NOTSET) # enable logging + def get_fixture_content(self, fixture_path): + """ + Return raw fixture content for the provided fixture path. + :param fixture_path: Fixture path relative to the tests/fixtures/ directory. + :type fixture_path: ``str`` + """ + base_pack_path = self._get_base_pack_path() + fixtures_path = os.path.join(base_pack_path, "tests/fixtures/") + fixture_path = os.path.join(fixtures_path, fixture_path) + + with open(fixture_path, "r") as fp: + content = fp.read() + + return content + + def _get_base_pack_path(self): + test_file_path = inspect.getfile(self.__class__) + base_pack_path = os.path.join(os.path.dirname(test_file_path), "..") + base_pack_path = os.path.abspath(base_pack_path) + return base_pack_path + def load_yaml(self, filename): return yaml.safe_load(self.get_fixture_content(filename)) From 9d05525cc759c67dd35072870f2141888f46b40a Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Fri, 20 May 2022 15:48:44 -0400 Subject: [PATCH 14/25] Pinning erlang to the 24 for rhel 8 --- manifests/profile/rabbitmq.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/manifests/profile/rabbitmq.pp b/manifests/profile/rabbitmq.pp index e5c6eeab..f1ccc33d 100644 --- a/manifests/profile/rabbitmq.pp +++ b/manifests/profile/rabbitmq.pp @@ -56,6 +56,18 @@ sslverify => $erlang_rhel_sslverify, sslcacert => $erlang_rhel_sslcacert_location, } + + if ($facts['os']['release']['major'] == '8') { + $erlang_version = '<25' + } + else { + $erlang_version = 'present' + } + package { $erlang_packages: + ensure => $erlang_version, + tag => ['st2::packages', 'st2::rabbitmq::packages'], + require => Yumrepo['erlang'], + } } elsif ($facts['os']['family'] == 'Debian') { $repos_ensure = true From 2083d40242a7f5549edfc7339b2ef5eb205e086c Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Fri, 20 May 2022 17:03:34 -0400 Subject: [PATCH 15/25] Removed fix and RabbitMQ pushed a new package. --- manifests/profile/rabbitmq.pp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/manifests/profile/rabbitmq.pp b/manifests/profile/rabbitmq.pp index f1ccc33d..e5c6eeab 100644 --- a/manifests/profile/rabbitmq.pp +++ b/manifests/profile/rabbitmq.pp @@ -56,18 +56,6 @@ sslverify => $erlang_rhel_sslverify, sslcacert => $erlang_rhel_sslcacert_location, } - - if ($facts['os']['release']['major'] == '8') { - $erlang_version = '<25' - } - else { - $erlang_version = 'present' - } - package { $erlang_packages: - ensure => $erlang_version, - tag => ['st2::packages', 'st2::rabbitmq::packages'], - require => Yumrepo['erlang'], - } } elsif ($facts['os']['family'] == 'Debian') { $repos_ensure = true From dc775f69f9e655d41d75cdcdbaeaf6d1f59990f1 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Fri, 20 May 2022 17:07:46 -0400 Subject: [PATCH 16/25] Added metrics to its own file. Fixed RabbitMQ errors. Fixed failing and incorrect tests. Updated tests to support new python version. Fixed all failing builds --- .github/workflows/build.yaml | 4 +- .kitchen.yml | 4 +- CHANGELOG.md | 16 +++--- build/centos7-puppet6/Puppetfile | 9 ++- build/centos7-puppet7/Puppetfile | 9 ++- build/ubuntu18-puppet6/Puppetfile | 9 ++- build/ubuntu18-puppet7/Puppetfile | 9 ++- build/ubuntu20-puppet6/Puppetfile | 9 ++- build/ubuntu20-puppet7/Puppetfile | 9 ++- manifests/init.pp | 4 ++ manifests/params.pp | 6 +- manifests/profile/metrics.pp | 55 +++++++++++++++++++ manifests/profile/rabbitmq.pp | 41 ++++++++------ manifests/profile/server.pp | 33 +---------- ...ll_python36.pp => fullinstall_python38.pp} | 4 +- metadata.json | 2 +- .../stackstorm/controls/services_test.rb | 4 +- test/unit/st2_test_case.py | 25 ++++++++- 18 files changed, 174 insertions(+), 78 deletions(-) create mode 100644 manifests/profile/metrics.pp rename manifests/test/{fullinstall_python36.pp => fullinstall_python38.pp} (81%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a534cee9..ff3902b3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -83,7 +83,7 @@ jobs: matrix: include: # note: actions/setup-python only allows using a major.minor releases - - python: '3.6' + - python: '3.8' make_target: 'python3' name: 'bolt tasks' steps: @@ -122,7 +122,7 @@ jobs: - ruby: '2.7' name: 'centos7-puppet7' - ruby: '2.7' - name: 'centos7-puppet7-python36' + name: 'centos7-puppet7-python38' - ruby: '2.7' name: 'ubuntu18-puppet6' - ruby: '2.7' diff --git a/.kitchen.yml b/.kitchen.yml index c4b84d07..899747d2 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -62,7 +62,7 @@ platforms: puppetfile_path: build/centos7-puppet7/Puppetfile # CentOS7 with Systemd - Puppet 7 - Python 3.6 - - name: centos7-puppet7-python36 + - name: centos7-puppet7-python38 driver: platform: centos dockerfile: build/centos7-puppet7/Dockerfile.kitchen @@ -71,7 +71,7 @@ platforms: - /sys/fs/cgroup:/sys/fs/cgroup:ro provisioner: puppetfile_path: build/centos7-puppet7/Puppetfile - manifest: test/fullinstall_python36.pp + manifest: test/fullinstall_python38.pp # Ubuntu Bionic with Systemd - Puppet 6 - name: ubuntu18-puppet6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 688e9c17..3dd7262e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Development +- Added the ability to manage StackStack metrics giving options for the metric driver, + host and port number defined in st2.conf. Contributed by @bishopbm1 + +- Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis + +- Fixed issues with RabbitMQ @bishopbm1 + +- Fixed and updated all tests @bishopbm1 + ## 2.4.0 (Mar 1, 2022) - Update RabbitMQ installer to use latest Erlang from RabbitMQ repos. Contributed by @rush-skills @@ -22,13 +31,6 @@ - Add configuration for redis based coordination and remove old style `$::osfamily` references. Contributed by @rush-skills -## 2.4.0 (Nov 17, 2021) - -- Added the ability to manage StackStack metrics giving options for the metric driver, - host and port number defined in st2.conf. Contributed by @bishopbm1 - -- Added nginx web route to get basic nginx metrics. Contributed by @asktheaxis - ## 2.3.0 (Sep 15, 2021) - Remove tests for Ubuntu 18.04 and Python3.6, since it's already default. Contributed by @rush-skills. diff --git a/build/centos7-puppet6/Puppetfile b/build/centos7-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/centos7-puppet6/Puppetfile +++ b/build/centos7-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/centos7-puppet7/Puppetfile b/build/centos7-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/centos7-puppet7/Puppetfile +++ b/build/centos7-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet6/Puppetfile b/build/ubuntu18-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu18-puppet6/Puppetfile +++ b/build/ubuntu18-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet7/Puppetfile b/build/ubuntu18-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu18-puppet7/Puppetfile +++ b/build/ubuntu18-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet6/Puppetfile b/build/ubuntu20-puppet6/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu20-puppet6/Puppetfile +++ b/build/ubuntu20-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet7/Puppetfile b/build/ubuntu20-puppet7/Puppetfile index ed3d8378..fba62ae0 100644 --- a/build/ubuntu20-puppet7/Puppetfile +++ b/build/ubuntu20-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -mod 'ghoneycutt-facter' +# mod 'ghoneycutt-facter' +mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' @@ -55,7 +56,11 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -mod 'puppet-rabbitmq' +# mod 'puppet-rabbitmq' +mod 'puppet/rabbitmq', + :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', + :branch => 'feature/fix-yum-repo', + :default_branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/manifests/init.pp b/manifests/init.pp index 389c1436..bc4c8cf5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -325,6 +325,10 @@ $erlang_key_id = $st2::params::erlang_key_id, $erlang_key_source = $st2::params::erlang_key_source, $erlang_packages = $st2::params::erlang_packages, + $erlang_rhel_sslcacert_location = $st2::params::erlang_rhel_sslcacert_location, + $erlang_rhel_sslverify = $st2::params::erlang_rhel_sslverify, + $erlang_rhel_gpgcheck = $st2::params::erlang_rhel_gpgcheck, + $erlang_rhel_repo_gpgcheck = $st2::params::erlang_rhel_repo_gpgcheck, $redis_bind_ip = $st2::params::redis_bind_ip, $redis_hostname = $st2::params::redis_hostname, $redis_port = $st2::params::redis_port, diff --git a/manifests/params.pp b/manifests/params.pp index f76abac3..375a44e5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -195,9 +195,13 @@ 'Debian' => "http://ppa.launchpad.net/rabbitmq/rabbitmq-erlang/${osname}", 'RedHat' => "https://packagecloud.io/rabbitmq/erlang/el/${facts['os'][release][major]}/\$basearch", } - $erlang_key = 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey' + $erlang_key = 'https://packagecloud.io/rabbitmq/erlang/gpgkey' $erlang_key_id = 'B279943D2A549531E144B875F77F1EDA57EBB1CC' $erlang_key_source = 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf77f1eda57ebb1cc' + $erlang_rhel_sslcacert_location = '/etc/pki/tls/certs/ca-bundle.crt' + $erlang_rhel_sslverify = 1 + $erlang_rhel_gpgcheck = 0 + $erlang_rhel_repo_gpgcheck = 1 $erlang_packages = [ 'erlang', ] diff --git a/manifests/profile/metrics.pp b/manifests/profile/metrics.pp new file mode 100644 index 00000000..8b420243 --- /dev/null +++ b/manifests/profile/metrics.pp @@ -0,0 +1,55 @@ +# @summary StackStorm compatable installation of MongoDB and dependencies. +# +# @param metrics_include +# Should metrics be enabled +# @param metric_driver +# The driver to use for the metrics. Default='statsd' +# @param metric_host +# The host to pull metrics from. Default='127.0.0.1' +# @param metric_port +# The port for the metrics. Default='8125' +# +# @example Basic Usage +# include st2::profile::metrics +# +# @example Customize (done via st2) +# class { 'st2': +# metrics_include => true, +# metric_driver => 'statsd', +# metric_host => '127.0.0.1', +# metric_port => '8125', +# } +# include st2::profile::metrics +# +class st2::profile::metrics ( + $metrics_include = $st2::metrics_include, + $metric_driver = $st2::metric_driver, + $metric_host = $st2::metric_host, + $metric_port = $st2::metric_port, +) inherits st2 { + if $metrics_include { + ini_setting { 'metrics_driver': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'driver', + value => $metric_driver, + tag => 'st2::config', + } + + ini_setting { 'metrics_host': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'host', + value => $metric_host, + tag => 'st2::config', + } + + ini_setting { 'metrics_port': + path => '/etc/st2/st2.conf', + section => 'metrics', + setting => 'port', + value => $metric_port, + tag => 'st2::config', + } + } +} diff --git a/manifests/profile/rabbitmq.pp b/manifests/profile/rabbitmq.pp index f5a78199..e5c6eeab 100644 --- a/manifests/profile/rabbitmq.pp +++ b/manifests/profile/rabbitmq.pp @@ -22,16 +22,20 @@ # include st2::profile::rabbitmq # class st2::profile::rabbitmq ( - $username = $st2::rabbitmq_username, - $password = $st2::rabbitmq_password, - $port = $st2::rabbitmq_port, - $bind_ip = $st2::rabbitmq_bind_ip, - $vhost = $st2::rabbitmq_vhost, - $erlang_url = $st2::erlang_url, - $erlang_key = $st2::erlang_key, - $erlang_key_id = $st2::erlang_key_id, - $erlang_key_source = $st2::erlang_key_source, - $erlang_packages = $st2::erlang_packages, + $username = $st2::rabbitmq_username, + $password = $st2::rabbitmq_password, + $port = $st2::rabbitmq_port, + $bind_ip = $st2::rabbitmq_bind_ip, + $vhost = $st2::rabbitmq_vhost, + $erlang_url = $st2::erlang_url, + $erlang_key = $st2::erlang_key, + $erlang_key_id = $st2::erlang_key_id, + $erlang_key_source = $st2::erlang_key_source, + $erlang_packages = $st2::erlang_packages, + $erlang_rhel_sslcacert_location = $st2::erlang_rhel_sslcacert_location, + $erlang_rhel_sslverify = $st2::erlang_rhel_sslverify, + $erlang_rhel_gpgcheck = $st2::erlang_rhel_gpgcheck, + $erlang_rhel_repo_gpgcheck = $st2::erlang_rhel_repo_gpgcheck, ) inherits st2 { # RHEL 8 Requires another repo in addition to epel to be installed @@ -41,13 +45,16 @@ # This is required because when using the latest version of rabbitmq because the latest version in EPEL # for Erlang is 22.0.7 which is not compatible: https://www.rabbitmq.com/which-erlang.html yumrepo { 'erlang': - ensure => present, - name => 'rabbitmq_erlang', - baseurl => $erlang_url, - gpgkey => $erlang_key, - enabled => 1, - gpgcheck => 1, - before => Class['rabbitmq::repo::rhel'], + ensure => present, + name => 'rabbitmq_erlang', + baseurl => $erlang_url, + gpgkey => $erlang_key, + enabled => 1, + gpgcheck => $erlang_rhel_gpgcheck, + repo_gpgcheck => $erlang_rhel_repo_gpgcheck, + before => Class['rabbitmq::repo::rhel'], + sslverify => $erlang_rhel_sslverify, + sslcacert => $erlang_rhel_sslcacert_location, } } elsif ($facts['os']['family'] == 'Debian') { diff --git a/manifests/profile/server.pp b/manifests/profile/server.pp index 3cf2ade3..35b12c18 100644 --- a/manifests/profile/server.pp +++ b/manifests/profile/server.pp @@ -67,10 +67,6 @@ $redis_hostname = $st2::redis_hostname, $redis_port = $st2::redis_port, $redis_password = $st2::redis_password, - $metrics_include = $st2::metrics_include, - $metric_driver = $st2::metric_driver, - $metric_host = $st2::metric_host, - $metric_port = $st2::metric_port, $index_url = $st2::index_url, $packs_group = $st2::packs_group_name, $validate_output_schema = $st2::validate_output_schema, @@ -292,33 +288,6 @@ tag => 'st2::config', } - ## Metrics Settings - if $metrics_include { - ini_setting { 'metrics_driver': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'driver', - value => $metric_driver, - tag => 'st2::config', - } - - ini_setting { 'metrics_host': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'host', - value => $metric_host, - tag => 'st2::config', - } - - ini_setting { 'metrics_port': - path => '/etc/st2/st2.conf', - section => 'metrics', - setting => 'port', - value => $metric_port, - tag => 'st2::config', - } - } - ## Resultstracker Settings ini_setting { 'resultstracker_logging': @@ -360,6 +329,8 @@ tag => 'st2::config', } + class { 'st2::profile::metrics': } + ## Syslog Settings ini_setting { 'syslog_host': ensure => present, diff --git a/manifests/test/fullinstall_python36.pp b/manifests/test/fullinstall_python38.pp similarity index 81% rename from manifests/test/fullinstall_python36.pp rename to manifests/test/fullinstall_python38.pp index e8fba26a..d98fa13d 100644 --- a/manifests/test/fullinstall_python36.pp +++ b/manifests/test/fullinstall_python38.pp @@ -1,7 +1,7 @@ # Test for installing standalone StackStorm using Python 3.6 $st2_python_version = $facts['os']['family'] ? { - 'RedHat' => '3.6', - 'Debian' => 'python3.6', + 'RedHat' => '3.8', + 'Debian' => 'python3.8', } class { 'st2': python_version => $st2_python_version, diff --git a/metadata.json b/metadata.json index 53891274..c5ce336a 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "stackstorm-st2", - "version": "2.4.0", + "version": "2.5.0", "author": "stackstorm", "summary": "Puppet module to manage/configure StackStorm", "license": "Apache-2.0", diff --git a/test/integration/stackstorm/controls/services_test.rb b/test/integration/stackstorm/controls/services_test.rb index 99baf030..35e5c3a7 100644 --- a/test/integration/stackstorm/controls/services_test.rb +++ b/test/integration/stackstorm/controls/services_test.rb @@ -27,14 +27,14 @@ # st2auth describe port(9100) do it { should be_listening } - its('addresses') { should include '0.0.0.0' } + its('addresses') { should include '127.0.0.1' } its('protocols') { should cmp 'tcp' } end # st2api describe port(9101) do it { should be_listening } - its('addresses') { should include '0.0.0.0' } + its('addresses') { should include '127.0.0.1' } its('protocols') { should cmp 'tcp' } end diff --git a/test/unit/st2_test_case.py b/test/unit/st2_test_case.py index 5a92fd44..bdc9209d 100644 --- a/test/unit/st2_test_case.py +++ b/test/unit/st2_test_case.py @@ -1,8 +1,10 @@ import yaml import json import logging +import os +import inspect -from unittest import TestCase +from unittest2 import TestCase class St2TestCase(TestCase): @@ -16,6 +18,27 @@ def tearDown(self): super(St2TestCase, self).tearDown() logging.disable(logging.NOTSET) # enable logging + def get_fixture_content(self, fixture_path): + """ + Return raw fixture content for the provided fixture path. + :param fixture_path: Fixture path relative to the tests/fixtures/ directory. + :type fixture_path: ``str`` + """ + base_pack_path = self._get_base_pack_path() + fixtures_path = os.path.join(base_pack_path, "tests/fixtures/") + fixture_path = os.path.join(fixtures_path, fixture_path) + + with open(fixture_path, "r") as fp: + content = fp.read() + + return content + + def _get_base_pack_path(self): + test_file_path = inspect.getfile(self.__class__) + base_pack_path = os.path.join(os.path.dirname(test_file_path), "..") + base_pack_path = os.path.abspath(base_pack_path) + return base_pack_path + def load_yaml(self, filename): return yaml.safe_load(self.get_fixture_content(filename)) From 3bb372f9bb39a75d1267ae2aa2f7c095b3cdbf6d Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 00:45:35 -0400 Subject: [PATCH 17/25] Adding comments to code and and override for the basic status report. --- build/centos7-puppet6/Puppetfile | 6 +- build/centos7-puppet7/Puppetfile | 6 +- build/ubuntu18-puppet6/Puppetfile | 6 +- build/ubuntu18-puppet7/Puppetfile | 6 +- build/ubuntu20-puppet6/Puppetfile | 6 +- build/ubuntu20-puppet7/Puppetfile | 6 +- manifests/init.pp | 179 +++++++++++++++--------------- manifests/params.pp | 1 + manifests/profile/web.pp | 45 ++++---- 9 files changed, 139 insertions(+), 122 deletions(-) diff --git a/build/centos7-puppet6/Puppetfile b/build/centos7-puppet6/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/centos7-puppet6/Puppetfile +++ b/build/centos7-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/build/centos7-puppet7/Puppetfile b/build/centos7-puppet7/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/centos7-puppet7/Puppetfile +++ b/build/centos7-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/build/ubuntu18-puppet6/Puppetfile b/build/ubuntu18-puppet6/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/ubuntu18-puppet6/Puppetfile +++ b/build/ubuntu18-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/build/ubuntu18-puppet7/Puppetfile b/build/ubuntu18-puppet7/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/ubuntu18-puppet7/Puppetfile +++ b/build/ubuntu18-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/build/ubuntu20-puppet6/Puppetfile b/build/ubuntu20-puppet6/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/ubuntu20-puppet6/Puppetfile +++ b/build/ubuntu20-puppet6/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/build/ubuntu20-puppet7/Puppetfile b/build/ubuntu20-puppet7/Puppetfile index fba62ae0..b36b51ed 100644 --- a/build/ubuntu20-puppet7/Puppetfile +++ b/build/ubuntu20-puppet7/Puppetfile @@ -44,7 +44,8 @@ # └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" -# mod 'ghoneycutt-facter' +# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70 +# in latest release. Pinning to 3.5 until resolved. mod 'ghoneycutt/facter', '3.5.0' mod 'jamtur01-httpauth' mod 'npwalker-recursive_file_permissions' @@ -56,7 +57,8 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# mod 'puppet-rabbitmq' +# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be +# merged into upstream repo. mod 'puppet/rabbitmq', :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', :branch => 'feature/fix-yum-repo', diff --git a/manifests/init.pp b/manifests/init.pp index bc4c8cf5..1f5794c7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -259,87 +259,88 @@ # python_version => $st2_python_version, # } class st2( - $version = 'present', - String $python_version = 'system', + $version = 'present', + String $python_version = 'system', St2::Repository $repository = $st2::params::repository, - $conf_dir = $st2::params::conf_dir, - $conf_file = "${st2::params::conf_dir}/st2.conf", - $use_ssl = $st2::params::use_ssl, - $ssl_cert_manage = true, - $ssl_dir = $st2::params::ssl_dir, - $ssl_cert = $st2::params::ssl_cert, - $ssl_key = $st2::params::ssl_key, - $auth = true, - $auth_api_url = "http://${st2::params::hostname}:${st2::params::api_port}", - $auth_debug = false, - $auth_mode = $st2::params::auth_mode, - $auth_backend = $st2::params::auth_backend, - $auth_backend_config = $st2::params::auth_backend_config, - $cli_base_url = "http://${st2::params::hostname}", - $cli_api_version = 'v1', - $cli_debug = false, - $cli_cache_token = true, - $cli_silence_ssl_warnings = false, - $cli_username = $st2::params::admin_username, - $cli_password = $st2::params::admin_password, - $cli_apikey = undef, - $cli_api_url = "http://${st2::params::hostname}:${st2::params::api_port}", - $cli_auth_url = "http://${st2::params::hostname}:${st2::params::auth_port}", - $actionrunner_workers = $st2::params::actionrunner_workers, - $packs = {}, - $packs_group = $st2::params::packs_group_name, - $index_url = undef, - $syslog = false, - $syslog_host = 'localhost', - $syslog_protocol = 'udp', - $syslog_port = 514, - $syslog_facility = 'local7', - $ssh_key_location = '/home/stanley/.ssh/st2_stanley_key', - $db_host = $st2::params::hostname, - $db_port = $st2::params::mongodb_port, - $db_bind_ips = $st2::params::mongodb_bind_ips, - $db_name = $st2::params::mongodb_st2_db, - $db_username = $st2::params::mongodb_st2_username, - $db_password = $st2::params::admin_password, - $mongodb_version = undef, - $mongodb_manage_repo = true, - $mongodb_auth = true, - $ng_init = true, - $datastore_keys_dir = $st2::params::datstore_keys_dir, - $datastore_key_path = "${st2::params::datstore_keys_dir}/datastore_key.json", - $nginx_basicstatus_port = $st2::params::basicstatus_port, - $nginx_manage_repo = true, + $conf_dir = $st2::params::conf_dir, + $conf_file = "${st2::params::conf_dir}/st2.conf", + $use_ssl = $st2::params::use_ssl, + $ssl_cert_manage = true, + $ssl_dir = $st2::params::ssl_dir, + $ssl_cert = $st2::params::ssl_cert, + $ssl_key = $st2::params::ssl_key, + $auth = true, + $auth_api_url = "http://${st2::params::hostname}:${st2::params::api_port}", + $auth_debug = false, + $auth_mode = $st2::params::auth_mode, + $auth_backend = $st2::params::auth_backend, + $auth_backend_config = $st2::params::auth_backend_config, + $cli_base_url = "http://${st2::params::hostname}", + $cli_api_version = 'v1', + $cli_debug = false, + $cli_cache_token = true, + $cli_silence_ssl_warnings = false, + $cli_username = $st2::params::admin_username, + $cli_password = $st2::params::admin_password, + $cli_apikey = undef, + $cli_api_url = "http://${st2::params::hostname}:${st2::params::api_port}", + $cli_auth_url = "http://${st2::params::hostname}:${st2::params::auth_port}", + $actionrunner_workers = $st2::params::actionrunner_workers, + $packs = {}, + $packs_group = $st2::params::packs_group_name, + $index_url = undef, + $syslog = false, + $syslog_host = 'localhost', + $syslog_protocol = 'udp', + $syslog_port = 514, + $syslog_facility = 'local7', + $ssh_key_location = '/home/stanley/.ssh/st2_stanley_key', + $db_host = $st2::params::hostname, + $db_port = $st2::params::mongodb_port, + $db_bind_ips = $st2::params::mongodb_bind_ips, + $db_name = $st2::params::mongodb_st2_db, + $db_username = $st2::params::mongodb_st2_username, + $db_password = $st2::params::admin_password, + $mongodb_version = undef, + $mongodb_manage_repo = true, + $mongodb_auth = true, + $ng_init = true, + $datastore_keys_dir = $st2::params::datstore_keys_dir, + $datastore_key_path = "${st2::params::datstore_keys_dir}/datastore_key.json", + $nginx_basicstatus_enabled = $st2::params::nginx_basicstatus_enabled, + $nginx_basicstatus_port = $st2::params::basicstatus_port, + $nginx_manage_repo = true, $nginx_client_max_body_size = $st2::params::nginx_client_max_body_size, - $nginx_ssl_ciphers = $st2::params::nginx_ssl_ciphers, - $nginx_ssl_port = $st2::params::nginx_ssl_port, - $nginx_ssl_protocols = $st2::params::nginx_ssl_protocols, - $web_root = $st2::params::web_root, - $rabbitmq_username = $st2::params::rabbitmq_username, - $rabbitmq_password = $st2::params::rabbitmq_password, - $rabbitmq_hostname = $st2::params::rabbitmq_hostname, - $rabbitmq_port = $st2::params::rabbitmq_port, - $rabbitmq_bind_ip = $st2::params::rabbitmq_bind_ip, - $rabbitmq_vhost = $st2::params::rabbitmq_vhost, - $erlang_url = $st2::params::erlang_url, - $erlang_key = $st2::params::erlang_key, - $erlang_key_id = $st2::params::erlang_key_id, - $erlang_key_source = $st2::params::erlang_key_source, - $erlang_packages = $st2::params::erlang_packages, + $nginx_ssl_ciphers = $st2::params::nginx_ssl_ciphers, + $nginx_ssl_port = $st2::params::nginx_ssl_port, + $nginx_ssl_protocols = $st2::params::nginx_ssl_protocols, + $web_root = $st2::params::web_root, + $rabbitmq_username = $st2::params::rabbitmq_username, + $rabbitmq_password = $st2::params::rabbitmq_password, + $rabbitmq_hostname = $st2::params::rabbitmq_hostname, + $rabbitmq_port = $st2::params::rabbitmq_port, + $rabbitmq_bind_ip = $st2::params::rabbitmq_bind_ip, + $rabbitmq_vhost = $st2::params::rabbitmq_vhost, + $erlang_url = $st2::params::erlang_url, + $erlang_key = $st2::params::erlang_key, + $erlang_key_id = $st2::params::erlang_key_id, + $erlang_key_source = $st2::params::erlang_key_source, + $erlang_packages = $st2::params::erlang_packages, $erlang_rhel_sslcacert_location = $st2::params::erlang_rhel_sslcacert_location, - $erlang_rhel_sslverify = $st2::params::erlang_rhel_sslverify, - $erlang_rhel_gpgcheck = $st2::params::erlang_rhel_gpgcheck, - $erlang_rhel_repo_gpgcheck = $st2::params::erlang_rhel_repo_gpgcheck, - $redis_bind_ip = $st2::params::redis_bind_ip, - $redis_hostname = $st2::params::redis_hostname, - $redis_port = $st2::params::redis_port, - $redis_password = $st2::params::redis_password, - $timersengine_enabled = $st2::params::timersengine_enabled, - $timersengine_timezone = $st2::params::timersengine_timezone, - $scheduler_sleep_interval = $st2::params::scheduler_sleep_interval, - $scheduler_gc_interval = $st2::params::scheduler_gc_interval, - $scheduler_pool_size = $st2::params::scheduler_pool_size, - $chatops_adapter = $st2::params::chatops_adapter, - $chatops_adapter_conf = $st2::params::chatops_adapter_conf, + $erlang_rhel_sslverify = $st2::params::erlang_rhel_sslverify, + $erlang_rhel_gpgcheck = $st2::params::erlang_rhel_gpgcheck, + $erlang_rhel_repo_gpgcheck = $st2::params::erlang_rhel_repo_gpgcheck, + $redis_bind_ip = $st2::params::redis_bind_ip, + $redis_hostname = $st2::params::redis_hostname, + $redis_port = $st2::params::redis_port, + $redis_password = $st2::params::redis_password, + $timersengine_enabled = $st2::params::timersengine_enabled, + $timersengine_timezone = $st2::params::timersengine_timezone, + $scheduler_sleep_interval = $st2::params::scheduler_sleep_interval, + $scheduler_gc_interval = $st2::params::scheduler_gc_interval, + $scheduler_pool_size = $st2::params::scheduler_pool_size, + $chatops_adapter = $st2::params::chatops_adapter, + $chatops_adapter_conf = $st2::params::chatops_adapter_conf, $chatops_hubot_log_level = $st2::params::hubot_log_level, $chatops_hubot_express_port = $st2::params::hubot_express_port, $chatops_tls_cert_reject_unauthorized = $st2::params::tls_cert_reject_unauthorized, @@ -350,17 +351,17 @@ $chatops_api_url = "https://${st2::params::hostname}/api", $chatops_auth_url = "https://${st2::params::hostname}/auth", $chatops_web_url = undef, - $nodejs_version = undef, - $nodejs_manage_repo = true, - $workflowengine_num = $st2::params::workflowengine_num, - $scheduler_num = $st2::params::scheduler_num, - $rulesengine_num = $st2::params::rulesengine_num, - $notifier_num = $st2::params::notifier_num, - $metrics_include = $st2::params::metrics_include, - $metric_driver = $st2::params::metric_driver, - $metric_host = $st2::params::metric_host, - $metric_port = $st2::params::metric_port, - $validate_output_schema = $st2::params::validate_output_schema, + $nodejs_version = undef, + $nodejs_manage_repo = true, + $workflowengine_num = $st2::params::workflowengine_num, + $scheduler_num = $st2::params::scheduler_num, + $rulesengine_num = $st2::params::rulesengine_num, + $notifier_num = $st2::params::notifier_num, + $metrics_include = $st2::params::metrics_include, + $metric_driver = $st2::params::metric_driver, + $metric_host = $st2::params::metric_host, + $metric_port = $st2::params::metric_port, + $validate_output_schema = $st2::params::validate_output_schema, ) inherits st2::params { ######################################## diff --git a/manifests/params.pp b/manifests/params.pp index 375a44e5..14288173 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -48,6 +48,7 @@ # nginx basic status port $basicstatus_port = 9103 + $basicstatus_enabled = false # Non-user configurable parameters $repository = 'stable' diff --git a/manifests/profile/web.pp b/manifests/profile/web.pp index 6c0e1192..1e1bc724 100644 --- a/manifests/profile/web.pp +++ b/manifests/profile/web.pp @@ -72,6 +72,7 @@ String $version = $st2::version, String $web_root = $st2::web_root, Integer $basicstatus_port = $st2::nginx_basicstatus_port, + Boolean $basicstatus_enabled = $st2::nginx_basicstatus_enabled, ) inherits st2 { # include nginx here only # if we include this in st2::profile::fullinstall Anchor['pre_reqs'] then @@ -238,30 +239,32 @@ }, } - nginx::resource::location { '@basic_statusError': - * => $location_defaults + { - add_header => { - 'Content-Type' => 'application/json always', - }, - location_cfg_append => { - 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', + if $basicstatus_enabled { + nginx::resource::location { '@basic_statusError': + * => $location_defaults + { + add_header => { + 'Content-Type' => 'application/json always', + }, + location_cfg_append => { + 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', + }, + tag => ['st2', 'st2::backend', 'st2::backend::basicstatuserror'], }, - tag => ['st2', 'st2::backend', 'st2::backend::basicstatuserror'], - }, - } + } - nginx::resource::location { '/basic_status/': - * => $proxy_defaults + { - rewrite_rules => [ - '^/api/(.*) /$1 break', - ], - proxy => "http://127.0.0.1:${basicstatus_port}", - location_cfg_append => { - 'error_page' => '502 = @basic_statusError', - 'stub_status' => 'on', + nginx::resource::location { '/basic_status/': + * => $proxy_defaults + { + rewrite_rules => [ + '^/api/(.*) /$1 break', + ], + proxy => "http://127.0.0.1:${basicstatus_port}", + location_cfg_append => { + 'error_page' => '502 = @basic_statusError', + 'stub_status' => 'on', + }, + tag => ['st2', 'st2::backend', 'st2::backend::basic_status'], }, - tag => ['st2', 'st2::backend', 'st2::backend::basic_status'], - }, + } } nginx::resource::location { '@streamError': From 43e04e7e70cb438c9d7a526d4c6b8e4754e12a43 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 09:28:18 -0400 Subject: [PATCH 18/25] attempting to fix tests. --- spec/classes/profile/web_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 2ee26fd3..c6521565 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -150,6 +150,7 @@ tag: ['st2', 'st2::backend', 'st2::backend::api']) end it do + let(:params) { { nginx_basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('@basic_statusError') .with(ensure: 'present', server: 'ssl-st2webui', @@ -165,6 +166,7 @@ tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) end it do + let(:params) { { nginx_basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('/basic_status/') .with(ensure: 'present', server: 'ssl-st2webui', From 906cbcb723c65a0794e8955622cf0ad5203b1288 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 09:44:00 -0400 Subject: [PATCH 19/25] Fixing tests. --- spec/classes/profile/nginx_spec.rb | 12 ++++++++++++ spec/classes/profile/web_spec.rb | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/spec/classes/profile/nginx_spec.rb b/spec/classes/profile/nginx_spec.rb index 36a96229..2d12dfc8 100644 --- a/spec/classes/profile/nginx_spec.rb +++ b/spec/classes/profile/nginx_spec.rb @@ -10,6 +10,12 @@ context "on #{os}" do context 'with default options' do + let(:params) do + { + nginx_basicstatus_enabled: true, + } + end + it { is_expected.to compile.with_all_deps } it do is_expected.to contain_class('nginx') @@ -20,6 +26,12 @@ context 'with manage_repo=false' do let(:params) { { manage_repo: false } } + let(:params) do + { + manage_repo: false, + nginx_basicstatus_enabled: true, + } + end it { is_expected.to compile.with_all_deps } it do diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index c6521565..311884e2 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -39,6 +39,11 @@ context "on #{os}" do context 'with default options' do + let(:params) do + { + nginx_basicstatus_enabled: true, + } + end it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('st2::profile::nginx') } it do @@ -150,7 +155,6 @@ tag: ['st2', 'st2::backend', 'st2::backend::api']) end it do - let(:params) { { nginx_basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('@basic_statusError') .with(ensure: 'present', server: 'ssl-st2webui', @@ -166,7 +170,6 @@ tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) end it do - let(:params) { { nginx_basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('/basic_status/') .with(ensure: 'present', server: 'ssl-st2webui', From 56878e8732650410e1de0d01f73ab39f81c59d34 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 09:47:28 -0400 Subject: [PATCH 20/25] Fixing syntax issue. --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1f5794c7..cbb70fc7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -307,7 +307,7 @@ $ng_init = true, $datastore_keys_dir = $st2::params::datstore_keys_dir, $datastore_key_path = "${st2::params::datstore_keys_dir}/datastore_key.json", - $nginx_basicstatus_enabled = $st2::params::nginx_basicstatus_enabled, + $nginx_basicstatus_enabled = $st2::params::basicstatus_enabled, $nginx_basicstatus_port = $st2::params::basicstatus_port, $nginx_manage_repo = true, $nginx_client_max_body_size = $st2::params::nginx_client_max_body_size, From 0d1cd03dae2ffde6c9fdbbd571c03496bd25319f Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 09:53:40 -0400 Subject: [PATCH 21/25] Removing params. --- spec/classes/profile/nginx_spec.rb | 11 ----------- spec/classes/profile/web_spec.rb | 5 ----- 2 files changed, 16 deletions(-) diff --git a/spec/classes/profile/nginx_spec.rb b/spec/classes/profile/nginx_spec.rb index 2d12dfc8..b38ff597 100644 --- a/spec/classes/profile/nginx_spec.rb +++ b/spec/classes/profile/nginx_spec.rb @@ -10,11 +10,6 @@ context "on #{os}" do context 'with default options' do - let(:params) do - { - nginx_basicstatus_enabled: true, - } - end it { is_expected.to compile.with_all_deps } it do @@ -26,12 +21,6 @@ context 'with manage_repo=false' do let(:params) { { manage_repo: false } } - let(:params) do - { - manage_repo: false, - nginx_basicstatus_enabled: true, - } - end it { is_expected.to compile.with_all_deps } it do diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 311884e2..2ee26fd3 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -39,11 +39,6 @@ context "on #{os}" do context 'with default options' do - let(:params) do - { - nginx_basicstatus_enabled: true, - } - end it { is_expected.to compile.with_all_deps } it { is_expected.to contain_class('st2::profile::nginx') } it do From 0434c623cc9ce8c84527a1a7264f2ee14fbb3eff Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 09:59:22 -0400 Subject: [PATCH 22/25] Down to only 8 failing tests. --- spec/classes/profile/nginx_spec.rb | 1 - spec/classes/profile/web_spec.rb | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/classes/profile/nginx_spec.rb b/spec/classes/profile/nginx_spec.rb index b38ff597..36a96229 100644 --- a/spec/classes/profile/nginx_spec.rb +++ b/spec/classes/profile/nginx_spec.rb @@ -10,7 +10,6 @@ context "on #{os}" do context 'with default options' do - it { is_expected.to compile.with_all_deps } it do is_expected.to contain_class('nginx') diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 2ee26fd3..61a01e2b 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -150,6 +150,7 @@ tag: ['st2', 'st2::backend', 'st2::backend::api']) end it do + let(:params) { { basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('@basic_statusError') .with(ensure: 'present', server: 'ssl-st2webui', @@ -165,6 +166,7 @@ tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) end it do + let(:params) { { basicstatus_enabled: true } } is_expected.to contain_nginx__resource__location('/basic_status/') .with(ensure: 'present', server: 'ssl-st2webui', From 3d2defbcea9766068d900fea20bb8512786918f8 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Mon, 23 May 2022 10:05:39 -0400 Subject: [PATCH 23/25] moving basic status to its own test since not enabled by default. --- spec/classes/profile/web_spec.rb | 64 +++++++++++++++++--------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/spec/classes/profile/web_spec.rb b/spec/classes/profile/web_spec.rb index 61a01e2b..ae290998 100644 --- a/spec/classes/profile/web_spec.rb +++ b/spec/classes/profile/web_spec.rb @@ -149,36 +149,6 @@ }, tag: ['st2', 'st2::backend', 'st2::backend::api']) end - it do - let(:params) { { basicstatus_enabled: true } } - is_expected.to contain_nginx__resource__location('@basic_statusError') - .with(ensure: 'present', - server: 'ssl-st2webui', - ssl: true, - ssl_only: true, - index_files: [], - add_header: { - 'Content-Type' => 'application/json always', - }, - location_cfg_append: { - 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', - }, - tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) - end - it do - let(:params) { { basicstatus_enabled: true } } - is_expected.to contain_nginx__resource__location('/basic_status/') - .with(ensure: 'present', - server: 'ssl-st2webui', - ssl: true, - ssl_only: true, - index_files: [], - location_cfg_append: { - 'error_page' => '502 = @basic_statusError', - 'stub_status' => 'on', - }, - tag: ['st2', 'st2::backend', 'st2::backend::basic_status']) - end it do is_expected.to contain_nginx__resource__location('@streamError') .with(ensure: 'present', @@ -407,6 +377,40 @@ it { is_expected.to compile.with_all_deps } it { is_expected.not_to contain_exec('generate ssl cert /etc/ssl/st2/st2.crt') } end # context 'with ssl_cert_manage=false' + + context 'with basicstatus_enabled=true' do + let(:params) { { basicstatus_enabled: true } } + + it { is_expected.to compile.with_all_deps } + it do + is_expected.to contain_nginx__resource__location('@basic_statusError') + .with(ensure: 'present', + server: 'ssl-st2webui', + ssl: true, + ssl_only: true, + index_files: [], + add_header: { + 'Content-Type' => 'application/json always', + }, + location_cfg_append: { + 'return' => '503 \'{ "faultstring": "Nginx is unable to reach basic_status. Make sure service is running." }\'', + }, + tag: ['st2', 'st2::backend', 'st2::backend::basicstatuserror']) + end + it do + is_expected.to contain_nginx__resource__location('/basic_status/') + .with(ensure: 'present', + server: 'ssl-st2webui', + ssl: true, + ssl_only: true, + index_files: [], + location_cfg_append: { + 'error_page' => '502 = @basic_statusError', + 'stub_status' => 'on', + }, + tag: ['st2', 'st2::backend', 'st2::backend::basic_status']) + end + end # context 'basicstatus_enabled=true' end # context 'on #{os}' end # on_supported_os(all_os) end # describe 'st2::profile::server' From 9415cc21e7d955cd0338db792bd1e233c8301549 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Fri, 27 May 2022 01:16:18 -0400 Subject: [PATCH 24/25] Switching builds to upstream. --- build/centos7-puppet6/Puppetfile | 8 +++----- build/centos7-puppet7/Puppetfile | 8 +++----- build/ubuntu18-puppet6/Puppetfile | 8 +++----- build/ubuntu18-puppet7/Puppetfile | 8 +++----- build/ubuntu20-puppet6/Puppetfile | 8 +++----- build/ubuntu20-puppet7/Puppetfile | 8 +++----- 6 files changed, 18 insertions(+), 30 deletions(-) diff --git a/build/centos7-puppet6/Puppetfile b/build/centos7-puppet6/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/centos7-puppet6/Puppetfile +++ b/build/centos7-puppet6/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/centos7-puppet7/Puppetfile b/build/centos7-puppet7/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/centos7-puppet7/Puppetfile +++ b/build/centos7-puppet7/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet6/Puppetfile b/build/ubuntu18-puppet6/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/ubuntu18-puppet6/Puppetfile +++ b/build/ubuntu18-puppet6/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu18-puppet7/Puppetfile b/build/ubuntu18-puppet7/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/ubuntu18-puppet7/Puppetfile +++ b/build/ubuntu18-puppet7/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet6/Puppetfile b/build/ubuntu20-puppet6/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/ubuntu20-puppet6/Puppetfile +++ b/build/ubuntu20-puppet6/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' diff --git a/build/ubuntu20-puppet7/Puppetfile b/build/ubuntu20-puppet7/Puppetfile index b36b51ed..83a201d4 100644 --- a/build/ubuntu20-puppet7/Puppetfile +++ b/build/ubuntu20-puppet7/Puppetfile @@ -57,12 +57,10 @@ mod 'puppet-nginx' mod 'puppetlabs-concat' # dependency of puppet-nginx' mod 'puppet-nodejs' mod 'puppet-python' -# Waiting on https://github.com/voxpupuli/puppet-rabbitmq/pull/907 to be -# merged into upstream repo. +# Using master branch due to new release on hold pending new tests. mod 'puppet/rabbitmq', - :git => 'https://github.com/EncoreTechnologies/puppet-rabbitmq.git', - :branch => 'feature/fix-yum-repo', - :default_branch => 'master' + :git => 'https://github.com/voxpupuli/puppet-rabbitmq.git', + :branch => 'master' mod 'camptocamp-systemd' # dependency of puppet-rabbitmq mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' From 0a4faf2657ec3209507fc8ff701181e13a536e56 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Tue, 7 Jun 2022 12:35:27 -0400 Subject: [PATCH 25/25] Updated readme with new metrics parameters and how those can be used. Also updated other pieces of documentation for python 3.8 --- README.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e2234b09..ac0997ff 100644 --- a/README.md +++ b/README.md @@ -125,8 +125,8 @@ Hiera data bindings. A few notable parameters to take note of: being taken (proper steps detailed here: https://docs.stackstorm.com/install/upgrades.html) * `st2::python_version` - Version to Python to use. The default is `'system'` and the system `python` package will be installed, whatever version that is for your OS. - To explicitly install Python 3.6 specify `'3.6'` if on RHEL/CentOS 7. - If on Ubuntu 16.04 specify `'python3.6'`. + To explicitly install Python 3.8 specify `'3.8'` if on RHEL/CentOS 7. + If on Ubuntu 16.04 specify `'python3.8'`. **Notes** * RHEL 7 - The Red Hat subscription repo `'rhel-7-server-optional-rpms'` will need to be enabled prior to running this module. @@ -134,12 +134,12 @@ Hiera data bindings. A few notable parameters to take note of: ```puppet # CentOS/RHEL 7 class { 'st2': - python_version => '3.6', + python_version => '3.8', } # Ubuntu 18.04/20.04 class { 'st2': - python_version => 'python3.6', + python_version => 'python3.8', } contain st2::profile::fullinstall @@ -161,6 +161,7 @@ classes for use and configuration. * `st2::proflle::server` - st2 server components * `st2::profile::web` - st2 web components * `st2::profile::chatops` - st2 chatops components +* `st2::profile::metrics` - st2 set up metrics #### Installing and Configuring Packs @@ -331,7 +332,7 @@ that can be higher on CPU and Memory to allow more processes to run at the same Configuration all services: ```ruby class { 'st2': - python_version => '3.6', + python_version => '3.8', workflowengine_num => 4, scheduler_num => 2, rulesengine_num => 1, @@ -466,6 +467,24 @@ $res = run_task('st2::key_get', $stackstorm_target, password => $password) ``` +#### Metrics + +This module provides the ability to set up the metrics endpoints to expose different metrics built into StackStorm as documented here: +https://docs.stackstorm.com/reference/metrics.html + +There is also an addition metric that can be auto created which exposes the basic health for NGINX called a basic status page. + +```ruby +class { 'st2': + python_version => '3.8', + metrics_include => true, + nginx_basicstatus_enabled => true, +} +``` + +Once these metrics are setup and enabled it gives the ability to scrape those metrics with an outside source like telegraf +or prometheus or any other scraping tool. + ## Limitations ### Supported platforms