Skip to content

Commit

Permalink
Fixes #38173 - Permit use of arrays for multiple timesources
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpunk committed Jan 29, 2025
1 parent 74ddd88 commit a21c3b2
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ description: |
- enable-official-puppet8-repo: boolean (default=false)
- skip-puppet-setup: boolean (default=false)
- salt_master: string (default=undef)
- ntp-server: string (default=undef)
- ntp-server: string (default=undef), an array is permitted for multiple servers
- bootloader-append: string (default="nofb quiet splash=quiet")
- disable-firewall: boolean (default=false)
- package_upgrade: boolean (default=true)
Expand Down Expand Up @@ -142,13 +142,27 @@ authselect --useshadow --passalgo=<%= @host.operatingsystem.password_hash.downca
authconfig --useshadow --passalgo=<%= @host.operatingsystem.password_hash.downcase || 'sha256' %> --kickstart
<% end -%>
<% if rhel_compatible && os_major < 9 -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %> <%= host_param('ntp-server') ? "--ntpservers #{host_param('ntp-server')}" : '' %>
<% if host_param('ntp-server') -%>
<% if host_param('ntp-server').is_a?(Array) -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %> --ntpservers <%= host_param('ntp-server').join(',') %>
<% else %>
timezone --utc <%= host_param('time-zone') || 'UTC' %> --ntpservers <%= host_param('ntp-server') %>
<% end -%>
<% else -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %>
<% end -%>
<% else -%>
timezone --utc <%= host_param('time-zone') || 'UTC' %>
<% if host_param('ntp-server') -%>
<% if host_param('ntp-server').is_a?(Array) -%>
<% host_param('ntp-server').each do |ntpserver| -%>
timesource --ntp-server <%= ntpserver %>
<% end -%>
<% else -%>
timesource --ntp-server <%= host_param('ntp-server') %>
<% end -%>
<% end -%>
<% end -%>

<% if rhel_compatible -%>
services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd
Expand Down

0 comments on commit a21c3b2

Please sign in to comment.