RackPeek can generate a ready-to-use ~/.ssh/config file from your modeled infrastructure.
That means:
ssh vm-name and goWorks natively on macOS and Linux.
A resource will be included in the SSH export if it has an address.
At minimum, define one of:
labels:
ip: 192.168.1.20
or
labels:
hostname: server01.local
If you already use Ansible:
labels:
ansible_host: 192.168.1.20
If no address is found, the resource is skipped.
You can control how SSH connects using labels:
labels:
ip: 192.168.1.20
ssh_user: ubuntu
ssh_port: 2222
ssh_identity_file: ~/.ssh/id_rsa
If ssh_user or ssh_port are missing, RackPeek falls back to:
ansible_useransible_port- kind: System
type: vm
name: vm-web01
tags:
- prod
- linux
labels:
ip: 192.168.1.20
ssh_user: ubuntu
Host vm-web01
HostName 192.168.1.20
User ubuntu
IdentityFile ~/.ssh/id_rsa
Now you can connect with:
ssh vm-web01
No IP address needed.
You can export only specific systems:
rpk export ssh --include-tags prod
Only resources tagged prod will be included.
rpk export ssh \
--include-tags prod,linux \
--default-user ubuntu \
--default-port 22 \
--default-identity ~/.ssh/id_rsa \
--output ssh_config
Append to your existing SSH config:
cat ssh_config >> ~/.ssh/config
Or replace it:
mv ssh_config ~/.ssh/config
chmod 600 ~/.ssh/config
Permissions must be 600, or SSH will ignore the file.
By default, each host alias is the resource name:
Host vm-web01
RackPeek automatically:
-Example:
vm web 01
Becomes:
vm-web-01
RackPeek resolves values in this order:
Address
iphostnameansible_hostUser
ssh_useransible_userPort
ssh_portansible_portIdentity
ssh_identity_fileip or hostnamessh_user over reusing unrelated labelsprod, staging, linux for filteringHost vm-db01
HostName 192.168.1.30
User postgres
Port 2222
IdentityFile ~/.ssh/id_rsa
Host vm-web01
HostName 192.168.1.20
User ubuntu
IdentityFile ~/.ssh/id_rsa
And that’s it:
ssh vm-db01
ssh vm-web01