-
Notifications
You must be signed in to change notification settings - Fork 10
update tool: sync xcpng-users.repo from koji before update #685
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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' | ||||||
| ) | ||||||
| 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}'") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This is the yum way of doing it, unsure about doing it twice.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
|
|
||||||
| 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: | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.