Skip to content

Instantly share code, notes, and snippets.

View ianballou's full-sized avatar

Ian Ballou ianballou

View GitHub Profile
@ianballou
ianballou / gist:3f96731a5280bbddb7033a47ab4ffea9
Last active May 16, 2024 16:50
Run acceptance test in puppet-foreman_proxy
BEAKER_SETFILE=centos8-64 BEAKER_HYPERVISOR=vagrant_libvirt BEAKER_PROVISION=yes BEAKER_DESTROY=no bundle exec rspec spec/acceptance/my_test_spec.rb
#BEAKER_DESTROY=no leaves the VM running
#BEAKER_PROVISION=no allows for VM reuse
@ianballou
ianballou / gist:c893e479842bd38f8cbeacd904a3d8c1
Created May 15, 2024 18:00
Container repo with schema v1 manifests
https://gcr.io
google-containers/busybox
@ianballou
ianballou / start_foreman_puma_server.txt
Created February 15, 2024 21:06
Start Foreman Puma server
cd /home/vagrant/foreman && source .env && BIND=0.0.0.0 bundle exec puma -w 3 -p $PORT --preload
@ianballou
ianballou / gist:47cf61b7eec202220f90457d052e6e50
Created February 7, 2023 18:49
Start Foreman rails without Foreman
source ~/foreman/.env
BIND=0.0.0.0 bundle exec puma -w 1 -t 1 -p $PORT --preload
@ianballou
ianballou / gist:334c06aa4acd5c4415f36b1c86ff94d6
Created January 26, 2023 20:04
Katello development tips
Dev env tips
- Start rails in one terminal: bundle exec foreman start rails
- Start webpack in another terminal: bundle exec foreman start webpack
- Debug a file:
1) Edit ~/foreman/.env to ensure puma is running with a single CPU
2) Restart your server
3) Insert `binding.pry` where you need to debug
@ianballou
ianballou / gist:c1be134401de8cd2cf526f765bbac84a
Created January 26, 2023 16:54
Libvirt-related services to check after vagrant errors
libvirtd
virtnetworkd
@ianballou
ianballou / http_proxy.rb
Created November 22, 2022 19:14
Ruby HTTP proxy
#!/usr/bin/ruby
require 'webrick'
require 'webrick/httpproxy'
proxy = WEBrick::HTTPProxyServer.new Port: 8777
trap 'INT' do proxy.shutdown end
trap 'TERM' do proxy.shutdown end
proxy.start
@ianballou
ianballou / gist:0094a8585dc39a6aa9c7c427e64f377d
Created April 28, 2022 19:00
Ordering Pulpcore client binding packaging updates
1) Have a PR against katello.git and foreman-packaging.git ready, both are ack'ed. Merge the katello one (it will build new source, but won't build a nightly rpm at that point, as deps are broken)
2) Merge the packaging pr
3) Open a new packaging PR updating the deps of rubygem-katello to match what was commited to katello.git (we have scripts for that)
-> Once the new katello source is built on jenkins, and the pulp bindings rpms are also built this third pr will become buildable/green, you merge that, everyone happy
To update rubygem-katello automatically:
gem2rpm -t gem2rpm/foreman_plugin.spec.erb katello-4.5.0.pre.master.gem | ./update-requirements specfile - packages/katello/rubygem-katello/rubygem-katello.spec
gem2rpm is in fedora, the spec.erb is in packaging.git and so is update-requirements
@ianballou
ianballou / gist:304c1b5f54209b38d225235c0379257e
Created April 26, 2022 16:33
Katello tests that also have Pulp 3 VCRs
mode=all ktest test/models/content_view_package_group_filter_test.rb -ntest_content_unit_pulp_ids_returns_pulp_href
mode=all ktest test/lib/tasks/pulpcore/repository_vcr_test.rb -ntest_correct_repositories_fixes_deleted_library_repo
# Precursor: a user tries deleting a repository, but the task fails because there are related CVV repositories
# Load the repository that needs to be deleted:
# repository = ::Katello::Repository.find(< library repo id >)
library_instances_inverse = repository.library_instances_inverse
# Double check that the `library_instances_inverse` repositories are all CV repos that should be deleted
affected_cvv_ids = library_instances_inverse.pluck(:content_view_version_id).uniq
# Double check that the content view versions are indeed the ones that should lose the target repository
ForemanTasks.sync_task(::Actions::BulkAction, ::Actions::Katello::Repository::Destroy, library_instances_inverse)