inventory facts¶
- class reemote.facts.inventory.get_sudo_user.Get_sudo_user[source]¶
Bases:
objectRepresents a Reemote operation to retrieve the configured sudo user.
This class encapsulates the logic for fetching the ‘sudo_user’ value from the global information context within the Reemote framework. It is designed to be used as part of a Reemote execution plan. When its execute method is called, it yields a local command that resolves to the sudo username.
- class reemote.facts.inventory.get_host.Get_host[source]¶
Bases:
objectA reemote command object for retrieving the hostname.
When used within the reemote framework, this class creates and executes a command to fetch the hostname of the target system. It is designed to be instantiated and its execute method yielded from a reemote task.
Example
host = yield Get_host().execute() print(f”The hostname is: {host}”)
- class reemote.facts.inventory.get_username.Get_username[source]¶
Bases:
objectRepresents a command to retrieve the username from host information.
This class is designed to be used within the reemote framework. When its execute method is used in a coroutine, it yields a Command object configured to run locally and retrieve the ‘username’ from the host_info dictionary provided by the framework’s execution context.
This provides a standardized, reusable way to access the current host’s username within a reemote task sequence.
- class reemote.facts.inventory.get_host_info.Get_host_info(field=None)[source]¶
Bases:
objectRepresents a command to retrieve specific information about the host.
This class is designed to be used within the reemote framework. It constructs a local command that accesses the host_info dictionary provided by the reemote runner. An instance of this class is a generator-based task that, when executed, yields a Command object.
- field¶
The key of the information to retrieve from the host’s info dictionary.
- Type:
str | None
- class reemote.facts.inventory.get_sudo_password.Get_sudo_password[source]¶
Bases:
objectA reemote command to retrieve the sudo password from the global context.
This class is designed to be used within a reemote execution plan. It provides a way to access the sudo password without hardcoding it or passing it directly as a parameter to other functions.
When its execute method is called, it yields a local command. The reemote runner processes this command by invoking a callback function that retrieves the password from the global_info dictionary. The runner is responsible for populating global_info[‘sudo_password’] before this command runs.
- class reemote.facts.inventory.get_global_info.Get_global_info(field=None)[source]¶
Bases:
objectRepresents an operation to retrieve information from a global context.
This class is used to create a command that fetches data from a global_info dictionary available in the execution environment. When executed, it can retrieve a specific value by its key (field) or the entire dictionary if no field is specified.
- Parameters:
field (str, optional) – The key of the value to retrieve from the global information dictionary. If None, the entire dictionary is returned. Defaults to None.
- Raises:
ValueError – If the provided field is not a string or None.
- class reemote.facts.inventory.get_password.Get_password[source]¶
Bases:
objectA reemote command to retrieve a host’s password from the execution context.
This class is designed to be used within a reemote execution plan. It encapsulates the logic for securely accessing the password associated with a host, which is stored in the host_info dictionary provided by the reemote runner.
When execute is called, it yields a local Command that uses an internal callback to perform the password retrieval.