Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lago/prefix.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,19 @@ def get_nets(self):
"""
return self.virt_env.get_nets()

def get_ssh_pub_key(self):
"""
Returns the contents of the SSH public key.
To be used to install hosts with public key, or
set cloud-init configuration with public key, or
for Ansible integration

Returns:
str: SSH public key
"""
with open(self.paths.ssh_id_rsa_pub()) as pub_key:
return pub_key.read()

@classmethod
def resolve_prefix_path(cls, start_path=None):
"""
Expand Down