22 lines
447 B
Bash
Executable File
22 lines
447 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Install and enable SSH server
|
|
#
|
|
update-rc.d ssh enable
|
|
invoke-rc.d ssh start
|
|
#
|
|
#
|
|
#apt update -y
|
|
#
|
|
#
|
|
#sudo apt install -y ansible sshpass git
|
|
#
|
|
#
|
|
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -q -N ""
|
|
#
|
|
#
|
|
PUBKEY="'$(<~/.ssh/id_rsa.pub)'" && ansible-playbook -i hosts deploy_authorized_keys.yml --ask-pass --extra-vars="pubkey=$PUBKEY"
|
|
ansible-playbook -i hosts main.yaml --ask-become-pass
|
|
ansible-playbook -i hosts reboot.yaml
|
|
reboot
|