From f8e838d2407b1e3fb91cea94a43da359c78277c9 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 24 Feb 2025 10:34:17 +0100 Subject: [PATCH 1/5] use Ansible/Quadlet to deploy the main app --- Puppetfile | 2 +- config/katello-answers.yaml | 72 ------------------------------------- config/katello.yaml | 3 -- 3 files changed, 1 insertion(+), 76 deletions(-) diff --git a/Puppetfile b/Puppetfile index 2432ebb01..cfa586459 100644 --- a/Puppetfile +++ b/Puppetfile @@ -34,4 +34,4 @@ mod 'theforeman/puppet', :git => 'https://github.com/theforeman/pu # Top-level katello modules mod 'katello/foreman_proxy_content', :git => 'https://github.com/theforeman/puppet-foreman_proxy_content' mod 'katello/certs', :git => 'https://github.com/theforeman/puppet-certs' -mod 'katello/katello', :git => 'https://github.com/theforeman/puppet-katello' +mod 'katello/katello', :git => 'https://github.com/theforeman/puppet-katello', branch: 'frankenstein' diff --git a/config/katello-answers.yaml b/config/katello-answers.yaml index dc9dc4415..e45854cb7 100644 --- a/config/katello-answers.yaml +++ b/config/katello-answers.yaml @@ -11,76 +11,6 @@ --- certs: group: foreman -foreman: - client_ssl_ca: /etc/foreman/proxy_ca.pem - client_ssl_cert: /etc/foreman/client_cert.pem - client_ssl_key: /etc/foreman/client_key.pem - initial_location: Default Location - initial_organization: Default Organization - server_ssl_ca: /etc/pki/katello/certs/katello-default-ca.crt - server_ssl_cert: /etc/pki/katello/certs/katello-apache.crt - server_ssl_chain: /etc/pki/katello/certs/katello-server-ca.crt - server_ssl_crl: "" - server_ssl_key: /etc/pki/katello/private/katello-apache.key -foreman::cli: true -foreman::cli::ansible: false -foreman::cli::azure: false -foreman::cli::bootdisk: false -foreman::cli::discovery: false -foreman::cli::google: false -foreman::cli::katello: true -foreman::cli::kubevirt: false -foreman::cli::openscap: false -foreman::cli::puppet: false -foreman::cli::remote_execution: true -foreman::cli::resource_quota: false -foreman::cli::rh_cloud: false -foreman::cli::ssh: false -foreman::cli::tasks: false -foreman::cli::templates: false -foreman::cli::virt_who_configure: false -foreman::cli::webhooks: false -foreman::compute::ec2: false -foreman::compute::libvirt: false -foreman::compute::openstack: false -foreman::compute::ovirt: false -foreman::compute::vmware: false -foreman::plugin::acd: false -foreman::plugin::ansible: false -foreman::plugin::azure: false -foreman::plugin::bootdisk: false -foreman::plugin::default_hostgroup: false -foreman::plugin::dhcp_browser: false -foreman::plugin::discovery: false -foreman::plugin::dlm: false -foreman::plugin::expire_hosts: false -foreman::plugin::git_templates: false -foreman::plugin::google: false -foreman::plugin::hdm: false -foreman::plugin::kernel_care: false -foreman::plugin::kubevirt: false -foreman::plugin::leapp: false -foreman::plugin::monitoring: false -foreman::plugin::netbox: false -foreman::plugin::openscap: false -foreman::plugin::proxmox: false -foreman::plugin::puppet: false -foreman::plugin::puppetdb: false -foreman::plugin::remote_execution: true -foreman::plugin::remote_execution::cockpit: false -foreman::plugin::rescue: false -foreman::plugin::resource_quota: false -foreman::plugin::rh_cloud: false -foreman::plugin::salt: false -foreman::plugin::scc_manager: false -foreman::plugin::snapshot_management: false -foreman::plugin::statistics: false -foreman::plugin::tasks: true -foreman::plugin::templates: false -foreman::plugin::vault: false -foreman::plugin::virt_who_configure: false -foreman::plugin::webhooks: false -foreman::plugin::wreckingball: false foreman_proxy: foreman_ssl_ca: /etc/foreman-proxy/foreman_ssl_ca.pem foreman_ssl_cert: /etc/foreman-proxy/foreman_ssl_cert.pem @@ -106,7 +36,5 @@ foreman_proxy::plugin::openscap: false foreman_proxy::plugin::remote_execution::script: false foreman_proxy::plugin::salt: false foreman_proxy::plugin::shellhooks: false -foreman_proxy_content: true katello: true puppet: false -apache::mod::status: false diff --git a/config/katello.yaml b/config/katello.yaml index ca21507e4..be680ad5c 100644 --- a/config/katello.yaml +++ b/config/katello.yaml @@ -18,11 +18,8 @@ :order: - certs - - foreman - katello - foreman_proxy - - foreman_proxy::plugin::pulp - - foreman_proxy_content - puppet # If using the Debian ruby-kafo package, uncomment this From 61e47020c55958298439a030f2cdbbf40d6df505 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 26 Feb 2025 13:12:01 +0100 Subject: [PATCH 2/5] pulp permissions are out of scope now --- hooks/pre/33-pulpcore_assets_permissions.rb | 11 ----------- hooks/pre/34-pulpcore_directory_layout.rb | 13 ------------- hooks/pre_commit/33-pulpcore_assets_permissions.rb | 12 ------------ 3 files changed, 36 deletions(-) delete mode 100644 hooks/pre/33-pulpcore_assets_permissions.rb delete mode 100644 hooks/pre/34-pulpcore_directory_layout.rb delete mode 100644 hooks/pre_commit/33-pulpcore_assets_permissions.rb diff --git a/hooks/pre/33-pulpcore_assets_permissions.rb b/hooks/pre/33-pulpcore_assets_permissions.rb deleted file mode 100644 index b27d6c3d5..000000000 --- a/hooks/pre/33-pulpcore_assets_permissions.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Prior to Katello 3.18 assets were built by root. Katello 3.18 runs it as pulp -# and this corrects the permissions. -unless app_value(:noop) - DIRECTORY = '/var/lib/pulp/assets'.freeze - USER = 'pulp'.freeze - - if File.directory?(DIRECTORY) && File.stat(DIRECTORY).uid == 0 - require 'fileutils' - FileUtils.chown_R(USER, USER, DIRECTORY) - end -end diff --git a/hooks/pre/34-pulpcore_directory_layout.rb b/hooks/pre/34-pulpcore_directory_layout.rb deleted file mode 100644 index f76183d9a..000000000 --- a/hooks/pre/34-pulpcore_directory_layout.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'pathname' - -PULP_ROOT = Pathname.new('/var/lib/pulp') -LEGACY_DIR = PULP_ROOT / 'docroot' -DESTINATION = PULP_ROOT / 'media' - -if LEGACY_DIR.directory? && !LEGACY_DIR.symlink? - logger.debug("Migrating #{LEGACY_DIR} to #{DESTINATION}") - unless app_value(:noop) - LEGACY_DIR.rename(DESTINATION) - LEGACY_DIR.make_symlink(DESTINATION) - end -end diff --git a/hooks/pre_commit/33-pulpcore_assets_permissions.rb b/hooks/pre_commit/33-pulpcore_assets_permissions.rb deleted file mode 100644 index 5da3f25c7..000000000 --- a/hooks/pre_commit/33-pulpcore_assets_permissions.rb +++ /dev/null @@ -1,12 +0,0 @@ -# hooks/pre/33-pulpcore_assets_permissions.rb needs user pulp -DIRECTORY = '/var/lib/pulp/assets'.freeze -USER = 'pulp'.freeze -if File.directory?(DIRECTORY) - require 'etc' - - begin - Etc.getpwnam(USER) - rescue ArgumentError - fail_and_exit("Detected incorrect permissions on #{DIRECTORY} but user #{USER} doesn't exist") - end -end From 02a3580edaea33dd9f6808458d556e7f1943f9d0 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 26 Feb 2025 15:45:55 +0100 Subject: [PATCH 3/5] tune the katello --- hooks/pre_commit/13-tuning.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pre_commit/13-tuning.rb b/hooks/pre_commit/13-tuning.rb index bce4ccc57..55ccac97e 100644 --- a/hooks/pre_commit/13-tuning.rb +++ b/hooks/pre_commit/13-tuning.rb @@ -14,7 +14,7 @@ EXIT_INSUFFICIENT_MEMORY = 103 current_tuning = get_custom_fact(TUNING_FACT) - if module_enabled?('foreman') + if module_enabled?('foreman') || module_enabled?('katello') new_tuning = app_value(:tuning) else new_tuning = current_tuning From 5a203eb8d3b33130bec6caed9f2ae490ce88d267 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 26 Feb 2025 15:48:16 +0100 Subject: [PATCH 4/5] migrate the frankenstein --- config/katello.migrations/250226000000-frankenstein.rb | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 config/katello.migrations/250226000000-frankenstein.rb diff --git a/config/katello.migrations/250226000000-frankenstein.rb b/config/katello.migrations/250226000000-frankenstein.rb new file mode 100644 index 000000000..6d9d3ad89 --- /dev/null +++ b/config/katello.migrations/250226000000-frankenstein.rb @@ -0,0 +1,3 @@ +answers.delete_if do |key, _value| + ['foreman', 'foreman_proxy_content', 'apache::mod::status'].include?(key) || key.start_with?('foreman::') +end From e0efa0ac9fd44e0292d1d397a3526745ee95b6fb Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 3 Mar 2025 09:38:16 +0100 Subject: [PATCH 5/5] use root as deployment group, not foreman --- config/katello-answers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/katello-answers.yaml b/config/katello-answers.yaml index e45854cb7..f40668f68 100644 --- a/config/katello-answers.yaml +++ b/config/katello-answers.yaml @@ -10,7 +10,7 @@ # See params.pp in each class for what options are available --- certs: - group: foreman + group: root foreman_proxy: foreman_ssl_ca: /etc/foreman-proxy/foreman_ssl_ca.pem foreman_ssl_cert: /etc/foreman-proxy/foreman_ssl_cert.pem