"No templates were configured" for image builds?

Should I expect the message "Sorry but no templates were configured." when
running a "resolve" check on a new host that is of an image type? Keep in
mind it DOES have a user data template attached as well as all the rest so
I'm a bit confused.

I expected it to find at least the user file but seems it's not, is that
normal? This is my first go at building from image using a vmware resource.
I don't seem to recall getting the same errors when I did similar on AWS.

Bit more information. Something else that comes up when I submit is:

C7_Gold_7.0.1406 needs user data, but CentOS-7.0.1406-GOLD is not
associated to any provisioning template of the kind user_data. Please
associate it with a suitable template or uncheck 'User data' for
C7_Gold_7.0.1406.

However I DO have a user data template assigned to the
"CentOS-7.0.1406-GOLD" and that template is of type "user data template"

I've attached some shots showing the options.

··· On Friday, September 8, 2017 at 7:00:08 PM UTC-5, Mike Wilson wrote: > > Should I expect the message "Sorry but no templates were configured." > when running a "resolve" check on a new host that is of an image type? Keep > in mind it DOES have a user data template attached as well as all the rest > so I'm a bit confused. > > I expected it to find at least the user file but seems it's not, is that > normal? This is my first go at building from image using a vmware resource. > I don't seem to recall getting the same errors when I did similar on AWS. > >

Hi Mike,

Is it possible you're hitting this issue:
Bug #20098: Cannot resolve user_data template with all kind of compute-resource - Foreman ?

– Ivan

··· On Sat, 9 Sep 2017 at 03:02, Mike Wilson wrote:

On Friday, September 8, 2017 at 7:00:08 PM UTC-5, Mike Wilson wrote:

Should I expect the message "Sorry but no templates were configured."
when running a “resolve” check on a new host that is of an image type? Keep
in mind it DOES have a user data template attached as well as all the rest
so I’m a bit confused.

I expected it to find at least the user file but seems it’s not, is that
normal? This is my first go at building from image using a vmware resource.
I don’t seem to recall getting the same errors when I did similar on AWS.

Bit more information. Something else that comes up when I submit is:

C7_Gold_7.0.1406 needs user data, but CentOS-7.0.1406-GOLD is not
associated to any provisioning template of the kind user_data. Please
associate it with a suitable template or uncheck ‘User data’ for
C7_Gold_7.0.1406.

However I DO have a user data template assigned to the
"CentOS-7.0.1406-GOLD" and that template is of type “user data template”

I’ve attached some shots showing the options.


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 https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Look at the output from the bug report mine appears different?

2017-09-11 16:00:28 6a0711d2 [app] [I] Current user: mikew (administrator)
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current user thread-local
variable to mikew
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization
thread-local variable to none
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location
thread-local variable to none
2017-09-11 16:00:28 6a0711d2 [app] [D] Unpermitted parameters: utf8,
authenticity_token, capabilities, provider, bare_metal_capabilities, locale
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization
thread-local variable to TEST1/TEST2/TEST3
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location
thread-local variable to TEST1/SITE01
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location
thread-local variable to none
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization
thread-local variable to none
2017-09-11 16:00:28 6a0711d2 [app] [I] Failed to save: centos7_7.3.1611
needs user data, but <a target='_blank'
href='/operatingsystems/1-CentOS%20Linux%207-3-1611/edit'>CentOS Linux
7.3.1611</a> is not associated to any provisioning template of the kind
user_data. Please associate it with a suitable template or uncheck 'User
data' for <a target='_blank'
href='/compute_resources/3/images/6/edit'>centos7_7.3.1611</a>.
2017-09-11 16:00:28 6a0711d2 [app] [I] Rendered hosts/_progress.html.erb
(0.2ms)
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization
thread-local variable to TEST1/TEST2/TEST3
2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location
thread-local variable to TEST1/SITE01

Although perhaps im not logging the same way? Currently my log-level is set
to "debug".

I did find some differences testing the "default" user_data templates that
exist in 1.15.1 foreman. With the "Kickstart default user data" it wouldn't
complain about a user_data template missing but then it would fail with

Failed to create a compute DCs (VMware) instance [random.host.name.com]:
undefined method `key?' for #<String:0x0000000a5160f8>

But when I used the one I showed above (cloned from the provided "UserData
default" in Foreman 1.15.1, it would not even try and displayed the error

Unable to save
centos7_7.3.1611 needs user data, but CentOS Linux 7.3.1611 is not
associated to any provisioning template of the kind user_data. Please
associate it with a suitable template or uncheck 'User data' for
centos7_7.3.1611.

··· On Saturday, September 9, 2017 at 11:42:58 AM UTC-5, Ivan Necas wrote: > > Hi Mike, > > Is it possible you're hitting this issue: > http://projects.theforeman.org/issues/20098 ? > > -- Ivan >

Do you have any backtrace form the "undefined method `key?' for
#<String:0x0000000a5160f8>"

– Ivan

··· On Mon, Sep 11, 2017 at 6:16 PM, Mike Wilson wrote: > Look at the output from the bug report mine appears different? > > 2017-09-11 16:00:28 6a0711d2 [app] [I] Current user: mikew (administrator) > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current user thread-local > variable to mikew > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization > thread-local variable to none > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location thread-local > variable to none > 2017-09-11 16:00:28 6a0711d2 [app] [D] Unpermitted parameters: utf8, > authenticity_token, capabilities, provider, bare_metal_capabilities, locale > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization > thread-local variable to TEST1/TEST2/TEST3 > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location thread-local > variable to TEST1/SITE01 > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location thread-local > variable to none > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization > thread-local variable to none > 2017-09-11 16:00:28 6a0711d2 [app] [I] Failed to save: centos7_7.3.1611 > needs user data, but href='/operatingsystems/1-CentOS%20Linux%207-3-1611/edit'>CentOS Linux > 7.3.1611 is not associated to any provisioning template of the kind > user_data. Please associate it with a suitable template or uncheck 'User > data' for href='/compute_resources/3/images/6/edit'>centos7_7.3.1611. > 2017-09-11 16:00:28 6a0711d2 [app] [I] Rendered hosts/_progress.html.erb > (0.2ms) > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current organization > thread-local variable to TEST1/TEST2/TEST3 > 2017-09-11 16:00:28 6a0711d2 [app] [D] Setting current location thread-local > variable to TEST1/SITE01 > > > Although perhaps im not logging the same way? Currently my log-level is set > to "debug". > > I did find some differences testing the "default" user_data templates that > exist in 1.15.1 foreman. With the "Kickstart default user data" it wouldn't > complain about a user_data template missing but then it would fail with > > Failed to create a compute DCs (VMware) instance [random.host.name.com]: > undefined method `key?' for # > > But when I used the one I showed above (cloned from the provided "UserData > default" in Foreman 1.15.1, it would not even try and displayed the error > > > Unable to save > centos7_7.3.1611 needs user data, but CentOS Linux 7.3.1611 is not > associated to any provisioning template of the kind user_data. Please > associate it with a suitable template or uncheck 'User data' for > centos7_7.3.1611. > > > > On Saturday, September 9, 2017 at 11:42:58 AM UTC-5, Ivan Necas wrote: >> >> Hi Mike, >> >> Is it possible you're hitting this issue: >> http://projects.theforeman.org/issues/20098 ? >> >> -- Ivan >>> >>> > -- > 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 https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.

>
> Do you have any backtrace form the "undefined method `key?' for
> #<String:0x0000000a5160f8>"
>
>
This?

2017-09-11 16:12:05 bcaeacb9 [app] [W] Failed to create a compute DCs
(VMware) instance random-host.name.com: undefined method key?&#39; for #&lt;String:0x0000000a5160f8&gt; &gt; &gt; NoMethodError: undefined methodkey?' for #<String:0x0000000a5160f8>
>
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.7.0/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb:16:in
cloudinit_to_customspec&#39; &gt; /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:474:inclone_vm'
>
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:409:in
create_vm&#39; &gt; /usr/share/foreman/app/models/concerns/orchestration/compute.rb:77:insetCompute'
> /usr/share/foreman/app/models/concerns/orchestration.rb:216:in execute&#39; &gt; /usr/share/foreman/app/models/concerns/orchestration.rb:144:inblock in
process'
> /usr/share/foreman/app/models/concerns/orchestration.rb:136:in each&#39; &gt; /usr/share/foreman/app/models/concerns/orchestration.rb:136:inprocess'
> /usr/share/foreman/app/models/concerns/orchestration.rb:44:in
around_save_orchestration&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:inblock in make_lambda'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:inblock in halting'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:inblock in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in
__run_callbacks__&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in_run_save_callbacks'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/callbacks.rb:302:in
create_or_update&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/persistence.rb:120:insave'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:37:in
save&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:21:insave'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:in
block (2 levels) in save&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:inblock in with_transaction_returning_status'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in
block in transaction&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:inwithin_new_transaction'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in
transaction&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:intransaction'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in
with_transaction_returning_status&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:inblock in save'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:301:in
rollback_active_record_state!&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:285:insave'
> /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in
save_with_type&#39; &gt; /usr/share/foreman/app/controllers/hosts_controller.rb:103:increate'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:4:in
send_action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:inprocess_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in
process_action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:inblock in process_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in
block (2 levels) in compile&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:inblock (2 levels) in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:inblock (2 levels) in halting'
> /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in
set_timezone&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:inblock in make_lambda'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:inblock in halting'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:inblock in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in
block (2 levels) in around&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in
block (2 levels) in halting&#39; &gt; /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:inclear_thread'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in
block in make_lambda&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in
block in halting&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in
block in around&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:inblock (2 levels) in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:inblock (2 levels) in halting'
>
/usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in
set_topbar_sweeper_controller&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:inblock in make_lambda'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:inblock in halting'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:inblock in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in
block (2 levels) in around&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in
block (2 levels) in halting&#39; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.4.1/lib/audited/sweeper.rb:14:inaround'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in
public_send&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:inblock in make_lambda'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:inblock in halting'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:inblock in around'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in
__run_callbacks__&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in_run_process_action_callbacks'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in
run_callbacks&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:inprocess_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in
process_action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:inblock in process_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in
block in instrument&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in
instrument&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:inprocess_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in
process_action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in
process_action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in
process&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:inprocess'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in
dispatch&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:indispatch'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in
block in action&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in
dispatch&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:inserve'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in
block in serve&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:ineach'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in
serve&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:incall'
>
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/static_dispatcher.rb:65:in
call&#39; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/extractor/recorder.rb:132:incall'
>
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/middleware/checksum_in_headers.rb:27:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:38:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in
call&#39; &gt; /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:225:incontext'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:220:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in
block in call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:inrun_callbacks'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in
_run_call_callbacks&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:inrun_callbacks'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in
call_app&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:22:incall'
> /usr/share/foreman/lib/middleware/tagged_logging.rb:18:in call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/methodoverride.rb:22:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/runtime.rb:18:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/sendfile.rb:113:in
call&#39; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-3.4.1/lib/secure_headers/middleware.rb:12:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in
call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:165:incall'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in
public_send&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:inmethod_missing'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in
block in call&#39; &gt; /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:ineach'
>
/opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in
call&#39; &gt; /usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:inprocess_request'
>
/usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:in
accept_and_process_next_request&#39; &gt; /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:inmain_loop'
> /usr/share/passenger/phusion_passenger/request_handler.rb:455:in `block
(3 levels) in start_threads'
>
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagno

··· On Monday, September 11, 2017 at 11:34:00 AM UTC-5, Ivan Necas wrote:

Hi, it seems like you're user-data template is not rendering a proper
YAML that YAML.load() would parse
as a Hash. Could you share the rendered user-data template with us or
even better, run irb and try:

require 'yaml'
YAML.parse(<<EOF)

RENDERED USER DATA

EOF

You should get a key-value hash. If you get string (which it seems you
get), it means the string is not in valid yaml format.

– Ivan

··· On Mon, Sep 11, 2017 at 9:30 PM, Mike Wilson wrote: > > > On Monday, September 11, 2017 at 11:34:00 AM UTC-5, Ivan Necas wrote: >> >> Do you have any backtrace form the "undefined method `key?' for >> #" >> > > This? > > 2017-09-11 16:12:05 bcaeacb9 [app] [W] Failed to create a compute DCs > (VMware) instance random-host.name.com: undefined method `key?' for > # > > > > NoMethodError: undefined method `key?' for # > > > /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.7.0/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb:16:in > `cloudinit_to_customspec' > > > /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:474:in > `clone_vm' > > > /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:409:in > `create_vm' > > /usr/share/foreman/app/models/concerns/orchestration/compute.rb:77:in > `setCompute' > > /usr/share/foreman/app/models/concerns/orchestration.rb:216:in `execute' > > /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `block in > process' > > /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `each' > > /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `process' > > /usr/share/foreman/app/models/concerns/orchestration.rb:44:in > `around_save_orchestration' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in > `block in make_lambda' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `block in halting' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `block in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in > `__run_callbacks__' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in > `_run_save_callbacks' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/callbacks.rb:302:in > `create_or_update' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/persistence.rb:120:in > `save' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:37:in > `save' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:21:in > `save' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:in > `block (2 levels) in save' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in > `block in with_transaction_returning_status' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in > `block in transaction' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in > `within_new_transaction' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in > `transaction' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in > `transaction' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in > `with_transaction_returning_status' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:in > `block in save' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:301:in > `rollback_active_record_state!' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:285:in > `save' > > /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in > `save_with_type' > > /usr/share/foreman/app/controllers/hosts_controller.rb:103:in `create' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:4:in > `send_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:in > `block in process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in > `block (2 levels) in compile' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in > `block (2 levels) in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `block (2 levels) in halting' > > /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in > `set_timezone' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in > `block in make_lambda' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `block in halting' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `block in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in > `block (2 levels) in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `block (2 levels) in halting' > > /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in > `clear_thread' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in > `block in make_lambda' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `block in halting' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `block in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in > `block (2 levels) in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `block (2 levels) in halting' > > > /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in > `set_topbar_sweeper_controller' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in > `block in make_lambda' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `block in halting' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `block in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in > `block (2 levels) in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in > `block (2 levels) in halting' > > > /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.4.1/lib/audited/sweeper.rb:14:in > `around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in > `public_send' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in > `block in make_lambda' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in > `block in halting' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in > `block in around' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in > `__run_callbacks__' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in > `_run_process_action_callbacks' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in > `run_callbacks' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in > `block in process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in > `block in instrument' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in > `instrument' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in > `instrument' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in > `process_action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in > `process' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in > `process' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in > `dispatch' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in > `dispatch' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in > `block in action' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in > `dispatch' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in > `serve' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in > `block in serve' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in > `each' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in > `serve' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in > `call' > > > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/static_dispatcher.rb:65:in > `call' > > > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/extractor/recorder.rb:132:in > `call' > > > /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.4.0/lib/apipie/middleware/checksum_in_headers.rb:27:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:38:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:in > `call' > > > /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in > `ca

The one in question is the Kickstart user_data default provided in Foreman
1.15.1. It doesn't look like yaml at all to me.

<%#
kind: user_data
name: Kickstart default user data
oses:

  • CentOS
  • Fedora
    -%>
    <%
    rhel_compatible = @host.operatingsystem.family == 'Redhat' &&
    @host.operatingsystem.name != 'Fedora'

    safemode renderer does not support unary negation

    pm_set = @host.puppetmaster.empty? ? false : true
    proxy_uri = @host.params['http-proxy'] ?
    "http://#{@host.params['http-proxy']}:#{@host.params['http-proxy-port']}" :
    nil
    puppet_enabled = pm_set || @host.param_true?('force-puppet')
    salt_enabled = @host.params['salt_master'] ? true : false
    chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
    -%>
    #!/bin/bash

<%# Cloud instances frequently have incorrect hosts data %>
<%= snippet 'fix_hosts' %>

<% if @host.provision_method == 'image' && !root_pass.empty? -%>

Install the root password

echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
<% end -%>

<% if proxy_uri -%>

Yum proxy

echo 'proxy = <%= proxy_uri %>' >> /etc/yum.conf
<% end -%>

#update local time
echo "updating system time"
yum -y install ntpdate
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] ||
'0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc

<% if rhel_compatible && !@host.param_false?('enable-epel') -%>
<%= snippet 'epel' -%>
<% end -%>

<% if @host.info['parameters']['realm'] && @host.realm &&
@host.realm.realm_type == 'FreeIPA' -%>
<%= snippet 'freeipa_register' %>
<% end -%>

<% unless @host.param_false?('package_upgrade') -%>

update all the base packages from the updates repository

if [ -f /usr/bin/dnf ]; then
dnf -y update
else
yum -t -y update
fi
<% end -%>

<%= snippet('remote_execution_ssh_keys') %>

<% if chef_enabled %>
<%= snippet 'chef_client' %>
<% end -%>

<% if puppet_enabled %>
<% if @host.param_true?('enable-puppetlabs-pc1-repo') ||
@host.param_true?('enable-puppetlabs-repo') -%>
<%= snippet 'puppetlabs_repo' %>
<% end -%>
<%= snippet 'puppet_setup' %>
<% end -%>

<% if salt_enabled %>
<%= snippet 'saltstack_setup' %>
<% end -%>

UserData still needs to mark the build as finished

/usr/bin/curl -o /dev/null -k '<%= foreman_url('built') %>'

The one that DOES have yaml look to it is the one that says "this is not a
user_data template". That is the one provided with Foreman 1.15.1 as
"UserData default"

<%#
kind: user_data
name: UserData default
oses:

  • CentOS
  • Fedora
  • Debian
  • Ubuntu
    -%>
    <%#
    This template accepts the following parameters:
  • ssh_pwauth: boolean (default=true unless ssh_authorized_keys)
  • ssh_authorized_keys: string w newline seperated keys (default="")
  • package_upgrade: boolean (default=false)
  • reboot: boolean (default=false)
    -%>
    <%
    ssh_pwauth = @host.params['ssh_pwauth'] ? @host.param_true?('ssh_pwauth')
    : !@host.params['ssh_authorized_keys']
    rhel_compatible = @host.operatingsystem.family == 'Redhat' &&
    @host.operatingsystem.name != 'Fedora'

    safemode renderer does not support unary negation

    pm_set = @host.puppetmaster.empty? ? false : true
    puppet_enabled = pm_set || @host.param_true?('force-puppet')
    salt_enabled = @host.params['salt_master'] ? true : false
    chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
    -%>
    #cloud-config
    hostname: <%= @host.shortname %>
    fqdn: <%= @host %>
    manage_etc_hosts: true
    <% if ssh_pwauth -%>
    <%# Don't enable this in production. It is very insecure! Use
    ssh_authorized_keys instead…

http://cloudinit.readthedocs.io/en/latest/topics/examples.html#including-users-and-groups
-%>
ssh_pwauth: true
groups:

  • admin
    users:
  • default
  • name: admin
    primary-group: admin
    groups: users
    shell: /bin/bash
    sudo: ['ALL=(ALL) ALL']
    lock-passwd: false
    passwd: <%= @host.root_pass %>
    <% end -%>
    <% if @host.params['ssh_authorized_keys'] -%>
    ssh_authorized_keys:
    <% @host.params['ssh_authorized_keys'].split("\n").each do |ssh_key| -%>
  • <%= ssh_key %>
    <% end -%>
    <% end -%>

<% if @host.param_true?('package_upgrade') -%>
package_upgrade: true
<% end -%>

runcmd:
<% if rhel_compatible -%>

  • |
    <%= indent(2) { snippet('epel') } %>
    <% end -%>
  • |
    <%= indent(2) { snippet('remote_execution_ssh_keys') } %>
    <% if chef_enabled -%>
  • |
    <%= indent(2) { snippet('chef_client') } %>
    <% end -%>
    <% if puppet_enabled -%>
  • |
    <%= indent(2) { snippet('puppetlabs_repo') } %>
  • |
    <%= indent(2) { snippet('puppet_setup') } %>
    <% end -%>
    <% if salt_enabled -%>
  • |
    <%= indent(2) { snippet('saltstack_setup') } %>
    <% end -%>

<%# Contact Foreman to confirm instance is built -%>
phone_home:
url: <%= foreman_url('built') %>
post: []
tries: 10

<% if @host.param_true?('reboot') -%>
power_state:
mode: reboot
timeout: 30
condition: true
<% end -%>

Does that help? I've only just started working with image builds so still
trying to pickup what goes where properly so it could be entirely me not
flipping the right switches.

··· On Monday, September 11, 2017 at 3:06:01 PM UTC-5, Ivan Necas wrote: > > Hi, it seems like you're user-data template is not rendering a proper > YAML that `YAML.load()` would parse > as a Hash. Could you share the rendered user-data template with us or > even better, run `irb` and try: > >

Funny enough, I filed an issue regarding this problem over a year ago
[1]. I would swear I've never seen it
if it hadn't me as author of the ticket :slight_smile:

[1] - Bug #14058: vmware provisioning fails with cryptic error when not using propper user_data script - Foreman

– Ivan

··· On Mon, Sep 11, 2017 at 10:05 PM, Ivan Necas wrote: > Hi, it seems like you're user-data template is not rendering a proper > YAML that `YAML.load()` would parse > as a Hash. Could you share the rendered user-data template with us or > even better, run `irb` and try: > > require 'yaml' > YAML.parse(< # RENDERED USER DATA > EOF > > You should get a key-value hash. If you get string (which it seems you > get), it means the string is not in valid yaml format. > > -- Ivan > > On Mon, Sep 11, 2017 at 9:30 PM, Mike Wilson wrote: >> >> >> On Monday, September 11, 2017 at 11:34:00 AM UTC-5, Ivan Necas wrote: >>> >>> Do you have any backtrace form the "undefined method `key?' for >>> #" >>> >> >> This? >> >> 2017-09-11 16:12:05 bcaeacb9 [app] [W] Failed to create a compute DCs >> (VMware) instance random-host.name.com: undefined method `key?' for >> # >> > >> > NoMethodError: undefined method `key?' for # >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.7.0/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb:16:in >> `cloudinit_to_customspec' >> > >> /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:474:in >> `clone_vm' >> > >> /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:409:in >> `create_vm' >> > /usr/share/foreman/app/models/concerns/orchestration/compute.rb:77:in >> `setCompute' >> > /usr/share/foreman/app/models/concerns/orchestration.rb:216:in `execute' >> > /usr/share/foreman/app/models/concerns/orchestration.rb:144:in `block in >> process' >> > /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `each' >> > /usr/share/foreman/app/models/concerns/orchestration.rb:136:in `process' >> > /usr/share/foreman/app/models/concerns/orchestration.rb:44:in >> `around_save_orchestration' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in >> `block in make_lambda' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `block in halting' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `block in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in >> `__run_callbacks__' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in >> `_run_save_callbacks' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/callbacks.rb:302:in >> `create_or_update' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/persistence.rb:120:in >> `save' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:37:in >> `save' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_methods/dirty.rb:21:in >> `save' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:in >> `block (2 levels) in save' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:351:in >> `block in with_transaction_returning_status' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in >> `block in transaction' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/transaction.rb:184:in >> `within_new_transaction' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in >> `transaction' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:220:in >> `transaction' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:348:in >> `with_transaction_returning_status' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:286:in >> `block in save' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:301:in >> `rollback_active_record_state!' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/transactions.rb:285:in >> `save' >> > /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in >> `save_with_type' >> > /usr/share/foreman/app/controllers/hosts_controller.rb:103:in `create' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:4:in >> `send_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:in >> `block in process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in >> `block (2 levels) in compile' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in >> `block (2 levels) in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `block (2 levels) in halting' >> > /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in >> `set_timezone' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in >> `block in make_lambda' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `block in halting' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `block in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in >> `block (2 levels) in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `block (2 levels) in halting' >> > /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in >> `clear_thread' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in >> `block in make_lambda' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `block in halting' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `block in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in >> `block (2 levels) in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `block (2 levels) in halting' >> > >> /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in >> `set_topbar_sweeper_controller' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in >> `block in make_lambda' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `block in halting' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `block in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in >> `block (2 levels) in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in >> `block (2 levels) in halting' >> > >> /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.4.1/lib/audited/sweeper.rb:14:in >> `around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in >> `public_send' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in >> `block in make_lambda' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in >> `block in halting' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in >> `block in around' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in >> `__run_callbacks__' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in >> `_run_process_action_callbacks' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in >> `run_callbacks' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in >> `block in process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in >> `block in instrument' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in >> `instrument' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in >> `instrument' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in >> `process_action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in >> `process' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in >> `process' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in >> `dispatch' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in >> `dispatch' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in >> `block in action' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in >> `call' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in >> `dispatch' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in >> `serve' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in >> `block in serve' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in >> `each' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in >> `serve' >> > >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in >> `call' >> > >> /opt/theforeman/tfm/root/usr/share/gem

In order to be able to assign the template to the OS, you need first
go to the template's associations tab, and add the OS there.
Then it should make it possible to set that in the OS.

I'm not sure why the default user_data template is not cloud-init, but
I deffer the question to someone else.

The last thing I would like to ask others on this list is some proved
cloud-init template that people are using
for vmware, as I'm not sure generic cloud-init template works there.
Maybe yes, but I'm not the expert on this things.

– Ivan

··· On Mon, Sep 11, 2017 at 10:33 PM, Mike Wilson wrote: > > > On Monday, September 11, 2017 at 3:06:01 PM UTC-5, Ivan Necas wrote: >> >> Hi, it seems like you're user-data template is not rendering a proper >> YAML that `YAML.load()` would parse >> as a Hash. Could you share the rendered user-data template with us or >> even better, run `irb` and try: >> > > The one in question is the Kickstart user_data default provided in Foreman > 1.15.1. It doesn't look like yaml at all to me. > > <%# > kind: user_data > name: Kickstart default user data > oses: > - CentOS > - Fedora > -%> > <% > rhel_compatible = @host.operatingsystem.family == 'Redhat' && > @host.operatingsystem.name != 'Fedora' > # safemode renderer does not support unary negation > pm_set = @host.puppetmaster.empty? ? false : true > proxy_uri = @host.params['http-proxy'] ? > "http://#{@host.params['http-proxy']}:#{@host.params['http-proxy-port']}" : > nil > puppet_enabled = pm_set || @host.param_true?('force-puppet') > salt_enabled = @host.params['salt_master'] ? true : false > chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy > -%> > #!/bin/bash > > <%# Cloud instances frequently have incorrect hosts data %> > <%= snippet 'fix_hosts' %> > > <% if @host.provision_method == 'image' && !root_pass.empty? -%> > # Install the root password > echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e > <% end -%> > > <% if proxy_uri -%> > # Yum proxy > echo 'proxy = <%= proxy_uri %>' >> /etc/yum.conf > <% end -%> > > #update local time > echo "updating system time" > yum -y install ntpdate > /usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || > '0.fedora.pool.ntp.org' %> > /usr/sbin/hwclock --systohc > > <% if rhel_compatible && !@host.param_false?('enable-epel') -%> > <%= snippet 'epel' -%> > <% end -%> > > <% if @host.info['parameters']['realm'] && @host.realm && > @host.realm.realm_type == 'FreeIPA' -%> > <%= snippet 'freeipa_register' %> > <% end -%> > > <% unless @host.param_false?('package_upgrade') -%> > # update all the base packages from the updates repository > if [ -f /usr/bin/dnf ]; then > dnf -y update > else > yum -t -y update > fi > <% end -%> > > <%= snippet('remote_execution_ssh_keys') %> > > <% if chef_enabled %> > <%= snippet 'chef_client' %> > <% end -%> > > <% if puppet_enabled %> > <% if @host.param_true?('enable-puppetlabs-pc1-repo') || > @host.param_true?('enable-puppetlabs-repo') -%> > <%= snippet 'puppetlabs_repo' %> > <% end -%> > <%= snippet 'puppet_setup' %> > <% end -%> > > <% if salt_enabled %> > <%= snippet 'saltstack_setup' %> > <% end -%> > > # UserData still needs to mark the build as finished > /usr/bin/curl -o /dev/null -k '<%= foreman_url('built') %>' > > > The one that DOES have yaml look to it is the one that says "this is not a > user_data template". That is the one provided with Foreman 1.15.1 as > "UserData default" > > <%# > kind: user_data > name: UserData default > oses: > - CentOS > - Fedora > - Debian > - Ubuntu > -%> > <%# > This template accepts the following parameters: > - ssh_pwauth: boolean (default=true unless ssh_authorized_keys) > - ssh_authorized_keys: string w newline seperated keys (default="") > - package_upgrade: boolean (default=false) > - reboot: boolean (default=false) > -%> > <% > ssh_pwauth = @host.params['ssh_pwauth'] ? @host.param_true?('ssh_pwauth') > : !@host.params['ssh_authorized_keys'] > rhel_compatible = @host.operatingsystem.family == 'Redhat' && > @host.operatingsystem.name != 'Fedora' > # safemode renderer does not support unary negation > pm_set = @host.puppetmaster.empty? ? false : true > puppet_enabled = pm_set || @host.param_true?('force-puppet') > salt_enabled = @host.params['salt_master'] ? true : false > chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy > -%> > #cloud-config > hostname: <%= @host.shortname %> > fqdn: <%= @host %> > manage_etc_hosts: true > <% if ssh_pwauth -%> > <%# Don't enable this in production. It is very insecure! Use > ssh_authorized_keys instead... > > http://cloudinit.readthedocs.io/en/latest/topics/examples.html#including-users-and-groups > -%> > ssh_pwauth: true > groups: > - admin > users: > - default > - name: admin > primary-group: admin > groups: users > shell: /bin/bash > sudo: ['ALL=(ALL) ALL'] > lock-passwd: false > passwd: <%= @host.root_pass %> > <% end -%> > <% if @host.params['ssh_authorized_keys'] -%> > ssh_authorized_keys: > <% @host.params['ssh_authorized_keys'].split("\n").each do |ssh_key| -%> > - <%= ssh_key %> > <% end -%> > <% end -%> > > <% if @host.param_true?('package_upgrade') -%> > package_upgrade: true > <% end -%> > > runcmd: > <% if rhel_compatible -%> > - | > <%= indent(2) { snippet('epel') } %> > <% end -%> > - | > <%= indent(2) { snippet('remote_execution_ssh_keys') } %> > <% if chef_enabled -%> > - | > <%= indent(2) { snippet('chef_client') } %> > <% end -%> > <% if puppet_enabled -%> > - | > <%= indent(2) { snippet('puppetlabs_repo') } %> > - | > <%= indent(2) { snippet('puppet_setup') } %> > <% end -%> > <% if salt_enabled -%> > - | > <%= indent(2) { snippet('saltstack_setup') } %> > <% end -%> > > <%# Contact Foreman to confirm instance is built -%> > phone_home: > url: <%= foreman_url('built') %> > post: [] > tries: 10 > > <% if @host.param_true?('reboot') -%> > power_state: > mode: reboot > timeout: 30 > condition: true > <% end -%> > > > Does that help? I've only just started working with image builds so still > trying to pickup what goes where properly so it could be entirely me not > flipping the right switches. > > > -- > 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 https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.

>
> In order to be able to assign the template to the OS, you need first
> go to the template's associations tab, and add the OS there.
> Then it should make it possible to set that in the OS.
>

Indeed. That was why I attached a image to show that it was actually on the
OS as well.

>
> I'm not sure why the default user_data template is not cloud-init, but
> I deffer the question to someone else.
>
> The last thing I would like to ask others on this list is some proved
> cloud-init template that people are using
> for vmware, as I'm not sure generic cloud-init template works there.
> Maybe yes, but I'm not the expert on this things.
>

I'd love to hear/see an answer to that question :wink: I've been trying to get
this working for a while with no joy. My AWS builds did work, just can't
get VMware images to work.

··· On Tuesday, September 12, 2017 at 1:12:17 AM UTC-5, Ivan Necas wrote:

Ivan, for your education :stuck_out_tongue: - user-data comes in two flavours, that's
all there is to it :smiley:

The first is cloud-init style specfications which are acted on by a
variety of providers on the image. The second is a shell script
executed as root by the cloud-init process as it boots. You can find
out more here:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-
data-shell-scripts

Mike - so, I'm glad your EC2 instances are working, since that's what
I'd hope. However, as Ivan noted, the VMware customization spec is
very limited, and many people on here have had issues getting it to
work. THis is sadly a limitation VMware chooses to place on itself, and
there's not much we can do about it (except get VMware customers to
pressure them to change it :P).

Here's a link from a while ago from someone who says they got it
working: https://groups.google.com/d/msg/foreman-users/d6Yc9uiK9oo/RZ9I
MPo9AwAJ. In general, search the list for "vmware customization" should
get you a few otehr hits too.

Hope it helps!
Greg

··· On Tue, 2017-09-12 at 08:11 +0200, Ivan Necas wrote: > In order to be able to assign the template to the OS, you need first > go to the template's associations tab, and add the OS there. > Then it should make it possible to set that in the OS. > > I'm not sure why the default user_data template is not cloud-init, > but I deffer the question to someone else.

One possibility is going to


to see, what are the keys one can pass there. Perhaps it will be
helpful as well.

– Ivan

··· On Thu, Sep 14, 2017 at 8:23 PM, Mike Wilson wrote: > > > On Tuesday, September 12, 2017 at 1:12:17 AM UTC-5, Ivan Necas wrote: >> >> In order to be able to assign the template to the OS, you need first >> go to the template's associations tab, and add the OS there. >> Then it should make it possible to set that in the OS. > > > Indeed. That was why I attached a image to show that it was actually on the > OS as well. > > https://13581440099883032368.googlegroups.com/attach/3072c79a11d94/02_user_data_template_Assigned_.png?part=0.2&view=1&vt=ANaJVrFKdwiQO6CV5jhGR_OIzJB-o3iDXeqB0TIolN64yzUusLbHr6k8D4E_tzUOnf_RMHGBdfszi6sY6ar0LaAPXJoDUE9rxQ-XMH9K83KpeKiHcqH2UEk > >> >> >> I'm not sure why the default user_data template is not cloud-init, but >> I deffer the question to someone else. >> >> The last thing I would like to ask others on this list is some proved >> cloud-init template that people are using >> for vmware, as I'm not sure generic cloud-init template works there. >> Maybe yes, but I'm not the expert on this things. > > > I'd love to hear/see an answer to that question ;) I've been trying to get > this working for a while with no joy. My AWS builds did work, just can't get > VMware images to work. > > > > -- > 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 https://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.

Thanks.

Right now since I have no experience with this at all I'm just trying to
get a very basic setup working. I can't seem to find even a default config
within foreman that will work. I also can't figure out why when enabling
cloud-init it wont take the yaml template for it … and no matter what I
do when I click "resolve" to verify templates it always says "no templates
configured".

I think at this point I need to find someone that's done a walk through so
I can see what I'm doing wrong. I suspect I have some misunderstandings how
some of this is suppose to work and other bits that are required that I'm
just not aware of. The foreman docs cover some of this but I've not had any
luck combining it all together.

··· On Friday, September 15, 2017 at 2:03:35 AM UTC-5, Ivan Necas wrote: > > One possibility is going to > > https://github.com/fog/fog-vsphere/blob/master/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb#L7-L39 > to see, what are the keys one can pass there. Perhaps it will be > helpful as well. > > -- Ivan >

Mike did you get anywhere with this issue?

I'm having a similar problem on 1.15.4 provisioning EC2 instances. I notice
if I toggle between 'bare metal' and my ec2 'deploy on' type during host
creation I can resolve the userdata template only on 'bare metal' type.

Steve

··· On Friday, 15 September 2017 09:11:20 UTC-7, Mike Wilson wrote: > > > > On Friday, September 15, 2017 at 2:03:35 AM UTC-5, Ivan Necas wrote: >> >> One possibility is going to >> >> https://github.com/fog/fog-vsphere/blob/master/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb#L7-L39 >> to see, what are the keys one can pass there. Perhaps it will be >> helpful as well. >> >> -- Ivan >> > > Thanks. > > Right now since I have no experience with this at all I'm just trying to > get a very basic setup working. I can't seem to find even a default config > within foreman that will work. I also can't figure out why when enabling > cloud-init it wont take the yaml template for it ... and no matter what I > do when I click "resolve" to verify templates it always says "no templates > configured". > > I think at this point I need to find someone that's done a walk through so > I can see what I'm doing wrong. I suspect I have some misunderstandings how > some of this is suppose to work and other bits that are required that I'm > just not aware of. The foreman docs cover some of this but I've not had any > luck combining it all together. > > >

Actually it seems to be related more to the Operating System tab ->
Provisioning Method type. Image won't resolve the template, Network Based
will. I guess this just re-enforces that this is an image related issue.

··· On Wednesday, 25 October 2017 13:25:41 UTC-7, steved0ca wrote: > > Mike did you get anywhere with this issue? > > I'm having a similar problem on 1.15.4 provisioning EC2 instances. I > notice if I toggle between 'bare metal' and my ec2 'deploy on' type during > host creation I can resolve the userdata template only on 'bare metal' type. > > Steve > > On Friday, 15 September 2017 09:11:20 UTC-7, Mike Wilson wrote: >> >> >> >> On Friday, September 15, 2017 at 2:03:35 AM UTC-5, Ivan Necas wrote: >>> >>> One possibility is going to >>> >>> https://github.com/fog/fog-vsphere/blob/master/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb#L7-L39 >>> to see, what are the keys one can pass there. Perhaps it will be >>> helpful as well. >>> >>> -- Ivan >>> >> >> Thanks. >> >> Right now since I have no experience with this at all I'm just trying to >> get a very basic setup working. I can't seem to find even a default config >> within foreman that will work. I also can't figure out why when enabling >> cloud-init it wont take the yaml template for it ... and no matter what I >> do when I click "resolve" to verify templates it always says "no templates >> configured". >> >> I think at this point I need to find someone that's done a walk through >> so I can see what I'm doing wrong. I suspect I have some misunderstandings >> how some of this is suppose to work and other bits that are required that >> I'm just not aware of. The foreman docs cover some of this but I've not had >> any luck combining it all together. >> >> >>

Hello,
I’m having the same problem today.
Running foreman 3.3.1, basic configuration.
Any experience ?

Regards