Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor the module to independently manage services and scale out in HA #344

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
02d4abf
first round of refactor and reorganization of the module
rush-skills Nov 23, 2021
b9a434e
fix chatops include
rush-skills Nov 23, 2021
751ba9e
remove depricated anchor statements
rush-skills Nov 23, 2021
591cf6e
update ha structure, add single test for dev
rush-skills Nov 23, 2021
70b4423
disable extra workflows for dev
rush-skills Nov 23, 2021
a730fae
add k/v setup support with apikey
rush-skills Nov 24, 2021
5229292
fix variable names for k/v apikey support
rush-skills Nov 24, 2021
e92a235
add ability to specify a pack version in the pack resource
rush-skills Nov 24, 2021
ca6d1f4
update changelog
rush-skills Nov 24, 2021
6d8e756
rubocop fixes
rush-skills Nov 24, 2021
f15c7d8
fix test profiles
rush-skills Nov 24, 2021
c176958
rework runner sysconfig configuration
rush-skills Nov 24, 2021
c18eb53
rework ha test
rush-skills Nov 24, 2021
a34da9d
segment db config includes
rush-skills Nov 24, 2021
3a652d0
fix ldap service dependency
rush-skills Feb 24, 2022
fda76e4
revert ldap service dependency change
rush-skills Feb 24, 2022
738d1ce
add cli config params and st2::hostname setting
rush-skills Feb 24, 2022
e8948a2
fix hostname refs to https
rush-skills Feb 24, 2022
cbd09d6
add stream url to cli settings
rush-skills Feb 24, 2022
f68e58c
revert build pipeline changes
rush-skills Feb 24, 2022
2439538
don't handle ssl dir in web.pp
rush-skills Feb 24, 2022
462bc44
make ssl dir management configurable
rush-skills Feb 24, 2022
cf36d7b
Merge branch 'master' into refactor
rush-skills Mar 1, 2022
3fbd684
fix rabbitmq classname
rush-skills Mar 1, 2022
4a8b87d
silence cli ssl warning in integration test
rush-skills Mar 1, 2022
564e26e
fix indentation
rush-skills Mar 1, 2022
16f5533
add docs for stream_url in client
rush-skills Mar 1, 2022
58489d7
fix actionrunner docs
rush-skills Mar 1, 2022
14c9e07
fix sensor docs
rush-skills Mar 1, 2022
3e4f6ef
fix workflow engine docs
rush-skills Mar 1, 2022
ed02f5b
fix web docs
rush-skills Mar 1, 2022
4128dd3
fix timerengine docs
rush-skills Mar 1, 2022
fca3e23
fix docs for other components
rush-skills Mar 1, 2022
3ba30a2
documentation changes
rush-skills Mar 1, 2022
4bcd54b
remove unused params from server profile
rush-skills Mar 1, 2022
5713182
documentation changes for web/api/auth
rush-skills Mar 1, 2022
332a08d
Merge branch 'master' into refactor
rush-skills Jun 8, 2022
a8f0ac5
fix broken merge
rush-skills Jun 8, 2022
766e751
Merge branch 'master' into refactor
rush-skills Jun 9, 2022
e32055e
added ha test in ci integration tests
rush-skills Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ platforms:
puppetfile_path: build/rocky8-puppet7/Puppetfile
manifest: test/fullinstall_python38.pp

# RockyLinux 8 - Puppet 7
- name: rocky8-puppet7-hatest
driver:
platform: rockylinux
dockerfile: build/rocky8-puppet7/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/rocky8-puppet7/Puppetfile
manifest: test/fullinstall_hatest.pp

# Ubuntu Bionic with Systemd - Puppet 6
- name: ubuntu18-puppet6
driver:
Expand Down
10 changes: 9 additions & 1 deletion manifests/client/settings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# URL of the StackStorm API service
# @param auth_url
# URL of the StackStorm Auth service
# @param stream_url
# URL of the StackStorm Stream service
# @param base_url
# Base URL for other StackStorm services
# @param username
Expand Down Expand Up @@ -43,10 +45,11 @@
$auth = $st2::auth,
$api_url = $st2::cli_api_url,
$auth_url = $st2::cli_auth_url,
$stream_url = $st2::cli_stream_url,
$base_url = $st2::cli_base_url,
$username = $st2::cli_username,
$password = $st2::cli_password,
$disable_credentials = false,
$disable_credentials = $st2::cli_disable_credentials,
$api_version = $st2::cli_api_version,
$cacert = $st2::cli_cacert,
$debug = $st2::cli_debug,
Expand All @@ -70,6 +73,11 @@
setting => 'url',
value => $api_url,
}
ini_setting { "${user}-st2_cli_stream_url":
section => 'stream',
setting => 'url',
value => $stream_url,
}
ini_setting { "${user}-st2_cli_general_base_url":
section => 'general',
setting => 'base_url',
Expand Down
82 changes: 82 additions & 0 deletions manifests/component/actionrunner.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# @summary Manages the <code>st2actionrunner</code> service.
#
# Normally this class is instantiated by +st2::profile::fullinstall+.
# OR by +st2::profile::ha::runner+
# However, advanced users can instantiate this class directly to configure
# and manage just the <code>st2actionrunner</code> service on a single node.
# Parameters for this class mirror the parameters in the st2 config.
#
# @see https://github.com/StackStorm/st2/blob/master/conf/st2.conf.sample#L337-L343
#
# @example Basic usage
# include st2::component::actionrunner
#
# @example Customizing parameters
# class { 'st2::component::actionrunner':
# actionrunner_workers => 5,
# ssh_key_location => '/etc/secrets/my_ssh_key',
# }
#
# @param actionrunner_workers
# Number of action runners.
# @param ssh_key_location
# Path to ssh key for the runner user
# @param conf_file
# Path to st2 conf file
# @param actionrunner_services
# List of services for actionrunner
#
class st2::component::actionrunner (
$actionrunner_workers = $st2::actionrunner_workers,
$ssh_key_location = $st2::ssh_key_location,
$conf_file = $st2::conf_file,
$actionrunner_services = $st2::params::actionrunner_services
) inherits st2 {

$_logger_config = $st2::syslog ? {
true => 'syslog',
default => 'logging',
}

## SSH
ini_setting { 'ssh_key_stanley':
ensure => present,
path => $conf_file,
section => 'system_user',
setting => 'ssh_key_file',
value => $ssh_key_location,
tag => 'st2::config',
}

## ActionRunner settings
ini_setting { 'actionrunner_logging':
ensure => present,
path => $conf_file,
section => 'actionrunner',
setting => 'logging',
value => "/etc/st2/${_logger_config}.actionrunner.conf",
tag => 'st2::config',
}

## Resultstracker Settings (Part of Action Runner)
ini_setting { 'resultstracker_logging':
ensure => present,
path => $conf_file,
section => 'resultstracker',
setting => 'logging',
value => "/etc/st2/${_logger_config}.resultstracker.conf",
tag => 'st2::config',
}

########################################
## Services
service { $actionrunner_services:
ensure => 'running',
enable => true,
tag => 'st2::service',
}

########################################
## Datastore keys
class { 'st2::server::datastore_keys': }
}
85 changes: 85 additions & 0 deletions manifests/component/api.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# @summary Manages the <code>st2api</code> service.
#
# Normally this class is instantiated by +st2::profile::fullinstall+.
# OR by +st2::profile::ha::web+
# However, advanced users can instantiate this class directly to configure
# and manage just the <code>st2api</code> service on a single node.
# Parameters for this class mirror the parameters in the st2 config.
#
# @see https://github.com/StackStorm/st2/blob/master/conf/st2.conf.sample#L337-L343
#
# @example Basic usage
# include st2::component::api
#
# @example Customizing parameters
# class { 'st2::component::api':
# st2api_listen_ip => '127.0.0.1',
# st2api_listen_port => '9201',
# }
#
# @param partition_provider
# partition_provider for distribution strategy of sensors.
# @see https://docs.stackstorm.com/reference/sensor_partitioning.html
# @param conf_file
# Path to st2 conf file
# @param api_services
# List of services for API
# @param st2api_listen_ip
# IP to bind API server
# @param st2api_listen_port
# Port to bind API server
#
class st2::component::api (
$conf_file = $st2::conf_file,
$api_services = $st2::params::api_services,
$st2api_listen_ip = '0.0.0.0',
$st2api_listen_port = '9101',
) inherits st2 {

$_logger_config = $st2::syslog ? {
true => 'syslog',
default => 'logging',
}

## API Settings
ini_setting { 'api_listen_ip':
ensure => present,
path => $conf_file,
section => 'api',
setting => 'host',
value => $st2api_listen_ip,
tag => 'st2::config',
}
ini_setting { 'api_listen_port':
ensure => present,
path => $conf_file,
section => 'api',
setting => 'port',
value => $st2api_listen_port,
tag => 'st2::config',
}
ini_setting { 'api_allow_origin':
ensure => 'present',
path => $conf_file,
section => 'api',
setting => 'allow_origin',
value => '*',
tag => 'st2::config',
}
ini_setting { 'api_logging':
ensure => present,
path => $conf_file,
section => 'api',
setting => 'logging',
value => "/etc/st2/${_logger_config}.api.gunicorn.conf",
tag => 'st2::config',
}

########################################
## Services
service { $api_services:
ensure => 'running',
enable => true,
tag => 'st2::service',
}
}
90 changes: 90 additions & 0 deletions manifests/component/auth.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# @summary Manages the <code>st2auth</code> service.
#
# Normally this class is instantiated by +st2::profile::fullinstall+.
# OR by +st2::profile::ha::web+
# However, advanced users can instantiate this class directly to configure
# and manage just the <code>st2auth</code> service on a single node.
# Parameters for this class mirror the parameters in the st2 config.
#
# @see https://github.com/StackStorm/st2/blob/master/conf/st2.conf.sample#L337-L343
#
# @example Basic usage
# include st2::component::auth
#
# @example Customizing parameters
# class { 'st2::component::auth':
# st2auth_listen_ip => '127.0.0.1',
# st2auth_listen_port => '9200',
# }
#
# @param conf_file
# Path to st2 conf file
# @param auth
# Enable or disable auth (default: true)
# @param st2auth_listen_ip
# IP to bind Auth server
# @param st2auth_listen_port
# Port to bind Auth server
# @param auth_services
# List of services for Auth
#
class st2::component::auth (
$conf_file = $st2::conf_file,
$auth = $st2::auth,
$st2auth_listen_ip = '0.0.0.0',
$st2auth_listen_port = '9100',
$auth_services = $st2::params::auth_services,
) inherits st2 {

$_enable_auth = $auth ? {
true => 'True',
default => 'False',
}

$_logger_config = $st2::syslog ? {
true => 'syslog',
default => 'logging',
}

## Authentication Settings
ini_setting { 'auth':
ensure => present,
path => $conf_file,
section => 'auth',
setting => 'enable',
value => $_enable_auth,
tag => 'st2::config',
}
ini_setting { 'auth_listen_port':
ensure => present,
path => $conf_file,
section => 'auth',
setting => 'port',
value => $st2auth_listen_port,
tag => 'st2::config',
}
ini_setting { 'auth_listen_ip':
ensure => present,
path => $conf_file,
section => 'auth',
setting => 'host',
value => $st2auth_listen_ip,
tag => 'st2::config',
}
ini_setting { 'auth_logging':
ensure => present,
path => $conf_file,
section => 'auth',
setting => 'logging',
value => "/etc/st2/${_logger_config}.auth.gunicorn.conf",
tag => 'st2::config',
}

########################################
## Services
service { $auth_services:
ensure => 'running',
enable => true,
tag => 'st2::service',
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# },
# }
#
class st2::profile::chatops (
class st2::component::chatops (
$version = $st2::version,
$hubot_log_level = $st2::chatops_hubot_log_level,
$hubot_express_port = $st2::chatops_hubot_express_port,
Expand Down Expand Up @@ -115,7 +115,7 @@

########################################
## Additional nodejs packages
include st2::profile::nodejs
include st2::dependency::nodejs

$npm_package_defaults = {
ensure => present,
Expand Down
46 changes: 46 additions & 0 deletions manifests/component/garbagecollector.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# @summary Manages the <code>st2garbagecollector</code> service.
#
# Normally this class is instantiated by +st2::profile::fullinstall+.
# OR by +st2::profile::ha::solo+
# However, advanced users can instantiate this class directly to configure
# and manage just the <code>st2garbagecollector</code> service on a single node.
# Parameters for this class mirror the parameters in the st2 config.
#
# @see https://github.com/StackStorm/st2/blob/master/conf/st2.conf.sample#L337-L343
#
# @example Basic usage
# include st2::component::garbagecollector
#
# @param conf_file
# Path to st2 conf file
# @param garbagecollector_services
# List of services for garbagecollector
#
class st2::component::garbagecollector (
$conf_file = $st2::conf_file,
$garbagecollector_services = $st2::params::garbagecollector_services,
) inherits st2 {

$_logger_config = $st2::syslog ? {
true => 'syslog',
default => 'logging',
}

## Sensor container Settings
ini_setting { 'garbagecollector_logging':
ensure => present,
path => $conf_file,
section => 'garbagecollector',
setting => 'logging',
value => "/etc/st2/${_logger_config}.garbagecollector.conf",
tag => 'st2::config',
}

########################################
## Services
service { $garbagecollector_services:
ensure => 'running',
enable => true,
tag => 'st2::service',
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# The port for the metrics. Default='8125'
#
# @example Basic Usage
# include st2::profile::metrics
# include st2::component::metrics
#
# @example Customize (done via st2)
# class { 'st2':
Expand All @@ -19,9 +19,9 @@
# metric_host => '127.0.0.1',
# metric_port => '8125',
# }
# include st2::profile::metrics
# include st2::component::metrics
#
class st2::profile::metrics (
class st2::component::metrics (
$metrics_include = $st2::metrics_include,
$metric_driver = $st2::metric_driver,
$metric_host = $st2::metric_host,
Expand Down
Loading