Skip to content
Snippets Groups Projects
Verified Commit 9d62bddf authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Fix adding an SSH key

parent b106621f
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,8 @@ A -- very simple -- Ansible playbook that adds a new local user to `utility[\d+]
Example usage of this playbook:
```
ansible-playbook -i 127.0.0.1, playbook.yml -e "username=$USERNAME" -e "full_name=$YOUR_NAME" -e "ssh_key_path=$YOUR_SSH_KEY" -k
ansible-playbook -i localhost, --connection=local playbook.yml -e "username=$USERNAME" -e "full_name=$YOUR_NAME" -e "ssh_key=$SSH_PUB_KEY" -k
```
Remember to fill in the variables `$USERNAME`, `$YOUR_NAME`, and `$YOUR_SSH_KEY`.
Remember to fill in the variables `$USERNAME`, `$YOUR_NAME`, and `$SSH_PUB_KEY`.
`$SSH_PUB_KEY` has to be the file *contents* of your `key.pub` file, so for example use `-e "ssh_key=\"$(cat /root/my_key.pub)\""`
......@@ -11,7 +11,7 @@
- name: Add SSH key to user for logging in
ansible.posix.authorized_key:
user: "{{ username }}"
key: "{{ ssh_key_path }}"
key: "{{ ssh_key }}"
- name: Create new VM for development
ansible.builtin.debug:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment