mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 04:06:42 +00:00
storage.nfs shrinks to the deployment-specific server address: export_base moves into svc-storage-nfs-server's services.yml (the server dictates where exports root) and the mount protocol version into svc-storage-nfs-client's services.yml (the client owns how it mounts). Both are read through utils.storage.nfs loaders by the nfs lookups, the env handler and 00_topology, eliminating the unrendered-variables class for these values; the group_vars assert shrinks accordingly and the swarm test extras stop restating role defaults. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
864 B
Python
26 lines
864 B
Python
from __future__ import annotations
|
|
|
|
from ansible.plugins.loader import lookup_loader
|
|
from ansible.plugins.lookup import LookupBase
|
|
|
|
from utils.storage.nfs import (
|
|
STATE_SUBDIR,
|
|
client_src,
|
|
get_client_version,
|
|
get_export_base,
|
|
state_path,
|
|
)
|
|
|
|
|
|
class LookupModule(LookupBase):
|
|
"""NFS client mount src (server:path): {{ lookup('nfs_client_src') }}."""
|
|
|
|
def run(self, terms, variables=None, **kwargs):
|
|
variables = variables or getattr(self._templar, "available_variables", {}) or {}
|
|
nfs = variables.get("storage", {}).get("nfs", {})
|
|
flavor = lookup_loader.get(
|
|
"nfs_flavor", loader=self._loader, templar=self._templar
|
|
).run([], variables=variables)[0]
|
|
state = state_path(get_export_base(), STATE_SUBDIR)
|
|
return [client_src(nfs.get("server"), get_client_version(), flavor, state)]
|