diff --git a/comps/comps-foreman-client-el8.xml b/comps/comps-foreman-client-el8.xml index 17b0b6e9615..298e07803eb 100644 --- a/comps/comps-foreman-client-el8.xml +++ b/comps/comps-foreman-client-el8.xml @@ -11,6 +11,7 @@ true foreman-client-release + foreman_ygg_migration foreman_ygg_worker katello-host-tools katello-host-tools-tracer diff --git a/comps/comps-foreman-client-el9.xml b/comps/comps-foreman-client-el9.xml index 17b0b6e9615..298e07803eb 100644 --- a/comps/comps-foreman-client-el9.xml +++ b/comps/comps-foreman-client-el9.xml @@ -11,6 +11,7 @@ true foreman-client-release + foreman_ygg_migration foreman_ygg_worker katello-host-tools katello-host-tools-tracer diff --git a/comps/comps-foreman-client-rhel7.xml b/comps/comps-foreman-client-rhel7.xml index c456dd26af1..fe2476a7345 100644 --- a/comps/comps-foreman-client-rhel7.xml +++ b/comps/comps-foreman-client-rhel7.xml @@ -11,6 +11,7 @@ true foreman-client-release + foreman_ygg_migration foreman_ygg_worker katello-host-tools katello-host-tools-tracer diff --git a/package_manifest.yaml b/package_manifest.yaml index 7600dcdc529..db6d2c10a8f 100644 --- a/package_manifest.yaml +++ b/package_manifest.yaml @@ -532,6 +532,7 @@ foreman_client_packages: children: yggdrasil_client_packages: {} hosts: + foreman_ygg_migration: {} foreman_ygg_worker: {} katello-host-tools: {} katello-pull-transport-migrate: {} diff --git a/packages/client/foreman_ygg_migration/foreman_ygg_migration.spec b/packages/client/foreman_ygg_migration/foreman_ygg_migration.spec new file mode 100644 index 00000000000..2e5c7552703 --- /dev/null +++ b/packages/client/foreman_ygg_migration/foreman_ygg_migration.spec @@ -0,0 +1,32 @@ +Name: foreman_ygg_migration +Version: 0.0.1 +Summary: A helper package to ease transition from yggdrasil 0.2.z to 0.4.z +Release: 1%{?dist} +License: MIT + +Supplements: yggdrasil >= 0.4.0 +Requires: yggdrasil >= 0.4.0 + +%description +A helper package to ease transition from yggdrasil 0.2.z to 0.4.z + +%post +if systemctl is-enabled yggdrasild >/dev/null 2>/dev/null; then + grep -Pq '^server' /etc/yggdrasil/config.toml || sed -i 's/broker.*=/server =/' /etc/yggdrasil/config.toml + grep -Pq '^prefix' /etc/yggdrasil/config.toml || echo 'prefix = "yggdrasil"' >>/etc/yggdrasil/config.toml + grep -Pq '^data-host' /etc/yggdrasil/config.toml || echo 'data-host = ""' >>/etc/yggdrasil/config.toml + + if grep -q FOREMAN_YGG_WORKER_WORKDIR /etc/systemd/system/yggdrasild.service.d/* 2>/dev/null; then + mkdir -p /etc/systemd/system/com.redhat.Yggdrasil1.Worker1.foreman.service.d/ + cp -r /etc/systemd/system/yggdrasild.service.d/* /etc/systemd/system/com.redhat.Yggdrasil1.Worker1.foreman.service.d/ + fi + + systemctl disable --now yggdrasild + systemctl enable --now yggdrasil +fi + +%files + +%changelog +* Thu Oct 03 2024 Adam Ruzicka - 0.0.1-1 +- Initial packaging