Skip to content

Commit

Permalink
Remove previously privisioned Pulp resources
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored and nuclearsandwich committed Sep 26, 2024
1 parent 50ff7fa commit 2824251
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions recipes/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@
package vcspkg
end

# TODO: Pulp cleanup can be removed in next major relase
# Client utilities for pulp content manager
%w[pulp-rpm-client pulpcore-client].each do |pulppkg|
execute "python3 -m pip uninstall -y #{pulppkg}" do
only_if "python3 -m pip show #{pulppkg}"
end
end

# TODO install this only on amd64?
package 'qemu-user-static'

Expand Down
64 changes: 64 additions & 0 deletions recipes/repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,70 @@
end


# TODO: Start of pulp cleanup to remove in next major release.
node['ros_buildfarm']['rpm_repos'].keys.each do |dist|
dist_dir = "/var/repos/#{dist}_pulp"
directory dist_dir do
action :delete
recursive true
end
end

0.upto(10) do |i|
service "pulp-worker@#{i}" do
action [:stop, :disable]
only_if { File.exist?("/etc/systemd/system/[email protected]") }
end
end
file "/etc/systemd/system/[email protected]" do
action :delete
end
%w(pulp-api-endpoint pulp-content-endpoint pulp-resource-manager pulp-rsync-endpoint).each do |service_name|
service service_name do
action [:stop, :disable]
only_if { File.exist?("/etc/systemd/system/#{service_name}.service") }
end
file "/etc/systemd/system/#{service_name}.service" do
action :delete
end
end

file '/usr/local/bin/systemd-docker' do
action :delete
end

service 'postgresql' do
action [:stop, :disable]
only_if { File.exist?('/lib/systemd/system/postgresql.service') }
end
package 'postgresql' do
action :remove
end

service 'redis' do
action [:stop, :disable]
only_if { File.exist?('/lib/systemd/system/redis.service') }
end
package 'redis' do
action :remove
end

pulp_data_directory = '/var/repos/.pulp'
directory pulp_data_directory do
action :delete
recursive true
end

user 'pulp' do
action :remove
end
directory '/home/pulp' do
action :delete
recursive true
end
# TODO: End of pulp cleanup to remove in next major release.


package 'nginx'
service 'nginx' do
action [:start, :enable]
Expand Down

0 comments on commit 2824251

Please sign in to comment.