-
Notifications
You must be signed in to change notification settings - Fork 59
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
Make sure we're running with correct time on installation #568
base: master
Are you sure you want to change the base?
Conversation
With machines that don't have proper RTC time, we're running into nasty issues when trying to install on a system that is thinking it lives in the 70ties.
@@ -322,6 +322,9 @@ def find_node_boot_mac_addresses(node, admin_data_net) | |||
cloud_available = true if name.include? "Cloud" | |||
end | |||
|
|||
ntp_servers = search(:node, "roles:ntp-server") | |||
ntp_servers_ips = ntp_servers.map { |n| Chef::Recipe::Barclamp::Inventory.get_network_by_type(n, "admin").address } |
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.
Metrics/LineLength: Line is too long. 125/100
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.
Just a hint: you don't need the Chef::Recipe::
prefix (but that won't help with the hound warning)
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.
Using a multiline do block should do the trick here and hound should be happy.
ntp_servers_ips = ntp_servers.map do |n|
Chef::Recipe::Barclamp::Inventory.get_network_by_type(n, "admin").address
end
@@ -12,6 +12,7 @@ | |||
<final_reboot config:type="boolean">false</final_reboot> | |||
<halt config:type="boolean">false</halt> | |||
<second_stage config:type="boolean">true</second_stage> | |||
<ntp_sync_time_before_installation><%= @ntp_servers.first %></ntp_sync_time_before_installation> |
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.
@dirkmueller can you add something like <% unless @ntp_servers.empty? -%>
to protect against an empty list of ntp servers?
With machines that don't have proper RTC time, we're running into
nasty issues when trying to install on a system that is thinking it
lives in the 70ties.