@static and no puppet install

Hi all,

I'm very new to foreman, I'm wanting to force static ip config, somehow
using @static value ?

I'd also like to define two host groups, one for puppet managed hosts and
another for foreman managed without the puppet install but I'm not really
sure how to go about this ?

Also has anyone got bonding to work via kickstart or preseed ?

Thanks in advance

Regards, Daniel

OK,

Maybe not the best way to do this but to disable puppet from kickstart

#pm_set = @host.puppetmaster.empty? ? false : true
#puppet_enabled = pm_set || @host.params['force-puppet']
puppet_enabled = false

Then to make the static always be used

#network --bootproto <%= @static ? "static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(',')}" : 'dhcp' %> --hostname <%= @host %>

network --bootproto <%= "static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(',')}" %> --hostname <%= @host %>

Let me know if there is a cleaner way of doing this.

Regards, Daniel

··· On Sunday, 9 February 2014 16:36:10 UTC+11, Daniel Rolfe wrote: > > Hi all, > > I'm very new to foreman, I'm wanting to force static ip config, somehow > using @static value ? > > I'd also like to define two host groups, one for puppet managed hosts and > another for foreman managed without the puppet install but I'm not really > sure how to go about this ? > > Also has anyone got bonding to work via kickstart or preseed ? > > Thanks in advance > > Regards, Daniel > >

> OK,
>
> Maybe not the best way to do this but to disable puppet from kickstart
>
>
> #pm_set = @host.puppetmaster.empty? ? false : true
> #puppet_enabled = pm_set || @host.params['force-puppet']
> puppet_enabled = false

If you don't set a puppet master and Puppet CA on the host or host
group, then this should be false. You can also add a "force-puppet"
parameter to your host group to force it off.

> Then to make the static always be used
>
> #network --bootproto <%= @static ? "static --ip=#{@host.ip}
> --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
> --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
> n.blank?}.join(',')}" : 'dhcp' %> --hostname <%= @host %>
>
> network --bootproto <%= "static --ip=#{@host.ip}
> --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
> --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
> n.blank?}.join(',')}" %> --hostname <%= @host %>
>
> Let me know if there is a cleaner way of doing this.

To force a static config, you can change the PXELinux file which calls
the kickstart.

Here's the default PXELinux file we ship in Foreman 1.4:
https://github.com/theforeman/community-templates/blob/master/kickstart/PXELinux.erb

Where you have:
ks=<%= foreman_url('provision')%>

Change this to:
ks=<%= foreman_url('provision')%>&static=yes

This will set @static = yes when rendering the kickstart and you'll get
a static config.

··· On 10/02/14 01:53, Daniel Rolfe wrote:


Dominic Cleal
Red Hat Engineering

Hi,

Thanks for that, I did see reference to the "force-puppet" but didn't know what to do with it

If I add this as a host or group parameter what should I put as the value as it can't be blank etc…

Thanks again for your help

··· Sent from my iPhone

On 10 Feb 2014, at 10:38 pm, Dominic Cleal dcleal@redhat.com wrote:

On 10/02/14 01:53, Daniel Rolfe wrote:
OK,

Maybe not the best way to do this but to disable puppet from kickstart

#pm_set = @host.puppetmaster.empty? ? false : true
#puppet_enabled = pm_set || @host.params[‘force-puppet’]
puppet_enabled = false

If you don’t set a puppet master and Puppet CA on the host or host
group, then this should be false. You can also add a "force-puppet"
parameter to your host group to force it off.

Then to make the static always be used

#network --bootproto <%= @static ? “static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(’,’)}” : ‘dhcp’ %> --hostname <%= @host %>

network --bootproto <%= “static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(’,’)}” %> --hostname <%= @host %>

Let me know if there is a cleaner way of doing this.

To force a static config, you can change the PXELinux file which calls
the kickstart.

Here’s the default PXELinux file we ship in Foreman 1.4:
https://github.com/theforeman/community-templates/blob/master/kickstart/PXELinux.erb

Where you have:
ks=<%= foreman_url(‘provision’)%>

Change this to:
ks=<%= foreman_url(‘provision’)%>&static=yes

This will set @static = yes when rendering the kickstart and you’ll get
a static config.


Dominic Cleal
Red Hat Engineering


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/4BW5zU9norA/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/groups/opt_out.

Looking again, the force-puppet parameter's not going to be much use
here as I think even if you type "false" into the parameter field in the
UI, the template will treat it as "true" (since a string is "true" in Ruby).

Try changing the line in the template to this, and set force-puppet in
the UI to "false":

puppet_enabled = pm_set || (@host.params['force-puppet'] == 'true')

··· -- Dominic Cleal Red Hat Engineering

On 10/02/14 11:55, Daniel Rolfe wrote:

Hi,

Thanks for that, I did see reference to the “force-puppet” but didn’t know what to do with it

If I add this as a host or group parameter what should I put as the value as it can’t be blank etc…

Thanks again for your help

Sent from my iPhone

On 10 Feb 2014, at 10:38 pm, Dominic Cleal dcleal@redhat.com wrote:

On 10/02/14 01:53, Daniel Rolfe wrote:
OK,

Maybe not the best way to do this but to disable puppet from kickstart

#pm_set = @host.puppetmaster.empty? ? false : true
#puppet_enabled = pm_set || @host.params[‘force-puppet’]
puppet_enabled = false

If you don’t set a puppet master and Puppet CA on the host or host
group, then this should be false. You can also add a "force-puppet"
parameter to your host group to force it off.

Then to make the static always be used

#network --bootproto <%= @static ? “static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(’,’)}” : ‘dhcp’ %> --hostname <%= @host %>

network --bootproto <%= “static --ip=#{@host.ip}
–netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway}
–nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(’,’)}” %> --hostname <%= @host %>

Let me know if there is a cleaner way of doing this.

To force a static config, you can change the PXELinux file which calls
the kickstart.

Here’s the default PXELinux file we ship in Foreman 1.4:
https://github.com/theforeman/community-templates/blob/master/kickstart/PXELinux.erb

Where you have:
ks=<%= foreman_url(‘provision’)%>

Change this to:
ks=<%= foreman_url(‘provision’)%>&static=yes

This will set @static = yes when rendering the kickstart and you’ll get
a static config.


Dominic Cleal
Red Hat Engineering


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/4BW5zU9norA/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/groups/opt_out.