This is my personal linux provision script.
Install OS using ISO
Follow README in arch_install_script
folder.
For debian, install debian usign debian iso. Enable openssh in livecd. Create a user named xhuang. After installation, add xhuang to sudo group.
Use ansible to provision the OS
ssh-keygen -f $HOME/.ssh/id_rsa
ssh-copy-id -i $HOME/.ssh/id_rsa USERNAME@HOST
Go to hosts.ini
, change the ip of the remote machine
virtualenv ansible
cd ansible
source ./bin/activate
pip3 install ansible
ansible-playbook -i ../hosts.ini provision.yaml --ask-become-pass --private-key $HOME/.ssh/id_rsa
In the repo there is a Dockerfile
that you can use to build a docker image. That image contains ansible and the playbook. Instead of installing ansible locally, you can use this docker image to run ansible
docker build -t alpine:ansible .
docker container run -it --name ansible alpine:ansible /bin/sh
ssh-keygen -f $HOME/.ssh/id_rsa
ssh-copy-id -i $HOME/.ssh/id_rsa USERNAME@HOST
cd /root
ansible-playbook -i ./hosts.ini provision.yaml --ask-become-pass --private-key $HOME/.ssh/id_rsa