Error while provisioning instance on EC2 using Foreman GUI

I am trying to provision an instance on EC2. Facing a problem there.

I am expecting the instance to have puppet agent installed on it.

Foreman starts to create the instance but fails while executing post
install scripts.

I can see the following in production.log

Prepare post installation script for ec2puppet3.proserv.com task failed
with the following error: undefined method grub_pass' for #<Host::Managed:0x000000092311e0>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:inmethod_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in
method_missing' /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/scope.rb:37:inmethod_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:102:in
`bind'
/

I am using the latest version of Foreman. The installation itself completed
without any errors.

Please let me know if any more information is required.

Regards,
Abhijeet

I could go around this. Looks like I was not providing the correct
provisioning templates.

Now I am getting another error in the production.log.
Started GET "/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938" for
123.201.119.171 at 2014-04-07 08:48:09 -0400
Processing by TasksController#show as /
Parameters: {"id"=>"85fafb4e-5ebb-4325-9cd0-f849d7426938"}
Rendered tasks/_list.html.erb (0.8ms)
Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms)
About to start post launch script on ec2743.proserv.com
generating template to upload to ec2743.proserv.com
Prepare post installation script for ec2743.proserv.com task failed with
the following error: undefined method 'root_pass' for Host::Managed::Jail
(Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in
method_missing' /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:inbind'
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in
eval' /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:ineval'
/usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe'

Looks like the root_password is not being set properly.

Can somebody please tell what is missing?
I have set the following templates -
finish - Jumpstart default finish
PXELinux - Kickstart default PXELinux
PXEGrub - PXEGrub default local boot
provision - Kickstart

You need a finish-style template associated to the OS. You could
probably copy the %post section from the "Kickstart default" template if
you're provisioning an EL-type OS, or use the "Preseed default finish"
template if you're provisioning a Debian-type OS.

I don't think associating the "Jumpstart default finish" will work
unless you're actually provisioning Solaris.

··· -- Dominic Cleal Red Hat Engineering

On 07/04/14 13:58, Abhijeet Joshi wrote:

I could go around this. Looks like I was not providing the correct
provisioning templates.

Now I am getting another error in the production.log.
Started GET “/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938” for
123.201.119.171 at 2014-04-07 08:48:09 -0400
Processing by TasksController#show as /
Parameters: {“id”=>“85fafb4e-5ebb-4325-9cd0-f849d7426938”}
Rendered tasks/_list.html.erb (0.8ms)
Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms)
About to start post launch script on ec2743.proserv.com
generating template to upload to ec2743.proserv.com
Prepare post installation script for ec2743.proserv.com task failed with
the following error: undefined method ‘root_pass’ for
Host::Managed::Jail
(Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in
method_missing' /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:inbind’
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in
eval' /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:ineval’
/usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe’

Looks like the root_password is not being set properly.

Can somebody please tell what is missing?
I have set the following templates -
finish - Jumpstart default finish
PXELinux - Kickstart default PXELinux
PXEGrub - PXEGrub default local boot
provision - Kickstart


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
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto: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.

Thanks Dominic. That worked.
I created a new finish template and copied the %post part of the Kikcstart
RHEL default template to the new template. That seems to have resolved the
root password related error.

But now I am getting another error.
Started GET "/tasks/ebb46c98-cd63-44c4-95be-9ff9b24b2d5c" for
123.201.119.153 at 2014-04-08 03:43:51 -0400
Processing by TasksController#show as /
Parameters: {"id"=>"ebb46c98-cd63-44c4-95be-9ff9b24b2d5c"}
Rendered tasks/_list.html.erb (0.5ms)
Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
About to start post launch script on ec28414.proserv.com
generating template to upload to ec28414.proserv.com
Prepare post installation script for ec28414.proserv.com task failed with
the following error: undefined local variable or method puppet_enabled' for #<Host::Managed:0x00000007ebba48>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:inmethod_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in
method_missing' (erb):26:inrender_safe'
/opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in eval' /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:inresult'
/usr/share/foreman/lib/foreman/renderer.rb:12:in render_safe' /usr/share/foreman/lib/foreman/renderer.rb:78:inunattended_render'
/usr/share/foreman/lib/foreman/renderer.rb:85:in `block in
unattended_render_to_temp_file'

Looks like puppet_enabled variable is not defined. Where should I define
that variable.
To work around this, i commented the references of this variable from the
templates that I have selected. But still I am getting this error.

Thanks and regards-
Abhijeet

··· On Monday, April 7, 2014 6:32:42 PM UTC+5:30, Dominic Cleal wrote: > > You need a finish-style template associated to the OS. You could > probably copy the %post section from the "Kickstart default" template if > you're provisioning an EL-type OS, or use the "Preseed default finish" > template if you're provisioning a Debian-type OS. > > I don't think associating the "Jumpstart default finish" will work > unless you're actually provisioning Solaris. > > -- > Dominic Cleal > Red Hat Engineering > > On 07/04/14 13:58, Abhijeet Joshi wrote: > > I could go around this. Looks like I was not providing the correct > > provisioning templates. > > > > Now I am getting another error in the production.log. > > Started GET "/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938" for > > 123.201.119.171 at 2014-04-07 08:48:09 -0400 > > Processing by TasksController#show as */* > > Parameters: {"id"=>"85fafb4e-5ebb-4325-9cd0-f849d7426938"} > > Rendered tasks/_list.html.erb (0.8ms) > > Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms) > > About to start post launch script on ec2743.proserv.com > > generating template to upload to ec2743.proserv.com > > Prepare post installation script for ec2743.proserv.com task failed > with > > the following error: undefined method 'root_pass' for > > Host::Managed::Jail > > > (Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in > > > `method_missing' > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:in > > > `bind' > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in > > > `eval' > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in > > > `eval' > > /usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe' > > > > Looks like the root_password is not being set properly. > > > > Can somebody please tell what is missing? > > I have set the following templates - > > finish - Jumpstart default finish > > PXELinux - Kickstart default PXELinux > > PXEGrub - PXEGrub default local boot > > provision - Kickstart > > > > -- > > 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-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > <mailto:forema...@googlegroups.com >. > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > >

You'll also need some of the variable declarations from the top of the
kickstart file:
https://github.com/theforeman/community-templates/blob/master/kickstart/provision.erb#L14-L22

I've just written a complete finish script and submitted it to the
templates repo, it might save you a few steps:
https://github.com/theforeman/community-templates/pull/69/files

Hopefully we can get this in 1.5.

··· -- Dominic Cleal Red Hat Engineering

On 08/04/14 10:05, Abhijeet Joshi wrote:

Thanks Dominic. That worked.
I created a new finish template and copied the %post part of the
Kikcstart RHEL default template to the new template. That seems to have
resolved the root password related error.

But now I am getting another error.
Started GET “/tasks/ebb46c98-cd63-44c4-95be-9ff9b24b2d5c” for
123.201.119.153 at 2014-04-08 03:43:51 -0400
Processing by TasksController#show as /
Parameters: {“id”=>“ebb46c98-cd63-44c4-95be-9ff9b24b2d5c”}
Rendered tasks/_list.html.erb (0.5ms)
Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
About to start post launch script on ec28414.proserv.com
generating template to upload to ec28414.proserv.com
Prepare post installation script for ec28414.proserv.com task failed
with the following error: undefined local variable or method
puppet_enabled' for #<Host::Managed:0x00000007ebba48>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in method_missing’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in
method_missing' (erb):26:in render_safe’
/opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in eval' /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in result’
/usr/share/foreman/lib/foreman/renderer.rb:12:in render_safe' /usr/share/foreman/lib/foreman/renderer.rb:78:in unattended_render’
/usr/share/foreman/lib/foreman/renderer.rb:85:in `block in
unattended_render_to_temp_file’

Looks like puppet_enabled variable is not defined. Where should I define
that variable.
To work around this, i commented the references of this variable from
the templates that I have selected. But still I am getting this error.

Thanks and regards-
Abhijeet

On Monday, April 7, 2014 6:32:42 PM UTC+5:30, Dominic Cleal wrote:

You need a finish-style template associated to the OS.  You could
probably copy the %post section from the "Kickstart default"
template if
you're provisioning an EL-type OS, or use the "Preseed default finish"
template if you're provisioning a Debian-type OS.

I don't think associating the "Jumpstart default finish" will work
unless you're actually provisioning Solaris.

-- 
Dominic Cleal
Red Hat Engineering

On 07/04/14 13:58, Abhijeet Joshi wrote:
> I could go around this. Looks like I was not providing the correct
> provisioning templates.
>
> Now I am getting another error in the production.log.
> Started GET "/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938" for
> 123.201.119.171 at 2014-04-07 08:48:09 -0400
> Processing by TasksController#show as */*
>   Parameters: {"id"=>"85fafb4e-5ebb-4325-9cd0-f849d7426938"}
>   Rendered tasks/_list.html.erb (0.8ms)
> Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms)
> About to start post launch script on ec2743.proserv.com
<http://ec2743.proserv.com>
> generating template to upload to ec2743.proserv.com
<http://ec2743.proserv.com>
> Prepare post installation script for ec2743.proserv.com
<http://ec2743.proserv.com> task failed with
> the following error: undefined method 'root_pass' for
> Host::Managed::Jail
>
(Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in

> `method_missing'
>
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:in

> `bind'
>
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in

> `eval'
>
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in

> `eval'
> /usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe'
>
> Looks like the root_password is not being set properly.
>
> Can somebody please tell what is missing?
> I have set the following templates -
> finish - Jumpstart default finish
> PXELinux - Kickstart default PXELinux
> PXEGrub - PXEGrub default local boot
> provision - Kickstart
>
> --
> 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-user...@googlegroups.com <javascript:>
> <mailto:foreman-users+unsubscribe@googlegroups.com <javascript:>>.
> To post to this group, send email to forema...@googlegroups.com
<javascript:>
> <mailto:forema...@googlegroups.com <javascript:>>.
> Visit this group at http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>.
> For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.


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
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto: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.

I took both of these.
Getting a new error now.
Started GET "/tasks/dcf0df04-4c0b-4c7e-b8b7-f8b8c97df9e6" for
123.201.119.195 at 2014-04-08 07:16:52 -0400
Processing by TasksController#show as /
Parameters: {"id"=>"dcf0df04-4c0b-4c7e-b8b7-f8b8c97df9e6"}
Rendered tasks/_list.html.erb (0.9ms)
Completed 200 OK in 5ms (Views: 1.7ms | ActiveRecord: 0.4ms)
About to start post launch script on ec28421.proserv.com
generating template to upload to ec28421.proserv.com
Prepare post installation script for ec28421.proserv.com task failed with
the following error: undefined method otp&#39; for #&lt;Host::Managed:0x000000090bc350&gt;/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:inmethod_missing'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in
method_missing&#39; (erb):29:inrender_safe'
/opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in eval&#39; /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:inresult'
/usr/share/foreman/lib/foreman/renderer.rb:12:in render_safe&#39; /usr/share/foreman/lib/foreman/renderer.rb:78:inunattended_render'
/usr/share/foreman/lib/foreman/renderer.rb:85:in `block in
unattended_render_to_temp_file'

There were references to @host.otp in both these templates. Commented them
out in the templates, yet getting these errors.
I checked the page for template writing. Didnt find any reference to
host.otp there. Is this new in foreman?
How should I resolve this error.
Sorry for the dumb questions, but I am really new to forman.

-Abhijeet

··· On Tuesday, April 8, 2014 2:40:43 PM UTC+5:30, Dominic Cleal wrote: > > You'll also need some of the variable declarations from the top of the > kickstart file: > > https://github.com/theforeman/community-templates/blob/master/kickstart/provision.erb#L14-L22 > > I've just written a complete finish script and submitted it to the > templates repo, it might save you a few steps: > https://github.com/theforeman/community-templates/pull/69/files > > Hopefully we can get this in 1.5. > > -- > Dominic Cleal > Red Hat Engineering > > On 08/04/14 10:05, Abhijeet Joshi wrote: > > Thanks Dominic. That worked. > > I created a new finish template and copied the %post part of the > > Kikcstart RHEL default template to the new template. That seems to have > > resolved the root password related error. > > > > But now I am getting another error. > > Started GET "/tasks/ebb46c98-cd63-44c4-95be-9ff9b24b2d5c" for > > 123.201.119.153 at 2014-04-08 03:43:51 -0400 > > Processing by TasksController#show as */* > > Parameters: {"id"=>"ebb46c98-cd63-44c4-95be-9ff9b24b2d5c"} > > Rendered tasks/_list.html.erb (0.5ms) > > Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms) > > About to start post launch script on ec28414.proserv.com > > generating template to upload to ec28414.proserv.com > > Prepare post installation script for ec28414.proserv.com task failed > > with the following error: undefined local variable or method > > `puppet_enabled' for > > > #/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in > > > `method_missing' > > > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in > > > `method_missing' > > (erb):26:in `render_safe' > > /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `eval' > > /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `result' > > /usr/share/foreman/lib/foreman/renderer.rb:12:in `render_safe' > > /usr/share/foreman/lib/foreman/renderer.rb:78:in `unattended_render' > > /usr/share/foreman/lib/foreman/renderer.rb:85:in `block in > > unattended_render_to_temp_file' > > > > Looks like puppet_enabled variable is not defined. Where should I define > > that variable. > > To work around this, i commented the references of this variable from > > the templates that I have selected. But still I am getting this error. > > > > Thanks and regards- > > Abhijeet > > > > On Monday, April 7, 2014 6:32:42 PM UTC+5:30, Dominic Cleal wrote: > > > > You need a finish-style template associated to the OS. You could > > probably copy the %post section from the "Kickstart default" > > template if > > you're provisioning an EL-type OS, or use the "Preseed default > finish" > > template if you're provisioning a Debian-type OS. > > > > I don't think associating the "Jumpstart default finish" will work > > unless you're actually provisioning Solaris. > > > > -- > > Dominic Cleal > > Red Hat Engineering > > > > On 07/04/14 13:58, Abhijeet Joshi wrote: > > > I could go around this. Looks like I was not providing the correct > > > provisioning templates. > > > > > > Now I am getting another error in the production.log. > > > Started GET "/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938" for > > > 123.201.119.171 at 2014-04-07 08:48:09 -0400 > > > Processing by TasksController#show as */* > > > Parameters: {"id"=>"85fafb4e-5ebb-4325-9cd0-f849d7426938"} > > > Rendered tasks/_list.html.erb (0.8ms) > > > Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms) > > > About to start post launch script on ec2743.proserv.com > > > > > generating template to upload to ec2743.proserv.com > > > > > Prepare post installation script for ec2743.proserv.com > > task failed with > > > the following error: undefined method 'root_pass' for > > > Host::Managed::Jail > > > > > > (Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in > > > > > > `method_missing' > > > > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:in > > > > > > `bind' > > > > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in > > > > > > `eval' > > > > > > /opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in > > > > > > `eval' > > > /usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe' > > > > > > Looks like the root_password is not being set properly. > > > > > > Can somebody please tell what is missing? > > > I have set the following templates - > > > finish - Jumpstart default finish > > > PXELinux - Kickstart default PXELinux > > > PXEGrub - PXEGrub default local boot > > > provision - Kickstart > > > > > > -- > > > 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-user...@googlegroups.com > > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > > To post to this group, send email to forema...@googlegroups.com > > > > > <mailto:forema...@googlegroups.com >. > > > Visit this group at http://groups.google.com/group/foreman-users > > . > > > For more options, visit https://groups.google.com/d/optout > > . > > > > -- > > 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-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > <mailto:forema...@googlegroups.com >. > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > > >

Sorry, yes, this is a Foreman 1.5 feature. If you comment out all the
realm or OTP related lines you should be fine.

··· -- Dominic Cleal Red Hat Engineering

On 08/04/14 12:21, Abhijeet Joshi wrote:

I took both of these.
Getting a new error now.
Started GET “/tasks/dcf0df04-4c0b-4c7e-b8b7-f8b8c97df9e6” for
123.201.119.195 at 2014-04-08 07:16:52 -0400
Processing by TasksController#show as /
Parameters: {“id”=>“dcf0df04-4c0b-4c7e-b8b7-f8b8c97df9e6”}
Rendered tasks/_list.html.erb (0.9ms)
Completed 200 OK in 5ms (Views: 1.7ms | ActiveRecord: 0.4ms)
About to start post launch script on ec28421.proserv.com
generating template to upload to ec28421.proserv.com
Prepare post installation script for ec28421.proserv.com task failed
with the following error: undefined method otp' for #<Host::Managed:0x000000090bc350>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:inmethod_missing’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in
method_missing' (erb):29:inrender_safe’
/opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in eval' /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:inresult’
/usr/share/foreman/lib/foreman/renderer.rb:12:in render_safe' /usr/share/foreman/lib/foreman/renderer.rb:78:inunattended_render’
/usr/share/foreman/lib/foreman/renderer.rb:85:in `block in
unattended_render_to_temp_file’

There were references to @host.otp in both these templates. Commented
them out in the templates, yet getting these errors.
I checked the page for template writing. Didnt find any reference to
host.otp there. Is this new in foreman?
How should I resolve this error.
Sorry for the dumb questions, but I am really new to forman.

-Abhijeet

On Tuesday, April 8, 2014 2:40:43 PM UTC+5:30, Dominic Cleal wrote:

You'll also need some of the variable declarations from the top of the
kickstart file:
https://github.com/theforeman/community-templates/blob/master/kickstart/provision.erb#L14-L22
<https://github.com/theforeman/community-templates/blob/master/kickstart/provision.erb#L14-L22>


I've just written a complete finish script and submitted it to the
templates repo, it might save you a few steps:
https://github.com/theforeman/community-templates/pull/69/files
<https://github.com/theforeman/community-templates/pull/69/files>

Hopefully we can get this in 1.5.

-- 
Dominic Cleal
Red Hat Engineering

On 08/04/14 10:05, Abhijeet Joshi wrote:
> Thanks Dominic. That worked.
> I created a new finish template and copied the %post part of the
> Kikcstart RHEL default template to the new template. That seems to
have
> resolved the root password related error.
>
> But now I am getting another error.
> Started GET "/tasks/ebb46c98-cd63-44c4-95be-9ff9b24b2d5c" for
> 123.201.119.153 at 2014-04-08 03:43:51 -0400
> Processing by TasksController#show as */*
>   Parameters: {"id"=>"ebb46c98-cd63-44c4-95be-9ff9b24b2d5c"}
>   Rendered tasks/_list.html.erb (0.5ms)
> Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.2ms)
> About to start post launch script on ec28414.proserv.com
<http://ec28414.proserv.com>
> generating template to upload to ec28414.proserv.com
<http://ec28414.proserv.com>
> Prepare post installation script for ec28414.proserv.com
<http://ec28414.proserv.com> task failed
> with the following error: undefined local variable or method
> `puppet_enabled' for
>
#<Host::Managed:0x00000007ebba48>/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in

> `method_missing'
>
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in

> `method_missing'
> (erb):26:in `render_safe'
> /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `eval'
> /opt/rh/ruby193/root/usr/share/ruby/erb.rb:838:in `result'
> /usr/share/foreman/lib/foreman/renderer.rb:12:in `render_safe'
> /usr/share/foreman/lib/foreman/renderer.rb:78:in `unattended_render'
> /usr/share/foreman/lib/foreman/renderer.rb:85:in `block in
> unattended_render_to_temp_file'
>
> Looks like puppet_enabled variable is not defined. Where should I
define
> that variable.
> To work around this, i commented the references of this variable from
> the templates that I have selected. But still I am getting this
error.
>
> Thanks and regards-
> Abhijeet
>
> On Monday, April 7, 2014 6:32:42 PM UTC+5:30, Dominic Cleal wrote:
>
>     You need a finish-style template associated to the OS.  You could
>     probably copy the %post section from the "Kickstart default"
>     template if
>     you're provisioning an EL-type OS, or use the "Preseed default
finish"
>     template if you're provisioning a Debian-type OS.
>
>     I don't think associating the "Jumpstart default finish" will
work
>     unless you're actually provisioning Solaris.
>
>     --
>     Dominic Cleal
>     Red Hat Engineering
>
>     On 07/04/14 13:58, Abhijeet Joshi wrote:
>     > I could go around this. Looks like I was not providing the
correct
>     > provisioning templates.
>     >
>     > Now I am getting another error in the production.log.
>     > Started GET "/tasks/85fafb4e-5ebb-4325-9cd0-f849d7426938" for
>     > 123.201.119.171 at 2014-04-07 08:48:09 -0400
>     > Processing by TasksController#show as */*
>     >   Parameters: {"id"=>"85fafb4e-5ebb-4325-9cd0-f849d7426938"}
>     >   Rendered tasks/_list.html.erb (0.8ms)
>     > Completed 200 OK in 4ms (Views: 1.6ms | ActiveRecord: 0.3ms)
>     > About to start post launch script on ec2743.proserv.com
<http://ec2743.proserv.com>
>     <http://ec2743.proserv.com>
>     > generating template to upload to ec2743.proserv.com
<http://ec2743.proserv.com>
>     <http://ec2743.proserv.com>
>     > Prepare post installation script for ec2743.proserv.com
<http://ec2743.proserv.com>
>     <http://ec2743.proserv.com> task failed with
>     > the following error: undefined method 'root_pass' for
>     > Host::Managed::Jail
>     >
>    
(Host::Managed)/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode/jail.rb:17:in

>
>     > `method_missing'
>     >
>    
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:53:in

>
>     > `bind'
>     >
>    
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in

>
>     > `eval'
>     >
>    
/opt/rh/ruby193/root/usr/share/gems/gems/safemode-1.2.0/lib/safemode.rb:51:in

>
>     > `eval'
>     > /usr/share/foreman/lib/foreman/renderer.rb:9:in `render_safe'
>     >
>     > Looks like the root_password is not being set properly.
>     >
>     > Can somebody please tell what is missing?
>     > I have set the following templates -
>     > finish - Jumpstart default finish
>     > PXELinux - Kickstart default PXELinux
>     > PXEGrub - PXEGrub default local boot
>     > provision - Kickstart
>     >
>     > --
>     > 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-user...@googlegroups.com <javascript:>
>     > <mailto:foreman-users+unsubscribe@googlegroups.com
<javascript:> <javascript:>>.
>     > To post to this group, send email to forema...@googlegroups.com
>     <javascript:>
>     > <mailto:forema...@googlegroups.com <javascript:>>.
>     > Visit this group at
http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>
>     <http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>>.
>     > For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>
>     <https://groups.google.com/d/optout
<https://groups.google.com/d/optout>>.
>
> --
> 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-user...@googlegroups.com <javascript:>
> <mailto:foreman-users+unsubscribe@googlegroups.com <javascript:>>.
> To post to this group, send email to forema...@googlegroups.com
<javascript:>
> <mailto:forema...@googlegroups.com <javascript:>>.
> Visit this group at http://groups.google.com/group/foreman-users
<http://groups.google.com/group/foreman-users>.
> For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.


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
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto: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 Dominic,
Thanks a lot for the help. This is working perfectly now.

Best regards,
Abhijeet