This commit is contained in:
Thomas Maurice 2023-12-06 09:28:44 +01:00
parent c7c040a70c
commit 538f433e39
Signed by: thomas
GPG key ID: 1D577F50583032A6

View file

@ -66,7 +66,8 @@ $ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -P ''
:warning: In real life, don't use `-P ''` because it creates your SSH key without a passphrase, it is ok for this lab, not for real life. :warning: In real life, don't use `-P ''` because it creates your SSH key without a passphrase, it is ok for this lab, not for real life.
Lastly, look into `group_vars/all.yml`, go at the end of the file and add the created _public_ key in the root_user.default_root_keys (from ~/.ssh/id_ed25519.pub, or any other keys you created before hand). When this is done, add it to the `~/.ssh/authorized_keys` in the `root` home folder on every one of your virtual machines. Lastly, look into `group_vars/all.yml`, go at the end of the file and add the created _public_ key in the root_user.default_root_keys (from ~/.ssh/id_ed25519.pub, or any other keys you created before hand).
### One more thing, update your inventory ### One more thing, update your inventory
@ -90,6 +91,16 @@ $ ansible-playbook -vi inventory -l all playbooks/base.yml
The `-i` flag specifies the inventory file to use, the `-l` file limits which hosts it applies to, either by hostname or group name, here we apply it to all the hosts. The `-i` flag specifies the inventory file to use, the `-l` file limits which hosts it applies to, either by hostname or group name, here we apply it to all the hosts.
If you cannot connect to the host with a `permission denied` error, rerun the command using the `-k` flag, to make ansible ask you for the host password.
```
# make sure the sshpass program is installed on the Zabeth
$ sudo apt install -y sshpass
$ ansible-playbook -vi inventory -k -l all playbooks/base.yml
```
If that does not work, add it to the `~/.ssh/authorized_keys` in the `root` home folder on every one of your virtual machines.
While you are at it I would recommend you install docker as well using the `docker.yml` playbook While you are at it I would recommend you install docker as well using the `docker.yml` playbook
Good, now you are good to go ! Good, now you are good to go !