Closed rebkwok closed 1 month ago
Note: suppress OP deploys while all the remaining steps (everything after renaming the ebmbot module)
Steps:
On each of smallweb1 and largeweb2
sudo usermod --login bennettbot --home /home/bennettbot --move-home ebmbot
sudo groupmod --new-name bennettbot ebmbot
groups bennettbot # check groups (renaming might mean they are already in the right groups)
sudo usermod -a -G fabric bennettbot # if not, add to group
On dokku3
[x] Rename user and move home directory
sudo usermod --login bennettbot --home /home/bennettbot --move-home ebmbot
[x] Rename group
sudo groupmod --new-name bennettbot ebmbot
[x] Check volumes are now owned by the bennettbot user/group as expected
ls -la /var/lib/dokku/data/storage/bennettbot
[x] Mount the new home directory
storage:mount bennettbot /home/bennettbot:/home/bennettbot
[x] Check app mounts
storage:list bennettbot
[x] Unmount the old directory if necessary
storage:unmount bennettbot /home/ebmbot:/home/ebmbot
[x] Restart app
dokku ps:restart bennettbot
[x] Check standard (non OP) bennettbot jobs are working
[x] Cancel OP deploy suppressions
[x] Merge OP PR
[x] Wait for OP CI to run and trigger deploy (Note: last build on main failed some of the tests (the edge-specific ones); if it fails again we'll probably need to try deploying directly from slack)
[x] Update sysadmin ansible playbook with new bennettbot user name
It's somewhat confusing that we've kept the old repo name, especially as the lingering legacy bot called ebmbot is still around. The dokku app on dokku3 is already named bennettbot, as is the docker image.
The user in docker is added by name, and still called ebmbot (for ssh, according to comments in the Dockerfile). This is so that the I think this is so that bennettbot can run fabric commands on openprescribing and trials tracker. Note openprescribing runs commands as the ebmbot user, and trials tracker doesn't, but they both require the ebmbot user to have ssh access to their respective hosts. dokku3 users are set up via this ansible script. IIRC the other servers (lageweb2 and smallweb1) are setup manually.
Tasks:
[^1]: Can be done manually with
usermod
andgroupmod
but will need to check this is (a) how we should do it and (b) the order of all the things to minimise risk of breaking everything. It might be best to make a new bennettbot user instead of renaming the ebmbot one, in case we need to roll back changes.