-
Generate ed25519 SSH key pair
ssh-keygen -t ed25519 -f {YOUR_PATH} -C "svcanisble"
-
Copy the private key to
.secret
foldercp {YOUR_PATH} .secret/id_ed25519
- Create
svcanisble
user on remote host. - Add
svcanisble
user tosudoers
group. - Add
svcanisble
user's public key (./config/pub-ed25519.key) toauthorized_keys
file.
Script | Description |
---|---|
run.build.sh | Build image |
run.sh | SSH into the container |
Echo test
ansible-playbook playbook/echotest.yml -i inventory/test.ini -K
- In case the private hey has a passphrase
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
You will be prompted to enter the passphrase.
-
The example uses ed25519 SSH Key, if you want to use RSA key, you need to change the following files:
- .secret/id_ed25519 -> .secret/id_rsa
- Dockerfile:
ARG privateKey=
id_ed25519
ARG privateKey=id_rsa
-
The image supports hot reloading of playbooks, allowing you to just rerun the command after any changes, and it will execute with the updated playbook.