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
11 changes: 9 additions & 2 deletions sunbeam-python/sunbeam/commands/prepare_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@
newgrp snap_daemon

# Generate keypair and set-up prompt-less access to local machine
[ -f $HOME/.ssh/id_rsa ] || ssh-keygen -b 4096 -f $HOME/.ssh/id_rsa -t rsa -N ""
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
[ -f $HOME/.ssh/id_rsa_snap-openstack ] || \
ssh-keygen -b 4096 -f $HOME/.ssh/id_rsa_snap-openstack -t rsa -N ""
cat $HOME/.ssh/id_rsa_snap-openstack.pub >> $HOME/.ssh/authorized_keys
ssh-keyscan -H $(hostname --all-ip-addresses) >> $HOME/.ssh/known_hosts
[ -f $HOME/.ssh/config ] || \
( touch $HOME/.ssh/config ; chmod 0600 $HOME/.ssh/config )
cat >> $HOME/.ssh/config <<EOF
Host $( hostname --all-ip-addresses | paste -s )
IdentityFile ~/.ssh/id_rsa_snap-openstack
EOF

# Install the Juju snap
sudo snap install --channel {JUJU_CHANNEL} juju
Expand Down