Foreman plugin to add Proxmox compute resource based on fog-proxmox gem
GNU General Public License v3.0
105
stars
30
forks
source link
Installation guide not up to date and plugin attempts to access a development environment in pre compile step (Ubuntu 18.04.5LTS - Foreman 2.4.0 - Ruby 2.5.1p57) #196
Describe the bug
It seems that the installation guide has never been updated to reflect new versions of Foreman and is pretty useless when trying to install the plugin on Foreman 2.4.
I've included all the steps I did to eventually get the plugin working but the experience wasn't as smooth as I had hoped.
I have yet to try using the plugin but at least I now get the option to add proxmox as a compute source.
First issue
Steps to reproduce the behavior:
Make a clean install of Ubuntu 18.04.5 LTS
Set up repo packages for Foreman 2.4 by following the foreman quickstart guide
Try to execute the first step of the install guide sudo apt install -y foreman foreman-compute foreman-sqlite3 foreman-assets
See that foreman-compute and foreman-sqlite3 are no longer available so unable to continue.
The (attempted) installation workaround
Steps to reproduce the behavor:
Simply continue the Foreman quickstart guide and finish setting up.
Eventually get to the assets precompile step plugin:assets:precompile[foreman_fog_proxmox]
Encounter the following error: ActiveRecord::AdapterNotSpecified: Thedevelopmentdatabase is not configured for thedevelopmentenvironment.
The error workaround
I have not yet tested the full functionality but was able to get around the compile error by duplicating the production configuration to a development configuration in /etc/foreman/database.yml.
It should also be noted that /bin/rake is not available to the foreman user and /usr/bin/rake should be used.
Below is a full log of what I did to get the plugin installed in my environment.
# Clean ubuntu 18.04.5 LTS install
# As root
locale-gen en_US.UTF-8
sudo apt-get -y install ca-certificates
cd /tmp && wget https://apt.puppet.com/puppet6-release-bionic.deb
sudo dpkg -i /tmp/puppet6-release-bionic.deb
echo "deb http://deb.theforeman.org/ bionic 2.4" | sudo tee /etc/apt/sources.list.d/foreman.list
echo "deb http://deb.theforeman.org/ plugins 2.4" | sudo tee -a /etc/apt/sources.list.d/foreman.list
sudo apt-get -y install ca-certificates
wget -q https://deb.theforeman.org/pubkey.gpg -O- | sudo apt-key add -
sudo apt-get update && sudo apt-get -y install foreman-installer
foreman-installer
#edit /etc/passwd and give foreman /bin/bash
#edit /etc/foreman/database.yml and copy the production configuration and name it development
cd /usr/share/foreman
echo "gem 'foreman_fog_proxmox'" | sudo -u foreman tee /usr/share/foreman/bundler.d/Gemfile.local.rb
#become the foreman user
su foreman
/usr/bin/foreman-ruby /usr/bin/bundle install
/usr/bin/foreman-ruby /usr/bin/bundle update foreman_fog_proxmox
/usr/bin/foreman-ruby /usr/bin/bundle exec /usr/bin/rake db:migrate
/usr/bin/foreman-ruby /usr/bin/bundle exec /usr/bin/rake plugin:assets:precompile[foreman_fog_proxmox]
#exit and become root again
exit
foreman-installer
Describe the bug It seems that the installation guide has never been updated to reflect new versions of Foreman and is pretty useless when trying to install the plugin on Foreman 2.4.
I've included all the steps I did to eventually get the plugin working but the experience wasn't as smooth as I had hoped.
I have yet to try using the plugin but at least I now get the option to add proxmox as a compute source.
First issue Steps to reproduce the behavior:
sudo apt install -y foreman foreman-compute foreman-sqlite3 foreman-assets
foreman-compute
andforeman-sqlite3
are no longer available so unable to continue.The (attempted) installation workaround Steps to reproduce the behavor:
plugin:assets:precompile[foreman_fog_proxmox]
ActiveRecord::AdapterNotSpecified: The
developmentdatabase is not configured for the
developmentenvironment.
The error workaround I have not yet tested the full functionality but was able to get around the compile error by duplicating the production configuration to a development configuration in
/etc/foreman/database.yml
.It should also be noted that
/bin/rake
is not available to the foreman user and/usr/bin/rake
should be used.Below is a full log of what I did to get the plugin installed in my environment.