Alternative for @host.medium.path

Hello,

I am trying to get templates working nicely in safemode.

Yet I am looking for an alternative for @host.medium.path - is there any? If not, should it be while listed?

Cheers,

··· -- Daniel Helgenberger Schivelbeiner Str. 46 10439 Berlin

@host.os.medium_uri(@host).to_s ought to provide the full URL to the
installation medium. It's preferable as it interpolates the OS-specific
variables in the URL, while accessing @host.medium would give you the
raw URL with variables in it.

··· On 24/09/15 17:15, Daniel Helgenberger wrote: > Hello, > > I am trying to get templates working nicely in safemode. > > Yet I am looking for an alternative for @host.medium.path - is there any? If not, should it be while listed?


Dominic Cleal
dominic@cleal.org

>> Hello,
>>
>> I am trying to get templates working nicely in safemode.
>>
>> Yet I am looking for an alternative for @host.medium.path - is there any? If not, should it be while listed?
>
> @host.os.medium_uri(@host).to_s ought to provide the full URL to the
> installation medium. It's preferable as it interpolates the OS-specific
> variables in the URL, while accessing @host.medium would give you the
> raw URL with variables in it.

Thanks Dominic, does this work in safe mode, too?

··· On 25.09.2015 09:56, Dominic Cleal wrote: > On 24/09/15 17:15, Daniel Helgenberger wrote:


Daniel Helgenberger
Schivelbeiner Str. 46
10439 Berlin

I believe it would, yes.

··· On 25/09/15 14:39, Daniel Helgenberger wrote: > On 25.09.2015 09:56, Dominic Cleal wrote: >> On 24/09/15 17:15, Daniel Helgenberger wrote: >>> Hello, >>> >>> I am trying to get templates working nicely in safemode. >>> >>> Yet I am looking for an alternative for @host.medium.path - is there any? If not, should it be while listed? >> >> @host.os.medium_uri(@host).to_s ought to provide the full URL to the >> installation medium. It's preferable as it interpolates the OS-specific >> variables in the URL, while accessing @host.medium would give you the >> raw URL with variables in it. > > Thanks Dominic, does this work in safe mode, too?


Dominic Cleal
dominic@cleal.org

>>>> Hello,
>>>>
>>>> I am trying to get templates working nicely in safemode.
>>>>
>>>> Yet I am looking for an alternative for @host.medium.path - is there any? If not, should it be while listed?
>>>
>>> @host.os.medium_uri(@host).to_s ought to provide the full URL to the
>>> installation medium. It's preferable as it interpolates the OS-specific
>>> variables in the URL, while accessing @host.medium would give you the
>>> raw URL with variables in it.
>>
>> Thanks Dominic, does this work in safe mode, too?
>
> I believe it would, yes.

Thanks, this works great!

I came across yet another issue: for windows hosts to work with Foreman root_pass:
Safemode doesn't allow to access 'constant' on Base64

For windows unattend.xml to work with root pass, I have to decode it and encode it again:

<Value><%= Base64.encode64(Base64.decode64(root_pass)+"AdministratorPassword").chomp -%></Value>

··· On 25.09.2015 15:43, Dominic Cleal wrote: > On 25/09/15 14:39, Daniel Helgenberger wrote: >> On 25.09.2015 09:56, Dominic Cleal wrote: >>> On 24/09/15 17:15, Daniel Helgenberger wrote:


Daniel Helgenberger
Schivelbeiner Str. 46
10439 Berlin

Hi there, has this been resolved now?
Safemode doesn’t allow to access ‘constant’ on Base64

Hello, please do not add comments on unrelated or old threads. Feel free to open new ones with relevant title.

To your question - we only care about Foreman objects and maintain list of safe methods for these. Open a ticket against safemode rubygem in order to get access to generic ruby object, to me it looks like base64.constant is a valid case.