Skip to content

Commit

Permalink
fix(osfamily): switch old osfamily fact to new fact
Browse files Browse the repository at this point in the history
  • Loading branch information
spotzero committed Aug 11, 2023
1 parent a123235 commit a380ab7
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
'Linux': {
if $manage_repo {
class { 'wazuh::repo': }
if $::osfamily == 'Debian' {
if $facts['os']['family'] == 'Debian' {
Class['wazuh::repo'] -> Class['apt::update'] -> Package[$agent_package_name]
} else {
Class['wazuh::repo'] -> Package[$agent_package_name]
Expand Down Expand Up @@ -629,7 +629,7 @@

# SELinux
# Requires selinux module specified in metadata.json
if ($::osfamily == 'RedHat' and $selinux == true) {
if ($facts['os']['family'] == 'RedHat' and $selinux == true) {
selinux::module { 'ossec-logrotate':
ensure => 'present',
source_te => 'puppet:///modules/wazuh/ossec-logrotate.te',
Expand Down
2 changes: 1 addition & 1 deletion manifests/filebeat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class {'wazuh::repo_elastic':}

if $::osfamily == 'Debian' {
if $facts['os']['family'] == 'Debian' {
Class['wazuh::repo_elastic'] -> Class['apt::update'] -> Package['filebeat']
} else {
Class['wazuh::repo_elastic'] -> Package['filebeat']
Expand Down
2 changes: 1 addition & 1 deletion manifests/filebeat_oss.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class {'wazuh::repo_elastic_oss':}

if $::osfamily == 'Debian' {
if $facts['os']['family'] == 'Debian' {
Class['wazuh::repo_elastic_oss'] -> Class['apt::update'] -> Package[$filebeat_oss_package]
} else {
Class['wazuh::repo_elastic_oss'] -> Package[$filebeat_oss_package]
Expand Down
6 changes: 3 additions & 3 deletions manifests/manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@

}else{
$kernel = 'Linux'
if ($::osfamily == 'Debian'){
if ($facts['os']['family'] == 'Debian'){
$os_family = 'debian'
}else{
$os_family = 'centos'
Expand Down Expand Up @@ -360,7 +360,7 @@
validate_legacy(Array, 'validate_array', $ossec_emailto)
}

if $::osfamily == 'windows' {
if $facts['os']['family'] == 'windows' {
fail('The ossec module does not yet support installing the OSSEC HIDS server on Windows')
}

Expand All @@ -369,7 +369,7 @@
if $manage_repos {
# TODO: Allow filtering of EPEL requirement
class { 'wazuh::repo':}
if $::osfamily == 'Debian' {
if $facts['os']['family'] == 'Debian' {
Class['wazuh::repo'] -> Class['apt::update'] -> Package[$wazuh::params_manager::server_package]
} else {
Class['wazuh::repo'] -> Package[$wazuh::params_manager::server_package]
Expand Down
2 changes: 1 addition & 1 deletion manifests/opendistro.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class {'wazuh::repo_opendistro':}


if $::osfamily == 'Debian' {
if $facts['os']['family'] == 'Debian' {
Class['wazuh::repo_opendistro'] -> Class['apt::update'] -> Package['opendistroforelasticsearch']
} else {
Class['wazuh::repo_opendistro'] -> Package['opendistroforelasticsearch']
Expand Down
2 changes: 1 addition & 1 deletion manifests/params_agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
$ossec_ruleset_user_defined_decoder_dir = 'etc/decoders'
$ossec_ruleset_user_defined_rule_dir = 'etc/rules'

case $::osfamily {
case $facts['os']['family'] {
'Debian': {
$service_has_status = false
$ossec_service_provider = undef
Expand Down
2 changes: 1 addition & 1 deletion manifests/params_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
$wazuh_api_template = 'wazuh/wazuh_api.erb'


case $::osfamily {
case $facts['os']['family'] {
'Debian': {

$agent_service = 'wazuh-agent'
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class wazuh::repo (
) {

case $::osfamily {
case $facts['os']['family'] {
'Debian' : {
if $::lsbdistcodename =~ /(jessie|wheezy|stretch|precise|trusty|vivid|wily|xenial|yakketi|focal)/
and ! defined(Package['apt-transport-https']) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo_elastic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class wazuh::repo_elastic (

) {
case $::osfamily {
case $facts['os']['family'] {
'Debian' : {
if ! defined(Package['apt-transport-https']) {
ensure_packages(['apt-transport-https'], {'ensure' => 'present'})
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo_elastic_oss.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class wazuh::repo_elastic_oss (

) {
case $::osfamily {
case $facts['os']['family'] {
'Debian' : {
if ! defined(Package['apt-transport-https']) {
ensure_packages(['apt-transport-https'], {'ensure' => 'present'})
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo_opendistro.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class wazuh::repo_opendistro (

) {
case $::osfamily {
case $facts['os']['family'] {
'Debian' : {
if ! defined(Package['apt-transport-https']) {
ensure_packages(['apt-transport-https'], {'ensure' => 'present'})
Expand Down

0 comments on commit a380ab7

Please sign in to comment.