So I'm very new to Ruby, but am trying to learn it using Foreman as my
guide as I'd like to work on extending Foreman a bit. I'm attempting
to add a new UnattendedHelper function to return the information for a
host's subnet so that something like this can be included a kickstart
file
network --bootproto=static --ip=<%= @host.ip %>
–netmask=<%= @host.subnet.netmask %> --gateway=<%=
@host.subnet.gateway %>
–dns=<%= @host.subnet.dns %>
The intention is to allow for dynamic IP use by the host being
provisioned and still allow the kickstart to set a static IP so that
on first boot it's already set.
What I'm having trouble with is figuring out how to add a method to
app/helpers/unattended_helper.rb (if that's indeed the correct place
to do this). Additionally where to look in the code to add a field to
the Subnet form to define at least one DNS IP.
Maybe a quick example of how to pull in the "subnet_id" value for a
host would help. I can then call DHCP.subnet(id) to pull in the
host's assigned subnet information? Any advice or help would be
greatly appreciated.
Thanks
> So I'm very new to Ruby, but am trying to learn it using Foreman as my
> guide as I'd like to work on extending Foreman a bit. I'm attempting
> to add a new UnattendedHelper function to return the information for a
> host's subnet so that something like this can be included a kickstart
> file
>
> network --bootproto=static --ip=<%= @host.ip %>
> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> @host.subnet.gateway %>
> --dns=<%= @host.subnet.dns %>
>
> The intention is to allow for dynamic IP use by the host being
> provisioned and still allow the kickstart to set a static IP so that
> on first boot it's already set.
>
> What I'm having trouble with is figuring out how to add a method to
> app/helpers/unattended_helper.rb (if that's indeed the correct place
> to do this). Additionally where to look in the code to add a field to
> the Subnet form to define at least one DNS IP.
>
I think you are doing it correctly, but probably blocked by the safe
rendering, try disable it (more --> settings) then you should be able
to access the subnet model.
one good way to experiment, is using rails console
> Maybe a quick example of how to pull in the "subnet_id" value for a
> host would help. I can then call DHCP.subnet(id) to pull in the
> host's assigned subnet information? Any advice or help would be
> greatly appreciated.
You generally need to add a rails migration, try googling for that, we
can try to help you further on irc?
Ohad
···
On Thu, Nov 10, 2011 at 8:41 PM, treydock wrote:
>
> Thanks
> - Trey
>
> --
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>
>
Hi Trey
Now that i finally found time to play around with Foreman this is the
exact thing that i am missing as well. Would be great so see it in one
of the future Foreman Releases.
Markus
···
On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
> I'm attempting
> to add a new UnattendedHelper function to return the information for a
> host's subnet so that something like this can be included a kickstart
> file
>
> network --bootproto=static --ip=<%= @host.ip %> \
> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> @host.subnet.gateway %> \
> --dns=<%= @host.subnet.dns %>
>
> The intention is to allow for dynamic IP use by the host being
> provisioned and still allow the kickstart to set a static IP so that
> on first boot it's already set.
I forgot to mention, but its possible to achieve the same thing by
using foreman smart variables.
they would be available in your template as @host.params["var"] or
simply $var in your puppet code.
You could define attributes in the scope of your subnet etc.
Ohad
···
On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer wrote:
> On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
>> I'm attempting
>> to add a new UnattendedHelper function to return the information for a
>> host's subnet so that something like this can be included a kickstart
>> file
>>
>> network --bootproto=static --ip=<%= @host.ip %> \
>> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
>> @host.subnet.gateway %> \
>> --dns=<%= @host.subnet.dns %>
>>
>> The intention is to allow for dynamic IP use by the host being
>> provisioned and still allow the kickstart to set a static IP so that
>> on first boot it's already set.
>
> Hi Trey
>
> Now that i finally found time to play around with Foreman this is the
> exact thing that i am missing as well. Would be great so see it in one
> of the future Foreman Releases.
>
> Markus
>
> --
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>
>
That would work too. I've got something working, using the existing
subnets to define the IPs. Unfortunately I don't think my approach is
very "ruby-ish".
I was wanting to have things accessed like so <%= @subnet.ip %>, but
am I correct that this would require modifying the subnet model with
something like "alias_attribute :ip" ?
What I have is this in app/helpers/unattended_helper.rb
def subnet
subnet = Subnet.find(@host.subnet_id)
{:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
subnet.dns }
end
And the values are used like this from the kickstart template
network --bootproto static --hostname <%= @host.name %> --ip=<%=
@host.ip %>
–netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> –
nameserver=<%= subnet[:dns] %>
To facilitate the use of "gateway" and "dns" I added those two fields
to the subnets form and DB
Is that approach acceptable and in line with how Foreman is modeled ?
Thanks
···
On Nov 21, 1:31 am, Ohad Levy wrote:
> I forgot to mention, but its possible to achieve the same thing by
> using foreman smart variables.
> they would be available in your template as @host.params["var"] or
> simply $var in your puppet code.
>
> You could define attributes in the scope of your subnet etc.
>
> Ohad
>
> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer
>
>
>
>
>
>
>
> wrote:
> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
> >> I'm attempting
> >> to add a new UnattendedHelper function to return the information for a
> >> host's subnet so that something like this can be included a kickstart
> >> file
>
> >> network --bootproto=static --ip=<%= @host.ip %> \
> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> >> @host.subnet.gateway %> \
> >> --dns=<%= @host.subnet.dns %>
>
> >> The intention is to allow for dynamic IP use by the host being
> >> provisioned and still allow the kickstart to set a static IP so that
> >> on first boot it's already set.
>
> > Hi Trey
>
> > Now that i finally found time to play around with Foreman this is the
> > exact thing that i am missing as well. Would be great so see it in one
> > of the future Foreman Releases.
>
> > Markus
>
> > --
> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> > To post to this group, send email to foreman-users@googlegroups.com.
> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
> That would work too. I've got something working, using the existing
> subnets to define the IPs. Unfortunately I don't think my approach is
> very "ruby-ish".
>
> I was wanting to have things accessed like so <%= @subnet.ip %>, but
> am I correct that this would require modifying the subnet model with
> something like "alias_attribute :ip" ?
>
> What I have is this in app/helpers/unattended_helper.rb
>
> def subnet
> subnet = Subnet.find(@host.subnet_id)
>
> {:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
> subnet.dns }
> end
>
> And the values are used like this from the kickstart template
>
> network --bootproto static --hostname <%= @host.name %> --ip=<%=
> @host.ip %>
> --netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> –
> nameserver=<%= subnet[:dns] %>
>
>
> To facilitate the use of "gateway" and "dns" I added those two fields
> to the subnets form and DB
>
> Is that approach acceptable and in line with how Foreman is modeled ?
Your approch is sane, and I would be happy for such a patch, but I
think that its a very specific solution.
imho, the smart variables exposes a greater option for everyone to add
the attributes (and values) they need, rather then force it into
foreman code.
Ohad
···
On Wed, Nov 23, 2011 at 12:35 AM, treydock wrote:
>
> Thanks
> - Trey
>
>
> On Nov 21, 1:31 am, Ohad Levy wrote:
>> I forgot to mention, but its possible to achieve the same thing by
>> using foreman smart variables.
>> they would be available in your template as @host.params["var"] or
>> simply $var in your puppet code.
>>
>> You could define attributes in the scope of your subnet etc.
>>
>> Ohad
>>
>> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer
>>
>>
>>
>>
>>
>>
>>
>> wrote:
>> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
>> >> I'm attempting
>> >> to add a new UnattendedHelper function to return the information for a
>> >> host's subnet so that something like this can be included a kickstart
>> >> file
>>
>> >> network --bootproto=static --ip=<%= @host.ip %> \
>> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
>> >> @host.subnet.gateway %> \
>> >> --dns=<%= @host.subnet.dns %>
>>
>> >> The intention is to allow for dynamic IP use by the host being
>> >> provisioned and still allow the kickstart to set a static IP so that
>> >> on first boot it's already set.
>>
>> > Hi Trey
>>
>> > Now that i finally found time to play around with Foreman this is the
>> > exact thing that i am missing as well. Would be great so see it in one
>> > of the future Foreman Releases.
>>
>> > Markus
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
>> > To post to this group, send email to foreman-users@googlegroups.com.
>> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
>> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>
>
I will try the smart variable approach and see how the work flow
differs. I'll submit my patch once I'm back at my office, just in
case there's additional interest or a future desire for this.
This is likely also a very specific use case, but all the items that
accept variables (hostgroups, environment, templates, OS, etc) are
used by all my servers in all subnets. So I would almost have to
specify these parameters on a per-host basis. Is there possibly a
better place I could add these items that would allow for efficient re-
use ?
Thanks
···
> > very "ruby-ish".
>
> > I was wanting to have things accessed like so <%= @subnet.ip %>, but
> > am I correct that this would require modifying the subnet model with
> > something like "alias_attribute :ip" ?
>
> > What I have is this in app/helpers/unattended_helper.rb
>
> > def subnet
> > subnet = Subnet.find(@host.subnet_id)
>
> > {:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
> > subnet.dns }
> > end
>
> > And the values are used like this from the kickstart template
>
> > network --bootproto static --hostname <%= @host.name %> --ip=<%=
> > @host.ip %> \
> > --netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> --
> > nameserver=<%= subnet[:dns] %>
>
> > To facilitate the use of "gateway" and "dns" I added those two fields
> > to the subnets form and DB
>
> > Is that approach acceptable and in line with how Foreman is modeled ?
>
> Your approch is sane, and I would be happy for such a patch, but I
> think that its a very specific solution.
>
> imho, the smart variables exposes a greater option for everyone to add
> the attributes (and values) they need, rather then force it into
> foreman code.
>
> Ohad
>
>
>
>
>
>
>
>
>
> > Thanks
> > - Trey
>
> > On Nov 21, 1:31 am, Ohad Levy wrote:
> >> I forgot to mention, but its possible to achieve the same thing by
> >> using foreman smart variables.
> >> they would be available in your template as @host.params["var"] or
> >> simply $var in your puppet code.
>
> >> You could define attributes in the scope of your subnet etc.
>
> >> Ohad
>
> >> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer > > >> wrote:
> >> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
> >> >> I'm attempting
> >> >> to add a new UnattendedHelper function to return the information for a
> >> >> host's subnet so that something like this can be included a kickstart
> >> >> file
>
> >> >> network --bootproto=static --ip=<%= @host.ip %> \
> >> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> >> >> @host.subnet.gateway %> \
> >> >> --dns=<%= @host.subnet.dns %>
>
> >> >> The intention is to allow for dynamic IP use by the host being
> >> >> provisioned and still allow the kickstart to set a static IP so that
> >> >> on first boot it's already set.
>
> >> > Hi Trey
>
> >> > Now that i finally found time to play around with Foreman this is the
> >> > exact thing that i am missing as well. Would be great so see it in one
> >> > of the future Foreman Releases.
>
> >> > Markus
>
> >> > --
> >> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> >> > To post to this group, send email to foreman-users@googlegroups.com.
> >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> > To post to this group, send email to foreman-users@googlegroups.com.
> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
Hi,
i am very interested in these patch.
rgds f0
···
On Nov 25, 6:50 am, treydock wrote:
> I will try the smart variable approach and see how the work flow
> differs. I'll submit my patch once I'm back at my office, just in
> case there's additional interest or a future desire for this.
>
> This is likely also a very specific use case, but all the items that
> accept variables (hostgroups, environment, templates, OS, etc) are
> used by all my servers in all subnets. So I would almost have to
> specify these parameters on a per-host basis. Is there possibly a
> better place I could add these items that would allow for efficient re-
> use ?
>
> Thanks
> - Trey
>
>
>
>
>
>
>
> > > very "ruby-ish".
>
> > > I was wanting to have things accessed like so <%= @subnet.ip %>, but
> > > am I correct that this would require modifying the subnet model with
> > > something like "alias_attribute :ip" ?
>
> > > What I have is this in app/helpers/unattended_helper.rb
>
> > > def subnet
> > > subnet = Subnet.find(@host.subnet_id)
>
> > > {:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
> > > subnet.dns }
> > > end
>
> > > And the values are used like this from the kickstart template
>
> > > network --bootproto static --hostname <%= @host.name %> --ip=<%=
> > > @host.ip %> \
> > > --netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> --
> > > nameserver=<%= subnet[:dns] %>
>
> > > To facilitate the use of "gateway" and "dns" I added those two fields
> > > to the subnets form and DB
>
> > > Is that approach acceptable and in line with how Foreman is modeled ?
>
> > Your approch is sane, and I would be happy for such a patch, but I
> > think that its a very specific solution.
>
> > imho, the smart variables exposes a greater option for everyone to add
> > the attributes (and values) they need, rather then force it into
> > foreman code.
>
> > Ohad
>
> > > Thanks
> > > - Trey
>
> > > On Nov 21, 1:31 am, Ohad Levy wrote:
> > >> I forgot to mention, but its possible to achieve the same thing by
> > >> using foreman smart variables.
> > >> they would be available in your template as @host.params["var"] or
> > >> simply $var in your puppet code.
>
> > >> You could define attributes in the scope of your subnet etc.
>
> > >> Ohad
>
> > >> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer > > > >> wrote:
> > >> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
> > >> >> I'm attempting
> > >> >> to add a new UnattendedHelper function to return the information for a
> > >> >> host's subnet so that something like this can be included a kickstart
> > >> >> file
>
> > >> >> network --bootproto=static --ip=<%= @host.ip %> \
> > >> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> > >> >> @host.subnet.gateway %> \
> > >> >> --dns=<%= @host.subnet.dns %>
>
> > >> >> The intention is to allow for dynamic IP use by the host being
> > >> >> provisioned and still allow the kickstart to set a static IP so that
> > >> >> on first boot it's already set.
>
> > >> > Hi Trey
>
> > >> > Now that i finally found time to play around with Foreman this is the
> > >> > exact thing that i am missing as well. Would be great so see it in one
> > >> > of the future Foreman Releases.
>
> > >> > Markus
>
> > >> > --
> > >> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> > >> > To post to this group, send email to foreman-users@googlegroups.com.
> > >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> > >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> > > To post to this group, send email to foreman-users@googlegroups.com.
> > > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
> I will try the smart variable approach and see how the work flow
> differs. I'll submit my patch once I'm back at my office, just in
> case there's additional interest or a future desire for this.
>
> This is likely also a very specific use case, but all the items that
> accept variables (hostgroups, environment, templates, OS, etc) are
> used by all my servers in all subnets. So I would almost have to
> specify these parameters on a per-host basis. Is there possibly a
> better place I could add these items that would allow for efficient re-
> use ?
not sure if I follow, but you can avoid reentering data, thats the
whole idea, try out the smart vars and let us know how it worked out.
btw: I would love to see that patch.
thanks,
Ohad
···
On Fri, Nov 25, 2011 at 7:50 AM, treydock wrote:
>
> Thanks
> - Trey
>
>> > very "ruby-ish".
>>
>> > I was wanting to have things accessed like so <%= @subnet.ip %>, but
>> > am I correct that this would require modifying the subnet model with
>> > something like "alias_attribute :ip" ?
>>
>> > What I have is this in app/helpers/unattended_helper.rb
>>
>> > def subnet
>> > subnet = Subnet.find(@host.subnet_id)
>>
>> > {:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
>> > subnet.dns }
>> > end
>>
>> > And the values are used like this from the kickstart template
>>
>> > network --bootproto static --hostname <%= @host.name %> --ip=<%=
>> > @host.ip %> \
>> > --netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> --
>> > nameserver=<%= subnet[:dns] %>
>>
>> > To facilitate the use of "gateway" and "dns" I added those two fields
>> > to the subnets form and DB
>>
>> > Is that approach acceptable and in line with how Foreman is modeled ?
>>
>> Your approch is sane, and I would be happy for such a patch, but I
>> think that its a very specific solution.
>>
>> imho, the smart variables exposes a greater option for everyone to add
>> the attributes (and values) they need, rather then force it into
>> foreman code.
>>
>> Ohad
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > Thanks
>> > - Trey
>>
>> > On Nov 21, 1:31 am, Ohad Levy wrote:
>> >> I forgot to mention, but its possible to achieve the same thing by
>> >> using foreman smart variables.
>> >> they would be available in your template as @host.params["var"] or
>> >> simply $var in your puppet code.
>>
>> >> You could define attributes in the scope of your subnet etc.
>>
>> >> Ohad
>>
>> >> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer >> >> >> wrote:
>> >> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
>> >> >> I'm attempting
>> >> >> to add a new UnattendedHelper function to return the information for a
>> >> >> host's subnet so that something like this can be included a kickstart
>> >> >> file
>>
>> >> >> network --bootproto=static --ip=<%= @host.ip %> \
>> >> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
>> >> >> @host.subnet.gateway %> \
>> >> >> --dns=<%= @host.subnet.dns %>
>>
>> >> >> The intention is to allow for dynamic IP use by the host being
>> >> >> provisioned and still allow the kickstart to set a static IP so that
>> >> >> on first boot it's already set.
>>
>> >> > Hi Trey
>>
>> >> > Now that i finally found time to play around with Foreman this is the
>> >> > exact thing that i am missing as well. Would be great so see it in one
>> >> > of the future Foreman Releases.
>>
>> >> > Markus
>>
>> >> > --
>> >> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
>> >> > To post to this group, send email to foreman-users@googlegroups.com.
>> >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
>> >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
>> > To post to this group, send email to foreman-users@googlegroups.com.
>> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
>> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Foreman users" group.
> To post to this group, send email to foreman-users@googlegroups.com.
> To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.
>
>
I've added an issue and attached the patch file
http://theforeman.org/issues/1361
···
On Nov 28, 3:04 am, Ohad Levy wrote:
> On Fri, Nov 25, 2011 at 7:50 AM, treydock wrote:
> > I will try the smart variable approach and see how the work flow
> > differs. I'll submit my patch once I'm back at my office, just in
> > case there's additional interest or a future desire for this.
>
> > This is likely also a very specific use case, but all the items that
> > accept variables (hostgroups, environment, templates, OS, etc) are
> > used by all my servers in all subnets. So I would almost have to
> > specify these parameters on a per-host basis. Is there possibly a
> > better place I could add these items that would allow for efficient re-
> > use ?
>
> not sure if I follow, but you can avoid reentering data, thats the
> whole idea, try out the smart vars and let us know how it worked out.
>
> btw: I would love to see that patch.
>
> thanks,
> Ohad
>
>
>
>
>
>
>
>
>
> > Thanks
> > - Trey
>
> >> > very "ruby-ish".
>
> >> > I was wanting to have things accessed like so <%= @subnet.ip %>, but
> >> > am I correct that this would require modifying the subnet model with
> >> > something like "alias_attribute :ip" ?
>
> >> > What I have is this in app/helpers/unattended_helper.rb
>
> >> > def subnet
> >> > subnet = Subnet.find(@host.subnet_id)
>
> >> > {:gateway => subnet.gateway , :mask => subnet.mask, :dns =>
> >> > subnet.dns }
> >> > end
>
> >> > And the values are used like this from the kickstart template
>
> >> > network --bootproto static --hostname <%= @host.name %> --ip=<%=
> >> > @host.ip %> \
> >> > --netmask=<%= subnet[:mask] %> --gateway=<%= subnet[:gateway] %> --
> >> > nameserver=<%= subnet[:dns] %>
>
> >> > To facilitate the use of "gateway" and "dns" I added those two fields
> >> > to the subnets form and DB
>
> >> > Is that approach acceptable and in line with how Foreman is modeled ?
>
> >> Your approch is sane, and I would be happy for such a patch, but I
> >> think that its a very specific solution.
>
> >> imho, the smart variables exposes a greater option for everyone to add
> >> the attributes (and values) they need, rather then force it into
> >> foreman code.
>
> >> Ohad
>
> >> > Thanks
> >> > - Trey
>
> >> > On Nov 21, 1:31 am, Ohad Levy wrote:
> >> >> I forgot to mention, but its possible to achieve the same thing by
> >> >> using foreman smart variables.
> >> >> they would be available in your template as @host.params["var"] or
> >> >> simply $var in your puppet code.
>
> >> >> You could define attributes in the scope of your subnet etc.
>
> >> >> Ohad
>
> >> >> On Fri, Nov 18, 2011 at 1:01 PM, Markus Nussdorfer > > >> >> wrote:
> >> >> > On Thu, Nov 10, 2011 at 7:41 PM, treydock wrote:
> >> >> >> I'm attempting
> >> >> >> to add a new UnattendedHelper function to return the information for a
> >> >> >> host's subnet so that something like this can be included a kickstart
> >> >> >> file
>
> >> >> >> network --bootproto=static --ip=<%= @host.ip %> \
> >> >> >> --netmask=<%= @host.subnet.netmask %> --gateway=<%=
> >> >> >> @host.subnet.gateway %> \
> >> >> >> --dns=<%= @host.subnet.dns %>
>
> >> >> >> The intention is to allow for dynamic IP use by the host being
> >> >> >> provisioned and still allow the kickstart to set a static IP so that
> >> >> >> on first boot it's already set.
>
> >> >> > Hi Trey
>
> >> >> > Now that i finally found time to play around with Foreman this is the
> >> >> > exact thing that i am missing as well. Would be great so see it in one
> >> >> > of the future Foreman Releases.
>
> >> >> > Markus
>
> >> >> > --
> >> >> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> >> >> > To post to this group, send email to foreman-users@googlegroups.com.
> >> >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> >> >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> >> > --
> >> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> >> > To post to this group, send email to foreman-users@googlegroups.com.
> >> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> >> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups "Foreman users" group.
> > To post to this group, send email to foreman-users@googlegroups.com.
> > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/foreman-users?hl=en.