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

Fix for Puppet installation on Amazon Linux OS #197

Merged
merged 4 commits into from
Jan 14, 2020
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
50 changes: 23 additions & 27 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -243,43 +243,39 @@
default: { fail('OS not supported') }
}

## ossec.conf generation concats
case $::kernel {
'Linux': {
case $::osfamily {
'Redhat', 'redhat', 'OracleLinux': {
$apply_template_os = 'rhel'
if ( $::operatingsystemrelease =~ /^7.*/ ) {
$rhel_version = '7'
} elsif ( $::operatingsystemrelease =~ /^6.*/ ) {
$rhel_version = '6'
} elsif ( $::operatingsystemrelease =~ /^5.*/ ) {
$rhel_version = '5'
} else {
fail('This ossec module has not been tested on your distribution')
}
}
'Debian', 'debian', 'Ubuntu', 'ubuntu': {
$apply_template_os = 'debian'
if ( $::lsbdistcodename == 'wheezy') or ($::lsbdistcodename == 'jessie') {
$debian_additional_templates = 'yes'
}
'Linux': {
## ossec.conf generation concats
case $::operatingsystem {
'RedHat', 'OracleLinux':{
$apply_template_os = 'rhel'
if ( $::operatingsystemrelease =~ /^7.*/ ){
$rhel_version = '7'
}elsif ( $::operatingsystemrelease =~ /^6.*/ ){
$rhel_version = '6'
}elsif ( $::operatingsystemrelease =~ /^5.*/ ){
$rhel_version = '5'
}else{
fail('This ossec module has not been tested on your distribution')
}
'Amazon': {
$apply_template_os = 'amazon'
}'Debian', 'debian', 'Ubuntu', 'ubuntu':{
$apply_template_os = 'debian'
if ( $::lsbdistcodename == 'wheezy') or ($::lsbdistcodename == 'jessie'){
$debian_additional_templates = 'yes'
}
'CentOS', 'Centos', 'centos': {
$apply_template_os = 'centos'
}
default: { fail('This ossec module has not been tested on your distribution') }
}'Amazon':{
$apply_template_os = 'amazon'
}'CentOS','Centos','centos':{
$apply_template_os = 'centos'
}
}
'windows': {
}'windows': {
$apply_template_os = 'windows'
}
default: { fail('OS not supported') }
}


concat { 'ossec.conf':
path => $wazuh::params_agent::config_file,
owner => $wazuh::params_agent::config_owner,
Expand Down
2 changes: 1 addition & 1 deletion manifests/manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
## Declaring variables for localfile and wodles generation

case $::operatingsystem{
'Redhat', 'redhat', 'OracleLinux':{
'RedHat', 'OracleLinux':{
$apply_template_os = 'rhel'
if ( $::operatingsystemrelease =~ /^7.*/ ){
$rhel_version = '7'
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
default: { fail('This ossec module has not been tested on your distribution (or lsb package not installed)') }
}
}
'Linux', 'Redhat' : {
'Linux', 'RedHat' : {
case $::os[name] {
/^(CentOS|RedHat|OracleLinux|Fedora|Amazon)$/: {
if ( $::operatingsystemrelease =~ /^5.*/ ) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo_elastic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
default: { fail('This ossec module has not been tested on your distribution (or lsb package not installed)') }
}
}
'Redhat' : {
'RedHat' : {
case $::os[name] {
/^(CentOS|RedHat|OracleLinux|Fedora|Amazon)$/: {
if ( $::operatingsystemrelease =~ /^5.*/ ) {
Expand Down
2 changes: 2 additions & 0 deletions templates/fragments/_wodle_openscap.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<scan-on-start><%= @wodle_openscap_scan_on_start %></scan-on-start>
<%- end -%>

<%- if not @wodle_openscap_content.nil? -%>
<%- @wodle_openscap_content.each do |path, value| -%>
<content type="<%= value['type'] %>" path="<%= path %>">
<%- if value['profiles'] then -%>
Expand All @@ -22,6 +23,7 @@
<%- end -%>
</content>
<%- end -%>
%- end -%>
</wodle>