|
8 | 8 | from collections.abc import Generator |
9 | 9 | from concurrent.futures import ThreadPoolExecutor, as_completed |
10 | 10 | from contextlib import contextmanager |
| 11 | +from textwrap import dedent |
11 | 12 |
|
12 | 13 | from lib.host import Host |
13 | 14 | from lib.pool import NotAMasterHostError, Pool |
@@ -142,11 +143,24 @@ def _sync_users_repo(host: Host) -> None: |
142 | 143 | logger.info(f"[{host}] Downloading {repo_url} to {repo_file}") |
143 | 144 | host.ssh(f"curl -fsS -o {repo_file} '{repo_url}'") |
144 | 145 |
|
| 146 | +def _install_tmp_ci_repo(host: Host) -> None: |
| 147 | + """Install the tmp-ci.repo file on the host.""" |
| 148 | + repo_file = '/etc/yum.repos.d/tmp-ci.repo' |
| 149 | + logger.info(f"[{host}] Writing {repo_file}") |
| 150 | + host.create_file(repo_file, dedent("""\ |
| 151 | + [xcp-ng-tmp-ci] |
| 152 | + name=XCP-ng tmp CI |
| 153 | + baseurl=http://repos.lyon.vates.team/repos/tmp-ci/8.3/ |
| 154 | + enabled=0 |
| 155 | + gpgcheck=0 |
| 156 | + """)) |
| 157 | + |
145 | 158 | def _update_host(host: Host, enablerepos: list[str], disablerepos: list[str] = [], |
146 | 159 | reboot: bool = True) -> None: |
147 | 160 | """Update a host, with the mirrors.xcp-ng.org baseurl removed during the update.""" |
148 | 161 | with _pinned_updates_repo(host): |
149 | 162 | _sync_users_repo(host) |
| 163 | + _install_tmp_ci_repo(host) |
150 | 164 | host.update(enablerepos, disablerepos=disablerepos, reboot=reboot) |
151 | 165 |
|
152 | 166 | def update_pools(inventory: Inventory, reboot: bool = True, parallel: bool = False) -> None: |
|
0 commit comments