Skip to content
Merged
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
10 changes: 10 additions & 0 deletions lib/tools/tasks/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,20 @@ def _pinned_updates_repo(host: Host) -> Generator[None]:
logger.info(f"[{host}] Restoring {repo_file}")
host.ssh(f'mv -f {backup_file} {repo_file}')

def _sync_users_repo(host: Host) -> None:
"""Copy the koji xcpng-users.repo file on the host to keep repository definitions in sync."""
repo_url = (
f'https://koji.xcp-ng.org/repos/user/{host.xcp_version.major}/{host.xcp_version_short}/xcpng-users.repo'
Comment thread
olivierh-pro marked this conversation as resolved.
)
repo_file = '/etc/yum.repos.d/xcpng-users.repo'
logger.info(f"[{host}] Downloading {repo_url} to {repo_file}")
host.ssh(f"curl -fsS -o {repo_file} '{repo_url}'")

@rzr rzr Aug 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
host.ssh(f"curl -fsS -o {repo_file} '{repo_url}'")
host.ssh(f"yum-config-manager --add-repo '{repo_url}'")

This is the yum way of doing it, unsure about doing it twice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yum-config-manager is not available (currently) on xcp-ng 9, so I think it's better to keep the curl version for now.


def _update_host(host: Host, enablerepos: list[str], disablerepos: list[str] = [],
reboot: bool = True) -> None:
"""Update a host, with the mirrors.xcp-ng.org baseurl removed during the update."""
with _pinned_updates_repo(host):
_sync_users_repo(host)
host.update(enablerepos, disablerepos=disablerepos, reboot=reboot)

def update_pools(inventory: Inventory, reboot: bool = True, parallel: bool = False) -> None:
Expand Down