Skip to content

Commit

Permalink
Fixes #36019 - Pass URL params to foreman_url as hash
Browse files Browse the repository at this point in the history
Some templates add URL params to the foreman_url like this:
<%= foreman_url('provision') + "&static=yes" %>

That cause issues when token_duration setting is set to	0,
generating URL '.../unattended/provision&static=yes'
instead	of '.../unattended/provision?static=yes'
  • Loading branch information
stejskalleos authored and MariaAga committed Jan 31, 2023
1 parent 3d600a5 commit 9519609
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ require:
{
"kernel": "<%= @kernel_uri %>",
"initram": "<%= @initrd_uri %>",
"append": "url=<%= foreman_url('provision') + "&static=yes" %> interface=<%= mac %> netcfg/get_ipaddress=<%= ip %> netcfg/get_netmask=<%= mask %> netcfg/get_gateway=<%= gw %> netcfg/get_nameservers=<%= dns %> netcfg/disable_dhcp=true netcfg/get_hostname=<%= @host.name %> BOOTIF=<%= bootif %> <%= options.compact.join(' ') %>",
"append": "url=<%= foreman_url('provision', { static: 'yes' })%> interface=<%= mac %> netcfg/get_ipaddress=<%= ip %> netcfg/get_netmask=<%= mask %> netcfg/get_gateway=<%= gw %> netcfg/get_nameservers=<%= dns %> netcfg/disable_dhcp=true netcfg/get_hostname=<%= @host.name %> BOOTIF=<%= bootif %> <%= options.compact.join(' ') %>",
"extra": <%= extra %>
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ require:
"initram": "<%= @initrd_uri %>",
<% if (@host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16) or
(@host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7) -%>
"append": "inst.ks=<%= foreman_url('provision') + "&static=yes" %> inst.ks.sendmac <%= "ip=#{ip}::#{gw}:#{mask}:::none nameserver=#{dns} ksdevice=bootif BOOTIF=#{bootif} nomodeset nokaslr " + options.compact.join(' ') %>",
"append": "inst.ks=<%= foreman_url('provision', { static: 'yes' }) %> inst.ks.sendmac <%= "ip=#{ip}::#{gw}:#{mask}:::none nameserver=#{dns} ksdevice=bootif BOOTIF=#{bootif} nomodeset nokaslr " + options.compact.join(' ') %>",
<% else -%>
"append": "inst.ks=<%= foreman_url('provision') + "&static=yes" %> kssendmac nicdelay=5 <%= "ip=#{ip} netmask=#{mask} gateway=#{gw} dns=#{dns} ksdevice=#{mac} BOOTIF=#{bootif} nomodeset nokaslr " + options.compact.join(' ') %>",
"append": "inst.ks=<%= foreman_url('provision', { static: 'yes' }) %> kssendmac nicdelay=5 <%= "ip=#{ip} netmask=#{mask} gateway=#{gw} dns=#{dns} ksdevice=#{mac} BOOTIF=#{bootif} nomodeset nokaslr " + options.compact.join(' ') %>",
<% end -%>
"extra": <%= extra %>
}

0 comments on commit 9519609

Please sign in to comment.