-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add Aix support #176
base: master
Are you sure you want to change the base?
Add Aix support #176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
rsyslog::package_name: rsyslog.base | ||
rsyslog::group_name: system | ||
rsyslog::service_name: syslogd | ||
rsyslog::switch_default_syslog: true | ||
# you will need to fill the source out | ||
# aix has no yum like service | ||
rsyslog::package_source: '<package_location>' | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
if $rsyslog::manage_package { | ||
package { $rsyslog::package_name: | ||
ensure => $rsyslog::package_version, | ||
source => $rsyslog::package_source, | ||
} | ||
} | ||
|
||
|
@@ -43,6 +44,17 @@ | |
} | ||
} | ||
|
||
if $rsyslog::switch_default_syslog { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of this param which calls an exec that only makes sense on AIX, suggest conditional logic based off of the platform such as if $facts['os']['name'] == 'AIX' { There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I change to your suggestion it would mean that the following command would run every puppet run trying to do a idempotent check: Additionally, some users want this module to install rsyslog but also want to control when syslog is changed over to rsyslog. AFAIK, rsyslog is not the default for AIX. I did update to use |
||
# Manage package must be set to true | ||
# For AIX only | ||
exec{'switch_to_rsyslog': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style nit: exec { 'switch_to_rsyslog': |
||
command => 'syslog_ssw -r', | ||
path => ['/usr/bin','/usr/sbin'], | ||
unless => "odmget -q \"subsysname = 'syslogd'\" SRCsubsys | grep rsyslog", | ||
require => Package[$rsyslog::package_name], | ||
} | ||
} | ||
|
||
if $rsyslog::manage_confdir { | ||
$purge_params = $rsyslog::purge_config_files ? { | ||
true => { | ||
|
@@ -61,8 +73,8 @@ | |
|
||
file { $rsyslog::confdir: | ||
ensure => directory, | ||
owner => 'root', | ||
group => 'root', | ||
owner => $rsyslog::owner_name, | ||
group => $rsyslog::group_name, | ||
mode => $rsyslog::confdir_permissions, | ||
* => $purge_params + $require_package, | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,14 @@ | |
# Set the file mode for the rsyslog.d configuration directory. | ||
# @param global_conf_perms | ||
# Set the file mode for the /etc/rsyslog.conf | ||
# @param owner_name | ||
# Set the owner name for rsyslog configuration files. | ||
# @param group_name | ||
# Set the group name for rsyslog configuration files. | ||
# @param AIX_switch_syslog | ||
# Set the rsyslog switch to false. | ||
# @param package_source | ||
# Required for AIX to specify package source. | ||
# | ||
class rsyslog ( | ||
String $confdir, | ||
|
@@ -115,9 +123,13 @@ | |
Integer $ruleset_priority, | ||
Integer $filter_priority, | ||
String $target_file, | ||
Optional[Stdlib::Absolutepath] $package_source = undef, | ||
Stdlib::Filemode $conf_permissions = '0644', | ||
Stdlib::Filemode $confdir_permissions = '0755', | ||
Stdlib::Filemode $global_conf_perms = $conf_permissions, | ||
String $owner_name = 'root', | ||
String $group_name = 'root', | ||
Boolean $switch_default_syslog = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest removing this param as it would only be used by AIX |
||
) { | ||
if $manage_service == true and $external_service == true { | ||
fail('manage_service and external_service cannot be set at the same time!') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a real value like
/opt/freeware/src/packages
or/tmp
so that the module can be tested.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is possible, because it is up to the user to put the file on the system. It could be on nfs or any other directory and is up to the user to specify where that is. I could just put /tmp but this will likely be wrong for the user but I suppose the way it is now is also wrong.