Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add foreman_ygg_migration package #11317

Draft
wants to merge 1 commit into
base: rpm/develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions comps/comps-foreman-client-el8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<uservisible>true</uservisible>
<packagelist>
<packagereq type="default">foreman-client-release</packagereq>
<packagereq type="default">foreman_ygg_migration</packagereq>
<packagereq type="default">foreman_ygg_worker</packagereq>
<packagereq type="default">katello-host-tools</packagereq>
<packagereq type="default">katello-host-tools-tracer</packagereq>
Expand Down
1 change: 1 addition & 0 deletions comps/comps-foreman-client-el9.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<uservisible>true</uservisible>
<packagelist>
<packagereq type="default">foreman-client-release</packagereq>
<packagereq type="default">foreman_ygg_migration</packagereq>
<packagereq type="default">foreman_ygg_worker</packagereq>
<packagereq type="default">katello-host-tools</packagereq>
<packagereq type="default">katello-host-tools-tracer</packagereq>
Expand Down
1 change: 1 addition & 0 deletions comps/comps-foreman-client-rhel7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<uservisible>true</uservisible>
<packagelist>
<packagereq type="default">foreman-client-release</packagereq>
<packagereq type="default">foreman_ygg_migration</packagereq>
<packagereq type="default">foreman_ygg_worker</packagereq>
<packagereq type="default">katello-host-tools</packagereq>
<packagereq type="default">katello-host-tools-tracer</packagereq>
Expand Down
1 change: 1 addition & 0 deletions package_manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down
32 changes: 32 additions & 0 deletions packages/client/foreman_ygg_migration/foreman_ygg_migration.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> - 0.0.1-1
- Initial packaging