On 8 May 2014, at 02:25, Gilles Dubreuil <gilles@redhat.com> wrote:



----- Original Message -----
From: "Ramon Acedo" <ramon@linux-labs.net>
To: rdo-list@redhat.com
Sent: Wednesday, 30 April, 2014 2:14:59 AM
Subject: [Rdo-list] Can't Deploy Foreman with openstack-foreman-installer for Bare Metal Provisioning (undefined
method `[]' for nil:NilClass)

Hi all,

I have been trying to test the OpenStack Foreman Installer with different
combinations of Foreman versions and of the installer itself (and even
different versions of Puppet) with no success so far.

I know that Packstack alone works but I want to go all the way with multiple
hosts and bare metal provisioning to eventually use it for large deployments
and scale out Nova Compute and other services seamlessly.

The error I get when running the foreman_server.sh script is always:
--------------
rake aborted!
undefined method `[]' for nil:NilClass

Tasks: TOP => db:seed
(See full trace by running task with --trace)
--------------

The above usually indicates there is something wrong with at least one puppet class.
Do you have openstack-puppet-modules installed?

Some of the devil's details:
foreman_server.sh triggers foreman's rake to seed its database.
The nil:NiClass means something is missing and usually when it happens, to be confirmed with rake's trace/logs it's because at least one puppet class is wrong (not validated).
The above is happening because seeding script also parses puppet classes' parameters in order to inject them into Foreman.

After modifying the script to use "rake —trace” this is what I got:

+ sudo -u foreman scl enable ruby193 'cd /usr/share/foreman; rake --trace db:seed RAILS_ENV=production FOREMAN_PROVISIONING=true'
** Invoke db:seed (first_time)
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:abort_if_pending_migrations
Seeding /usr/share/foreman/db/seeds.d/05-architectures.rb
Seeding /usr/share/foreman/db/seeds.d/07-config_templates.rb
Seeding /usr/share/foreman/db/seeds.d/08-partition_tables.rb
Seeding /usr/share/foreman/db/seeds.d/10-installation_media.rb
Seeding /usr/share/foreman/db/seeds.d/11-permissions.rb
Seeding /usr/share/foreman/db/seeds.d/11-roles.rb
Seeding /usr/share/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /usr/share/foreman/db/seeds.d/12-auth_sources.rb
Seeding /usr/share/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /usr/share/foreman/db/seeds.d/15-bookmarks.rb
Seeding /usr/share/foreman/db/seeds.d/99-quickstack.rb
rake aborted!
undefined method `[]' for nil:NilClass

I’m still trying to  further debug it.


Cheers,
Gilles


After that, if Foreman starts, there’s nothing in the "Host groups" section
which is supposed to be prepopulated by the foreman_server.sh script (as
described in http://red.ht/1jdJ03q).

The process I follow is very simple:

1. Install a clean RHEL 6.5 or CentOS 6.5

2. Enable EPEL

3. Enable the rdo-release repo:

 a. rdo-release-havana-7: Foreman 1.3 and openstack-foreman-installer 1.0.6
 b. rdo-release-havana-8: Foreman 1.5 and openstack-foreman-installer 1.0.6
 c. rdo-release-icehouse-3: Foreman 1.5 and openstack-foreman-installer 2.0
 (as a note here, the SCL repo needs to be enabled before the next step
 too).

4. Install openstack-foreman-installer

5. Create and export the needed variables:

  export PROVISIONING_INTERFACE=eth0
  export FOREMAN_GATEWAY=192.168.5.100
  export FOREMAN_PROVISIONING=true

6. Run the script foreman_server.sh from
/usr/share/openstack-foreman-installer/bin

For 3a and 3b I also tried with an older version of Puppet (3.2) with the
same result.

These are the full outputs:

3a: http://fpaste.org/97739/ (Havana and Foreman 1.3)
3b: http://fpaste.org/97760/ (Havana and Foreman 1.3 with Puppet 3.2)
3c: http://fpaste.org/97838/ (Icehouse and Foreman 1.5)

I’m sure somebody in the list has tried to deploy and configure Foreman for
bare metal installations (DHCP+PXE) and the documentation and the
foreman_server.sh script suggest it should be possible in a fairly easy way.

I filled a bug as it might well be one, pending confirmation:
https://bugzilla.redhat.com/show_bug.cgi?id=1092443

Any help is really appreciated!

Many thanks.

Ramon



_______________________________________________
Rdo-list mailing list
Rdo-list@redhat.com
https://www.redhat.com/mailman/listinfo/rdo-list