Thanks, it indeed solved the issue related to ssh key.
Another issue came up : when trying to deploy the site to staging, I get this error :
TASK [deploy : Initialize] ***************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: PermissionError: [Errno 13] Permission denied: ‘/srv/www/colibri.ac/releases’ fatal: [staging-003-vps-c2fce4a6.pwa.paris]: FAILED! => {“changed”: false, “module_stderr”: “Traceback (most recent call last):\n File "", line 107, in \n File "", line 99, in _ansiballz_main\n File "", line 47, in invoke_module\n File "", line 226, in run_module\n File "", line 98, in _run_module_code\n File "", line 88, in _run_code\n File "/tmp/ansible_deploy_helper_payload_h9j2_s11/ansible_deploy_helper_payload.zip/ansible_collections/community/general/plugins/modules/deploy_helper.py", line 523, in \n File "/tmp/ansible_deploy_helper_payload_h9j2_s11/ansible_deploy_helper_payload.zip/ansible_collections/community/general/plugins/modules/deploy_helper.py", line 487, in main\n File "/tmp/ansible_deploy_helper_payload_h9j2_s11/ansible_deploy_helper_payload.zip/ansible_collections/community/general/plugins/modules/deploy_helper.py", line 344, in create_path\n File "", line 225, in makedirs\nPermissionError: [Errno 13] Permission denied: ‘/srv/www/colibri.ac/releases’\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE: No start of json char found\nSee stdout/stderr for the exact error”, “rc”: 1}
I tried several times to reinstall the vps without success.
I also tried on another dedicated bare server, same error.
Also tried running trellis provision staging several times.
In my host file, I set ansible_user=ubuntuis it right ?
If I remove it, when I try to deploy, I get the following message Failed to connect to the host via ssh: ``[email protected]``: Permission denied (publickey).
DigitalOcean
user : root
provision → OK
deploy → fatal: [droplet-001]: FAILED! => {“changed”: false, “msg”: “Do not run Composer as root/super user! See https://getcomposer.org/root` for details Aborting as no plugin should be loaded if running as super user is not explicitly allowed”}`
OVH (vps and dedicated, I guess similar to AWS)
user : ubuntu
provision → OK
deploy → The error was: PermissionError: [Errno 13] Permission denied
This kind of error can happen if you choose the wrong Ubuntu version when creating your droplet. Assure that you’re choosing a supported version; 22.04 at the time of this writing.
After spending some time trying to figure out the issue, here are some more informations :
DO : provision + deploy → OK
Hetzner : provision + deploy → OK
OVH (vps and dedicated server)
with ansible_user=ubuntu
provision → OK
deploy → permission issue
without ansible_user
provision → not possible unless I manually add my ssh key, connecting firstly with ubuntu
deploy → OK
It looks like there is a permission issue when deploying with ubuntu user.
I don’t know what’s wrong with their server as I tried with Ubutun 22.04 and 24.04.
I have all my infrastructure already on OVH so I don’t know if I am ready to move to another host.
Am I missing something or is there a better solution instead of
1 - provisionning with ubuntu user setting ansible_user=ubuntu in host file
2 - remove ansible_user=ubuntu from host file
3 - deploy
Yes it is the same key, also the one provided to the host when installing the server (so for root or ubuntu user)
By the way, one question, what’s the difference between setting the public key in group_vars/all/users.yml and copying the public key in the folder trellis/public_keys?
Yes, ssh admin@ and web@ works with the same private key.
It looks like after provisionning the server, the www_root folder doesn’t have the correct permission (doesn’t belong to web:www-data