package-install "openssh-server";

if target_os() ~~ m/centos/ {

  package-install "openssh-clients";

}


if target_os() ~~ m/ubuntu/ {
  service-start "ssh";
} else {
  service-start "sshd";
}

my $key = "/root/.ssh/id_rsa";

file-delete "/root/.ssh/id_rsa.pub";
file-delete '/root/.ssh/id_rsa';
file-delete '/root/.ssh/authorized_keys';

bash 'cat /dev/zero | ssh-keygen -q -N ""';
bash 'cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys';



ssh q:to/HERE/, %( host => "127.0.0.1" , user => 'root' );
  echo one
  echo two
  echo three
HERE

ssh 'uptime', %( host => "127.0.0.1" );
