Skip to content
Merged
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
8 changes: 2 additions & 6 deletions controls/os_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
# author: Dominik Richter
# author: Patrick Muench

log_dir_group = case os[:family]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could we just switch to use os.name instead?

when 'debian', 'redhat', 'fedora'
'root'
when 'ubuntu'
os[:release] == '14.04' ? 'syslog' : 'root'
end
log_dir_group = 'root'
log_dir_group = 'syslog' if os.name == 'ubuntu' && os[:release].to_i >= 14
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@chris-rock I'm using os.name here in the replacement :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought easiest just to override default of log_dir_group = 'root' if Ubuntu 14.04+ as the case statement seemed overkill. If there are platforms that deviate in the future then happy to put it back.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with you. Thank you for making it simpler!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we could remove version check completely as it does not really make sense (and ubuntu 16.04 has group 'syslog' as well)

log_dir_group = os.name == 'ubuntu'? 'syslog' : 'root'

login_defs_umask = attribute('login_defs_umask', default: os.redhat? ? '077' : '027', description: 'Default umask to set in login.defs')
login_defs_passmaxdays = attribute('login_defs_passmaxdays', default: '60', description: 'Default password maxdays to set in login.defs')
login_defs_passmindays = attribute('login_defs_passmindays', default: '7', description: 'Default password mindays to set in login.defs')
Expand Down