I am trying to provision a production environment but got two errors:
The first one when running trellis provision production is:
PLAY [WordPress Server - Install LEMP Stack with PHP and MariaDB MySQL] ********
TASK [Gathering Facts] *********************************************************
[WARNING]: Unhandled error in Python interpreter discovery for host
trellis.ltroya.me: Failed to connect to the host via ssh:
root@trellis.ltroya.me: Permission denied (publickey).
fatal: [trellis.ltroya.me]: UNREACHABLE! => {"changed": false, "msg": "Data could not be sent to remote host \"trellis.ltroya.me\". Make sure this host can be reached over ssh: root@trellis.ltroya.me: Permission denied (publickey).\r\n", "unreachable": true}
I am not sure how to specify the ssh key to log in into the server. Don’t see any option at trellis/group_vars/production
The second one when running ansible-playbook server.yml -e env=production --key-file=~/.ssh/<SOME_SSH_KEY> is:
TASK [mariadb : Add MariaDB PPA] *******************************************************************************************************
fatal: [<DOMAIN>]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'https://mirror.rackspace.com/mariadb/repo/10.6/ubuntu kinetic Release' does not have a Release file."}
I don’t see any URL here, this is the content of that file:
apt_cache_valid_time: 3600
apt_package_state: present
apt_security_package_state: latest
apt_dev_package_state: latest
composer_keep_updated: true
php_version: "8.0"
ntp_timezone: Etc/UTC
ntp_manage_config: true
www_root: /srv/www
max_journal_size: 512M
# Values of raw_vars will be wrapped in `{% raw %}` to avoid templating problems if values include `{%` and `{{`.
# Will recurse dicts/lists. `*` is wildcard for one or more dict keys, list indices, or strings. Example:
# - vault_wordpress_sites.*.*_salt -- matches vault_wordpress_sites.example.com.env.secure_auth_salt etc.
# Will not function for var names or topmost dict keys that contain a period ('.').
raw_vars:
- vault_mail_password
- vault_mysql_root_password
- vault_users.*.password
- vault_users.*.salt
- vault_wordpress_env_defaults
- vault_wordpress_sites
Many hosts like DigitalOcean offer to automatically add your SSH key when creating a server so take advantage of that. Or follow a guide such as this one.
I created a droplet in Digital Ocean with only ssh access (no password access). But I every time I run trellis provision production, it throws the error of: Permission denied (publickey).
I’m not sure what the solution is here. I had a thread open that was closed and redirected me here.
I’m using the latest trellis-cli and trellis to provision my DO droplet. My ssh keys are working on the droplet for both root and web.
When provisioning I get the following error:
TASK [mariadb : Add MariaDB PPA] ***********************************************
fatal: [157.230.202.54]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'https://mirror.rackspace.com/mariadb/repo/10.6.11/ubuntu kinetic Release' does not have a Release file."}type or paste code here