API Reference¶
- class exasol.ansible.Access[source]¶
Provides access to ansible runner. @raises: AnsibleException if ansible execution fails
- class exasol.ansible.ImportlibRepository(package: Any)[source]¶
Bases:
RepositoryRepresents a repository containing ansible files (roles, playbooks, tasks, etc.). The repository is expected to be located within a Python module. Supports copy of the ansible files to a target folder.
- class exasol.ansible.Host(name: str, ssh_private_key: pathlib.Path | None = None)[source]¶
- class exasol.ansible.Context(ansible_access: Access, repositories: list[Repository] | tuple[Repository, ...], work_dir: Path | None = None)[source]¶
Create a temporary Ansible execution context from the given repositories.
- Parameters:
ansible_access – Access configuration used by the created
Runner.repositories – Repositories whose assets are copied into the temporary execution directory.
work_dir – Optional working directory to use instead of creating a new temporary directory.
- class exasol.ansible.Facts(raw: dict[str, Any], prefixes: list[str] | None = None)[source]¶
Access values in a nested dictionary via key sequences.
- as_dict(spec: dict[str, tuple[str, ...]]) → dict[str, Any][source]¶
Parameter
specmaps output entries to a tuple of access keys. Each output entry is a string, while the access keys is tuple of keys to access the nested entries.spec = { “output-entry”: (“key-1”, “key-2”) }
Method as_dict() returns the the dict with the access keys being replaced by the value retrieved from the entries. If None is returned for a key tuple, then the output-entry is missing in the resulting dict.
Here is an example:
spec = {“E1”: (“a”, “b”), “E2”: (“a”, “c”)} DictAccessor({“a”: {“b”: “value”}}).as_dict(spec)
will return {“E1”: “value”}