Skip to content

Instantly share code, notes, and snippets.

@johnpmitsch
Last active June 4, 2020 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnpmitsch/f54baba2ebc97a8785591aaf850d8ce9 to your computer and use it in GitHub Desktop.
Save johnpmitsch/f54baba2ebc97a8785591aaf850d8ce9 to your computer and use it in GitHub Desktop.
Set up ubuntu for katello test env
  • Install ruby
sudo snap install ruby --classic
sudo snap switch ruby --channel=2.3/stable
sudo snap refresh
  • Install system deps: sudo apt-get install libsystemd-dev make postgresql git ruby-libvirt build-essential patch ruby-dev zlib1g-dev liblzma-dev libxml2-dev libcurl4-openssl-dev libpq-dev
  • sudo apt install qemu-kvm libvirt-daemon-system libvirt-dev (some might not be needed)
  • sudo apt install nodejs needs a JS runtime for some reason
  • git clone foreman + katello (as siblings)
  • echo "gemspec :path => '../', :development_group => :dev" > ~/foreman/bundler.d/Gemfile.local.rb
  • add psql template to ~/foreman/config/database.yml
  • bundle install --without=development --jobs=5 --retry=5 in foreman
  • change /etc/postgresql/12/main/pg_hba.conf to local all all trust and sudo systemctl restart postgresql (might not need)
  • setup postgresql with foreman user create role foreman with createdb login password 'foreman'; (run as postgres user and psql) and alter role foreman superuser
  • setup postgresql-evr
cd /usr/share/postgresql/12/extension/
sudo wget https://raw.githubusercontent.com/Katello/postgresql-evr/master/evr.control
sudo wget https://raw.githubusercontent.com/Katello/postgresql-evr/master/evr--0.0.2.sql
  • bundle exec rails db:create
  • bundle exec rails db:migrate
  • bundle exec rails db:test:prepare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment