Skip to content

Commit 62472ca

Browse files
committed
tools: install tmp-ci.repo on hosts before update
This repository is disabled by default and can be activated when needed. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent e276200 commit 62472ca

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/tools/tasks/update.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,24 @@ def _sync_users_repo(host: Host) -> None:
142142
logger.info(f"[{host}] Downloading {repo_url} to {repo_file}")
143143
host.ssh(f"curl -fsS -o {repo_file} '{repo_url}'")
144144

145+
def _install_tmp_ci_repo(host: Host) -> None:
146+
"""Install the tmp-ci.repo file on the host."""
147+
repo_file = '/etc/yum.repos.d/tmp-ci.repo'
148+
logger.info(f"[{host}] Writing {repo_file}")
149+
host.ssh(f"cat > {repo_file} <<'EOF'\n"
150+
"[xcp-ng-tmp-ci]\n"
151+
"name=XCP-ng tmp CI\n"
152+
"baseurl=http://repos.lyon.vates.team/repos/tmp-ci/8.3/\n"
153+
"enabled=0\n"
154+
"gpgcheck=0\n"
155+
"EOF")
156+
145157
def _update_host(host: Host, enablerepos: list[str], disablerepos: list[str] = [],
146158
reboot: bool = True) -> None:
147159
"""Update a host, with the mirrors.xcp-ng.org baseurl removed during the update."""
148160
with _pinned_updates_repo(host):
149161
_sync_users_repo(host)
162+
_install_tmp_ci_repo(host)
150163
host.update(enablerepos, disablerepos=disablerepos, reboot=reboot)
151164

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

0 commit comments

Comments
 (0)