diff --git a/Puppetfile b/Puppetfile index 2432ebb01..1c16dc766 100644 --- a/Puppetfile +++ b/Puppetfile @@ -33,5 +33,5 @@ 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/certs', :git => 'https://github.com/ehelms/puppet-certs', branch: 'add-generate' +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..2318e547a 100644 --- a/config/katello-answers.yaml +++ b/config/katello-answers.yaml @@ -9,78 +9,8 @@ # # See params.pp in each class for what options are available --- -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 +certs::deploy: + foreman_proxy: true 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,4 @@ 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.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 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 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/40-exacto.rb b/hooks/pre/40-exacto.rb new file mode 100644 index 000000000..49c14218e --- /dev/null +++ b/hooks/pre/40-exacto.rb @@ -0,0 +1,34 @@ +def apply_installer_puppet(manifest) + bin_path = Kafo::PuppetCommand.search_puppet_path('puppet') + command = "echo \"#{manifest}\" | #{bin_path} apply --detailed-exitcodes --modulepath=/usr/share/foreman-installer/modules" + + stdout, stderr, status = Open3.capture3(*Kafo::PuppetCommand.format_command(command)) + if status != 1 + puts stdout + else + puts stderr + end +end + +generate_manifest = <<~MANIFEST + class { 'certs::generate': + foreman => true, + apache => true, + candlepin => true, + foreman_proxy => true, + } +MANIFEST + +apply_installer_puppet(generate_manifest) + +system('dnf -y install ansible-core git-core podman python3-cryptography python3-libsemanage python3-requests bash-completion nmap python3.12-psycopg2 python3.12-requests') + +Dir.chdir('/opt') do + system('git clone https://github.com/theforeman/foreman-quadlet') +end + +Dir.chdir('/opt/foreman-quadlet') do + system('git checkout installer-certs') + system('ansible-galaxy install -r requirements.yml') + status = system('ansible-playbook playbooks/deploy.yaml -e certificate_source=installer') +end 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 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