Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Development

- Add configuration for redis based coordination and remove old style `$::osfamily` references. Contributed by @rush-skills

## 2.3.0 (Sep 15, 2021)

Expand Down
2 changes: 1 addition & 1 deletion manifests/auth/ldap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
}

# install package dependency
$_dep_pkgs = $::osfamily ? {
$_dep_pkgs = $facts['os']['family'] ? {
'Debian' => ['gcc', 'libldap2-dev'],
'RedHat' => ['gcc', 'openldap-devel'],
default => undef,
Expand Down
2 changes: 1 addition & 1 deletion manifests/auth/pam.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

# install package dependency
$_dep_pkgs = $::osfamily ? {
$_dep_pkgs = $facts['os']['family'] ? {
'Debian' => 'libpam0g',
'RedHat' => 'pam-devel',
default => undef,
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@
$erlang_url = $st2::params::erlang_url,
$erlang_key = $st2::params::erlang_key,
$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,
Expand Down
12 changes: 9 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$st2_web_packages = [
'st2web',
]
case $::osfamily {
case $facts['os']['family'] {
'Debian': {
$st2_client_packages = [
'python-st2client',
Expand Down Expand Up @@ -186,18 +186,24 @@
$rabbitmq_vhost = '/'
$erlang_url = "https://packagecloud.io/rabbitmq/erlang/el/${facts['os'][release][major]}/\$basearch"
$erlang_key = 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'

## Redis
$redis_bind_ip = '127.0.0.1'
$redis_hostname = '127.0.0.1'
$redis_port = 6379
$redis_password = ''


## actionrunner config
$actionrunner_workers = 10
$actionrunner_global_env_file = $::osfamily ? {
$actionrunner_global_env_file = $facts['os']['family'] ? {
'Debian' => '/etc/default/st2actionrunner',
'RedHat' => '/etc/sysconfig/st2actionrunner',
}

## chatops default config
$st2_chatops_dir = '/opt/stackstorm/chatops'
$st2_chatops_global_env_file = $::osfamily ? {
$st2_chatops_global_env_file = $facts['os']['family'] ? {
'Debian' => '/etc/default/st2chatops',
'RedHat' => '/etc/sysconfig/st2chatops',
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/profile/mongodb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
# database, the re-enables auth.
#
# To prevent this from running every time we've create a puppet fact
# called $::mongodb_auth_init that is set when
# called $mongodb_auth_init that is set when
if !$facts['mongodb_auth_init'] {
# unfortinately there is no way to synchronously force a service restart
# in Puppet, so we have to revert to exec... sorry
Expand Down
4 changes: 2 additions & 2 deletions manifests/profile/nodejs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@

# Red Hat 7.x + already have NodeJS 6.x installed
# trying to install from nodesource repos fails, so just use the builtin
if ($::osfamily == 'RedHat' and
versioncmp($::operatingsystemmajrelease, '7') >= 0) {
if ($facts['os']['family'] == 'RedHat' and
versioncmp($facts['os']['release']['major'], '7') >= 0) {
if $use_rhel7_builtin {
class { 'nodejs':
manage_package_repo => false,
Expand Down
4 changes: 2 additions & 2 deletions manifests/profile/rabbitmq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
) inherits st2 {

# RHEL 8 Requires another repo in addition to epel to be installed
if ($::osfamily == 'RedHat') and ($facts['os']['release']['major'] == '8') {
if ($facts['os']['family'] == 'RedHat') and ($facts['os']['release']['major'] == '8') {
$repos_ensure = true

# This is required because when using the latest version of rabbitmq because the latest version in EPEL
Expand Down Expand Up @@ -81,7 +81,7 @@
}

# RHEL needs EPEL installed prior to rabbitmq
if $::osfamily == 'RedHat' {
if $facts['os']['family'] == 'RedHat' {
Class['epel']
-> Class['rabbitmq']

Expand Down
14 changes: 14 additions & 0 deletions manifests/profile/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
$rabbitmq_hostname = $st2::rabbitmq_hostname,
$rabbitmq_port = $st2::rabbitmq_port,
$rabbitmq_vhost = $st2::rabbitmq_vhost,
$redis_hostname = $st2::redis_hostname,
$redis_port = $st2::redis_port,
$redis_password = $st2::redis_password,
$index_url = $st2::index_url,
$packs_group = $st2::packs_group_name,
) inherits st2 {
Expand Down Expand Up @@ -269,6 +272,17 @@
tag => 'st2::config',
}

## Coordination Settings (Redis)

$_redis_url = "redis://:${redis_password}@${redis_hostname}:${redis_port}/"
ini_setting { 'coordination_url':
path => '/etc/st2/st2.conf',
section => 'coordination',
setting => 'url',
value => $_redis_url,
tag => 'st2::config',
}

## Resultstracker Settings
ini_setting { 'resultstracker_logging':
ensure => present,
Expand Down