-
Notifications
You must be signed in to change notification settings - Fork 280
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 support for log rotate on Windows #607
Changes from 2 commits
c82842b
0522692
edc8b63
5edd695
c480483
7a31c2e
1756c52
8ee4564
4192ead
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 |
---|---|---|
|
@@ -17,12 +17,14 @@ | |
end | ||
|
||
# installation | ||
default["sensu"]["version"] = "0.28.4-1" | ||
default["sensu"]["version"] = "1.2.0-1" | ||
default["sensu"]["version_suffix"] = nil | ||
default["sensu"]["apt_repo_codename"] = nil | ||
default["sensu"]["yum_repo_releasever"] = nil | ||
default["sensu"]["use_unstable_repo"] = false | ||
default["sensu"]["log_level"] = "info" | ||
default["sensu"]["log_rotate_file_size"] = '10240' | ||
default["sensu"]["log_rotate_file_keep"] = '10' | ||
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. Based on your screenshot and the documentation example this should be an integer not a string but the puppet module has a string. I am leaning integer because thats what the documentation has but not sure matters 🤷♂️ |
||
default["sensu"]["use_ssl"] = true | ||
default["sensu"]["use_embedded_ruby"] = true | ||
default["sensu"]["service_max_wait"] = 10 | ||
|
@@ -34,7 +36,7 @@ | |
default["sensu"]["apt_repo_url"] = "http://repositories.sensuapp.org/apt" | ||
default["sensu"]["yum_repo_url"] = "http://repositories.sensuapp.org" | ||
default['sensu']['yum_flush_cache'] = nil | ||
default["sensu"]["msi_repo_url"] = "https://repositories.sensuapp.org/msi" | ||
default["sensu"]["msi_repo_url"] = "https://repositories.sensuapp.org/msi/2012r2" | ||
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. why does this need to change? I am still unclear with the previous discussion wont this break all other versions? 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. @majormoses When you go to the old url, version go up to 0.26. Logrotate works as of 0.29.x. Puppet version also uses the new url, however still using the 0.29.x version. If uncertain of my comment please check the old url vs new url. 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. I see new versions in here: http://repositories.sensuapp.org/msi/2016/ which was my point the windows version plays into what is installed. I really don't know enough about windows stuff but this feel like this would break every version other than server 2012. 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. I think the problem is that we need to include the I don't have a windows machine to test with can you please give me the relevant ohai output for this: https://github.com/chef/ohai/blob/v14.1.0/lib/ohai/plugins/windows/platform.rb#L30 as I think we can use this to solve the problem. 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. @majormoses I can use the current Windows cookbook (1.36) using on platform_version. I also removed the attribute from the attributes file and placed the logic in the recipe. Please let me know what you think of it. As with the logic it already checks which version is needed I do not think it's necessary to have it in the attributes file (it also excludes saving the attribute on Linux hosts). |
||
default["sensu"]["aix_package_root_url"] = "https://sensu.global.ssl.fastly.net/aix" | ||
default["sensu"]["add_repo"] = true | ||
default['sensu']['apt_key_url'] = 'https://sensu.global.ssl.fastly.net/apt/pubkey.gpg' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,12 @@ | |
|
||
windows = node["sensu"]["windows"].dup | ||
|
||
if node['kernel']['machine'] =~ /x86_64/ | ||
kernel = 'x64' | ||
else | ||
kernel = 'x86' | ||
end | ||
|
||
user node["sensu"]["user"] do | ||
password Sensu::Helpers.random_password(20, true, true, true, true) | ||
not_if { Sensu::Helpers.windows_user_exists?(node["sensu"]["user"]) } | ||
|
@@ -35,7 +41,7 @@ | |
end | ||
|
||
package "Sensu" do | ||
source "#{node['sensu']['msi_repo_url']}/sensu-#{node['sensu']['version']}.msi" | ||
source "#{node['sensu']['msi_repo_url']}/sensu-#{node['sensu']['version']}-#{kernel}.msi" | ||
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. I think this should be 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. Can do, but it would mean that the OS version is always part of the url. If we keep it like this, anybody can overwrite the #{node['sensu']['msi_repo_url']} attribute and point it to a different url also without the OS version bound in the url itself. A reason to save/cache the binary somewhere else can be, if the original url changes multiple times or the installed version is removed from the original url. 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. Fair point but that's true about the kernel version as well, they could rename the file because they feel they don't need the 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. True that. We use an internal artifact system but can't remember the exact reason why :-). Currently, it's being used by ~20 customers of us. I updated the recipe/attributes files. I already had it ready :-) When I bump up the cookbook I will also need to update the Artifacts repo, but that's not a big issue. |
||
options windows["package_options"] | ||
version node["sensu"]["version"].tr("-", ".") | ||
notifies :create, "ruby_block[sensu_service_trigger]", :immediately | ||
|
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.
Based on your screenshot and the documentation example this should be an integer not a string but the puppet module has a string. I am leaning integer because thats what the documentation has but not sure matters 🤷♂️
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.
@majormoses Thanks for the review. I changed it to int based on your comment/docs. It should not really matter for the function of it but this way it's consistent.