-
Notifications
You must be signed in to change notification settings - Fork 0
How to grant SSH access to the servers
SSH access is provided by the Ansible playbook https://github.com/usegalaxy-no/infrastructure-playbook/blob/master/env/common/system.yml.
The documentation below describes how to add a new "galaxyadmin" user to the test servers. If you want to add a "sysadmin" instead, just change any occurrence of "galaxyadmin" with "sysadmin". If you want to grant access on the production servers instead, change the directory env/test
to env/main
.
- Clone the "infrastructure-playbook" GitHub repository to your local computer.
git clone https://github.com/usegalaxy-no/infrastructure-playbook
cd infrastructure-playbook/env/test
-
To access the vault, you need to have the password file named "vault_password" in your current directory (in this case
env/test
). If you don't have this password you can ask another administrator. -
Decrypt the file
files/ssh/galaxyadmin/authorized_keys.vault
(under theenv/test
directory) by running the following command. The file will be decrypted in place.
ansible-vault decrypt files/ssh/galaxyadmin/authorized_keys.vault
Note that this file is shared between "test" and "main", as both env/test/files
and env/main/files
are symlinks to env/common/files
.
-
Open the file in a text editor and add the public SSH key for the new user.
-
Encrypt the file again, and double-check afterwards to make sure it is really encrypted!!!
ansible-vault encrypt files/ssh/galaxyadmin/authorized_keys.vault
- Run the "system.yml" playbook from inside the
env/test
directory to update the test servers:
ansible-playbook system.yml --tags "users"
- Commit the modified file back to the GitHub repository.
git add ../common/files/ssh/galaxyadmin/authorized_keys.vault
git commit -m "Added SSH key for new galaxyadmin"
git push
If you get complaints about missing modules when running the playbook, you may have to install some additional Python stuff by running the following command in the infrastructure-playbook
root directory. (You can create a virtual environment to install the modules in if you want.)
pip install -r requirements.txt