Hi,
I'm trying to adapt a preseed provisioning template so it can deal with
bond interfaces.
While looking at the erb templates I encounter expressions like "dhcp =
subnet.dhcp_boot_mode" or "if !interface.managed?", I was wondering, where
can I find a complete description of these "objects" and their "properties
and methods?".
Thank you.
Xavier
Hi Xavier,
You can find an (outdated) list of these expressions here:
http://projects.theforeman.org/projects/foreman/wiki/TemplateWriting#Functions-and-macros
Keep in mind you can disable safe mode rendering in Settings if you
want to use other variables. They mostly have to do with the way
Foreman represents objects internally, look in the Foreman source for
objects in app/models that contain 'class Jail << ::Safemode::Jail' to
see exactly the attributes allowed per class.
Templates are written in ERB, and these parts are just Ruby code, so
you can experiment using the Rails console. 'foreman-rake console' or
cd-ing to the Foreman directory then running 'rails c' should bring it
up. Then you can look for objects like 'host =
Host.find_by_name('xavier.naveira.com')' and start fiddling with
that.
Let us know if you need more help. Thank you!
···
On Mon, Jan 19, 2015 at 5:13 PM, Xavier Naveira wrote:
> Hi,
>
> I'm trying to adapt a preseed provisioning template so it can deal with bond
> interfaces.
>
> While looking at the erb templates I encounter expressions like "dhcp =
> subnet.dhcp_boot_mode" or "if !interface.managed?", I was wondering, where
> can I find a complete description of these "objects" and their "properties
> and methods?".
>
> Thank you.
>
> Xavier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, 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.
–
Daniel Lobato
@elobatoss
blog.daniellobato.me
daniellobato.me
GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Thank you for your answer Daniel! I'll take a look to the docs/source.
Saludos,
Xavier
···
On Mon, Jan 19, 2015 at 6:35 PM, Daniel Lobato wrote:
Hi Xavier,
You can find an (outdated) list of these expressions here:
TemplateWriting - Foreman
Keep in mind you can disable safe mode rendering in Settings if you
want to use other variables. They mostly have to do with the way
Foreman represents objects internally, look in the Foreman source for
objects in app/models that contain ‘class Jail << ::Safemode::Jail’ to
see exactly the attributes allowed per class.
Templates are written in ERB, and these parts are just Ruby code, so
you can experiment using the Rails console. ‘foreman-rake console’ or
cd-ing to the Foreman directory then running ‘rails c’ should bring it
up. Then you can look for objects like ‘host =
Host.find_by_name(‘xavier.naveira.com’)’ and start fiddling with
that.
Let us know if you need more help. Thank you!
On Mon, Jan 19, 2015 at 5:13 PM, Xavier Naveira xnaveira@gmail.com > wrote:
Hi,
I’m trying to adapt a preseed provisioning template so it can deal with
bond
interfaces.
While looking at the erb templates I encounter expressions like “dhcp =
subnet.dhcp_boot_mode” or “if !interface.managed?”, I was wondering,
where
can I find a complete description of these “objects” and their
"properties
and methods?".
Thank you.
Xavier
–
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, 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.
–
Daniel Lobato
@elobatoss
blog.daniellobato.me
daniellobato.me
GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
–
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, 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.