Skip to content

Instantly share code, notes, and snippets.

@mccun934
Last active February 6, 2020 21:29
Show Gist options
  • Save mccun934/44695f45d99da38d706b68e39c78ac13 to your computer and use it in GitHub Desktop.
Save mccun934/44695f45d99da38d706b68e39c78ac13 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Refreshing repository certificates."
echo '
organizations = Organization.all
organizations.each do |org|
repositories = ::Katello::Repository.in_default_view.in_product(::Katello::Product.redhat.in_org(org))
repositories.each do |repo|
task = ForemanTasks.async_task(Actions::Katello::Repository::RefreshRepository, repo)
puts "task.id #{task.id}"
end
end
' | foreman-rake console
echo "Repository refresh tasks initiated. Please check Monitor -> Tasks to verify when complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment