So I got foreman running from develop branch. This is what it took.
I first ran into issues with version of pg gem trying to be installed
(latest I think). I ran into the following when trying to get the pg gem:
checking for pg_config_manual.h… yes
checking for PQconnectdb() in -lpq… yes
checking for PQconnectionUsedPassword()… no
Your PostgreSQL is too old. Either install an older version of this gem or
upgrade your database.
It seems the latest version of the gem was trying to be installed, but the
version of postgresql installed for RHEL 5 was too old. So I had to edit
bundler.d/postgresql.rb with the following to get a version of the gem
installed that would be old enough to work:
group :postgresql do
gem 'pg', '< 0.13'
end
So then I was able to get past this gem issue.
The next issue I was getting when when trying to access the /hosts page. I
would get an internal server error with trace in production.log looking
like:
Started GET "/hosts" for 10.117.208.158 at Wed Jan 02 21:09:25 -0600 2013
Processing by HostsController#index as HTML
Operation FAILED: PGError: ERROR: syntax error at or near "NULLS" at
character 60
: SELECT "hosts".* FROM "hosts" ORDER BY "hosts"."name" ASC NULLS FIRST
LIMIT 20 OFFSET 0
Rendered home/_topbar.rhtml (1.9ms)
Rendered home/_user_dropdown.rhtml (0.5ms)
Rendered common/500.rhtml within layouts/application (21.7ms)
Completed 500 Internal Server Error in 44ms
ActionView::Template::Error (undefined method to_label' for nil:NilClass): 1: <ul class="nav pull-right "> 2: <li class="dropdown"> 3: <%= user_header %> 4: <ul class="dropdown-menu pull-right"> 5: <li><%= link_to("Sign Out", logout_users_path) %></li> 6: <li><%= link_to("My account", edit_user_path(User.current) )%></li> app/helpers/home_helper.rb:96:in
user_header'
app/views/home/_user_dropdown.rhtml:3:in
_app_views_home__user_dropdown_rhtml__1004363033_23456318495540_4996990' app/views/layouts/application.html.erb:31:in
_app_views_layouts_application_html_erb___811713339_23456316872600_100830'
app/controllers/application_controller.rb:291:in `generic_exception'
What this ended up being was that the 'scoped_search' gem @ version =>
2.4.0 does not work with the version of postgresql I have installed with
RHEL 5. postgresql did not support 'NULLS FIRST' in the select statement.
So I editted Gemfile for the line defining scoped variable to not be >=
2.4.0 but be < 2.4.0:
gem 'scoped_search', '< 2.4'
I was then able to access the /hosts page without error. FYI on my
postgresql packages that caused me all these issues:
[root@HOSTNAME foreman]# rpm -qa | grep postgres
postgresql-8.1.23-5.el5_8
foreman-postgresql-1.0.2-1.el5
postgresql-server-8.1.23-5.el5_8
postgresql-devel-8.1.23-5.el5_8
postgresql84-libs-8.4.12-1.el5_8
postgresql-libs-8.1.23-5.el5_8
postgresql-libs-8.1.23-5.el5_8
postgresql-devel-8.1.23-5.el5_8
As part of my DB troubleshooting above I wiped my DB and recreated it as a
clean slate with rake. So now I had to resetup some of my puppet classes
in foreman (More => Configuration => Puppet Classes). What I usually do is
manually enter the classes I want people to be able to assign, and manually
control what environment those classes are in. Well, it seems in 1.1 I can
manually create classes, but can not specify what environments the class is
in. As far as I can tell this means I can't assign the class to any
systems then. The only way I could get classes with environments
associated to them was to import them from my puppet master (requiring
foreman-proxy integration). This forced me to import everything available
on my puppetmaster (I typically don't like everything that is actually on
my puppetmaster to necessarily be assignable through an ENC).
OK, so enough griping on that. I was able to get my compute resource
added!! It was able to see all the current instances I have.
I tried creating a new host. The first weird thing I encountered was when
assigning an OS. I chose and arch and OS I wanted. But the images list
still listed all images, including images that were a different OS. I
would think this dropdown should filter based on arch/OS to only show
images that are defined as the same arch/OS.
The second thing I encountered was an issue. When I try to create the host
it gets past 'completed - Settings up compute instance' Then it freezes
for a long while at 'running - Acquiring IP address for test.novalocal'. I
then see in my production.log something like the following repeating:
Started GET "/tasks/b3fb7575-1069-4661-af02-bfc600cbf8b8" for IPADDRESS at
Thu Jan 03 00:23:42 -0600 2013
Processing by TasksController#show as
Parameters: {"id"=>"b3fb7575-1069-4661-af02-bfc600cbf8b8"}
Rendered tasks/_list.rhtml (1.5ms)
Completed 200 OK in 7ms (Views: 2.7ms | ActiveRecord: 2.4ms)
Eventually I get error 'Unable to save: Failed to destroy a compute
OpenStackPOC (OpenStack) instance test.novalocal:
ActiveRecord::RecordNotFound'.
And logs look like:
Started POST "/hosts" for 10.117.208.158 at Thu Jan 03 00:20:57 -0600 2013
Processing by HostsController#create as
Parameters: {"utf8"=>"✓", "capabilities"=>"image", "host"=>{"mac"=>"",
"puppetclass_ids"=>[""], "disk"=>"", "overwrite"=>"false", "name"=>"test",
"domain_id"=>"1", "compute_resource_id"=>"1",
"compute_attributes"=>{"image_ref"=>"d8d100ea-52ba-435d-8895-e77535d73770",
"flavor_ref"=>"1", "security_groups"=>"default",
"tenant_id"=>"a09d9b8e189d4763b22d940d085b49bf"}, "environment_id"=>"1",
"root_pass"=>"[FILTERED]", "puppet_proxy_id"=>"1", "managed"=>"true",
"provision_method"=>"image", "comment"=>"", "operatingsystem_id"=>"1",
"build"=>"1", "enabled"=>"1", "hostgroup_id"=>"",
"progress_report_id"=>"[FILTERED]", "is_owned_by"=>"1-Users",
"architecture_id"=>"1"},
"authenticity_token"=>"9dXuTfm0AO2kvxM5WNeJcynC5ZiWlkSVVViXZOjBHjo="}
Adding Compute instance for test.novalocal
waiting for instance to acquire ip address
Rolling back due to a problem: Acquiring IP address for test.novalocal 2
failed test.novalocalsetComputeIP
Removing Compute instance for test.novalocal
Failed to destroy a compute OpenStackPOC (OpenStack) instance
test.novalocal:
ActiveRecord::RecordNotFound/opt/foreman/app/models/compute_resource.rb:104:in
find_vm_by_uuid' /opt/foreman/app/models/compute_resource.rb:124:in
destroy_vm'
I do see an instance created in my OpenStack environment, although foreman
doesn't get to the point of installing puppet onto it and beginning to
manage it. So it doesn't get fully created, and doesn't get cleaned up
after failure.
All of the above is information in the hopes it can help identify/fix
issues. I do have to say I like the new features and layouts being brought
in 1.1 (well, for me its really anything past 1.0 ;). Keep up the great
work!
Regards,
Jake