genvid.toolbox.BastionTool¶
-
class
genvid.toolbox.
BastionTool
(**kwargs)¶ Bases:
genvid.toolbox.allinone.AllInOneTool
,genvid.toolbox.cluster_tool.ClusterTool
A tool for seting up and managing a local Bastion.
New in version 1.20.0.
-
bastionAPI
= None¶ A client of the bastion API.
-
setup_bastion
(bastionid: str = '', force_rename=False)¶ Set up a local Bastion service.
This will start all jobs marked to be started at ‘setup’ and ensure a proper Bastion ID is set.
Parameters: - bastionid – The Bastion ID to set if non empty.
- force_rename – Replace the Bastion ID if it is already set.
Warning
If a Bastion ID is already present, it must be the same as the one provided (unless
force_rename
isTrue
). If no ID is provided, the Bastion ID of the service must already be set.
-
load_bastion_config
()¶ Load the bastion configuration to the bastion-api.
-
start_bastion_jobs
(*jobs: str)¶ Start a registered job on the bastion.
Parameters: jobs – Names of the jobs to start. Note
If the
jobs
parameter is left empty, this method will start all the jobs marked to be ‘autostarted’.
-
stop_bastion_jobs
(*jobs: str)¶ Stop registered jobs on the bastion.
-
update_terraform_repositories
()¶ Update the Terraform repositories.
This method adds any missing modules to the repositories and updates the rest.
New in version 1.20.0.
-
initialize_backends
()¶ Initialize the Bastion’s backends.
Currently, this method adds a single backend (named ‘default’) unless there is a backend already defined.
If there is already one or more backends defined then this method does nothing.
New in version 1.20.0.
-
update_global_tfvars
()¶ Update the global Terraform variable configuration.
More specifically, this method will:
- Query the current configuration from the Bastion.
- Update the ‘trusted_cidr’ with the current IP address.
- Update the ‘toolbox_location’ with the current environment.
- Send the resulting configuration back to the Bastion.
New in version 1.20.0.
-
-
class
bastion.
BastionTool
¶ Implementation of
genvid.toolbox.BastionTool