I try to write a template and locate my provision interface but foreman
can't figure it out 
I am following
TemplateWriting - Foreman and
writing <%= @host.provision_interface%>, I get http://pastie.org/10126609 
Shouldn't it give me the ethX identifier? I am using
foreman-1.9.0-0.develop.201504270854git4e21396.el7.noarch
To be clear, @host.primary_interface gives me the hostname.
Solved on IRC, sending the outcome - it "gave nothing" because
<%= @host.provision_interface %>
returns the interface object on which ERB calls to_s that equals to "DNS name
of that interface". Michael's DNS name of that interface was empty, that's why
it seemed as it does not return anything.
To get interface identifier the right snippet is
<%= @host.provision_interface.identifier %>
Similarly, one could get to other interface attributes, like IP, MAC, ā¦
Ā·Ā·Ā·
On Monday 04 of May 2015 00:18:56 Lev Michael wrote:
> I try to write a template and locate my provision interface but foreman
> can't figure it out :(
> I am following
> http://projects.theforeman.org/projects/foreman/wiki/templatewriting and
> writing <%= @host.provision_interface%>, I get http://pastie.org/10126609 :(
>
> Shouldn't it give me the ethX identifier? I am using
> foreman-1.9.0-0.develop.201504270854git4e21396.el7.noarch
>
> To be clear, @host.primary_interface gives me the hostname.
ā
Marek
Thanks a lot!
Is there a chance to elaborate on the wiki?
Ā·Ā·Ā·
Sent from Type Mail
On May 4, 2015, 15:13, at 15:13, Marek Hulan mhulan@redhat.com wrote:
On Monday 04 of May 2015 00:18:56 Lev Michael wrote:
I try to write a template and locate my provision interface but
foreman
canāt figure it out 
I am following
TemplateWriting - Foreman
and
writing <%= @host.provision_interface%>, I get
http://pastie.org/10126609 
Shouldnāt it give me the ethX identifier? I am using
foreman-1.9.0-0.develop.201504270854git4e21396.el7.noarch
To be clear, @host.primary_interface gives me the hostname.
Solved on IRC, sending the outcome - it āgave nothingā because
<%= @host.provision_interface %>
returns the interface object on which ERB calls to_s that equals to
"DNS name
of that interface". Michaelās DNS name of that interface was empty,
thatās why
it seemed as it does not return anything.
To get interface identifier the right snippet is
<%= @host.provision_interface.identifier %>
Similarly, one could get to other interface attributes, like IP, MAC,
ā¦
ā
Marek
ā
You received this message because you are subscribed to a topic in the
Google Groups āForeman usersā group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/vvXvbzdP640/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.
Hello,
Please review my change that covers that
http://projects.theforeman.org/projects/foreman/wiki/TemplateWriting/diff?utf8=ā&version=74&version_from=73&commit=View+differences
Hope this helps
Ā·Ā·Ā·
--
Marek
On Monday 04 of May 2015 23:17:24 Lev Michael wrote:
Thanks a lot!
Is there a chance to elaborate on the wiki?
Sent from Type Mail
On May 4, 2015, 15:13, at 15:13, Marek Hulan mhulan@redhat.com wrote:
On Monday 04 of May 2015 00:18:56 Lev Michael wrote:
I try to write a template and locate my provision interface but
foreman
canāt figure it out 
I am following
TemplateWriting - Foreman
and
writing <%= @host.provision_interface%>, I get
http://pastie.org/10126609 
Shouldnāt it give me the ethX identifier? I am using
foreman-1.9.0-0.develop.201504270854git4e21396.el7.noarch
To be clear, @host.primary_interface gives me the hostname.
Solved on IRC, sending the outcome - it āgave nothingā because
<%= @host.provision_interface %>
returns the interface object on which ERB calls to_s that equals to
"DNS name
of that interface". Michaelās DNS name of that interface was empty,
thatās why
it seemed as it does not return anything.
To get interface identifier the right snippet is
<%= @host.provision_interface.identifier %>
Similarly, one could get to other interface attributes, like IP, MAC,
ā¦
ā
Marek