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

Add Aix support #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Aix support #176

wants to merge 1 commit into from

Conversation

logicminds
Copy link

@logicminds logicminds commented Jan 14, 2021

  • Previously this module kinda supported AIX but had a
    few issues. This code adds better support and allows
    the user to control how the rsyslog package is installed
    and where from. AIX is still considered experimental but
    it works on several systems tested.

  * Previously this module kinda supported AIX but had a
    few issues.  This code adds better support and allows
    the user to control how the rsyslog package is installed
    and where from.  AIX is still considered experimental but
    it works on several systems tested.
rsyslog::switch_default_syslog: true
# you will need to fill the source out
# aix has no yum like service
rsyslog::package_source: '<package_location>'
Copy link
Member

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.

Copy link
Author

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.

if $rsyslog::switch_default_syslog {
# Manage package must be set to true
# For AIX only
exec{'switch_to_rsyslog':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit:

exec { 'switch_to_rsyslog':

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing this param as it would only be used by AIX

@@ -43,6 +44,17 @@
}
}

if $rsyslog::switch_default_syslog {
Copy link
Member

Choose a reason for hiding this comment

The 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' {

Copy link
Author

Choose a reason for hiding this comment

The 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: odmget -q \"subsysname = 'syslogd'\" SRCsubsys | grep rsyslog. This is not a desirable behavior.

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 if $rsyslog::switch_default_syslog and $::facts['os']['name'] == 'AIX' { to prevent any accidental usage from non AIX systems.

@ghoneycutt ghoneycutt added enhancement New feature or request needs-tests labels Jan 14, 2021
@ghoneycutt
Copy link
Member

ghoneycutt commented Jan 14, 2021

Great work Corey! In the spec tests as https://github.com/voxpupuli/puppet-rsyslog/blob/master/spec/classes/init_spec.rb you should add a conditional so that if the platform is AIX it checks for that exec to be in there and if not then the exec is absent.

@vox-pupuli-tasks
Copy link

Dear @logicminds, thanks for the PR!

This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants