So I seem to have successfully provisioned and deployed yesterday and mail is working via gmail smtp using the following group_vars/all/mail.yml
config:
# Documentation: https://roots.io/trellis/docs/mail/
mail_smtp_server: smtp.domain.com:587
mail_admin: admin@domain.com
mail_hostname: domain.com
mail_user: smtp_user
mail_password: "{{ vault_mail_password }}" #
Literally: mail_user: smtp_user
, which was perplexing. Is smtp_user
a variable? No.
Then I open group_varrs/all/vault.yml
:
ansible-vault edit group_vars/all/vault.yml --vault-password .vault_pass
And find:
vault_mail_password: arbitrary_password (?)
mail_smtp_server: smtp.gmail.com:587
mail_hostname: smtp.gmail.com
mail_user: me@gmail.address
mail_password: gmailpassword
which correctly provisioned /etc/ssmtp/ssmtp.conf
:
root=admin@domain.com
AuthMethod=LOGIN
FromLineOverride=Yes
UseTLS=Yes
UseSTARTTLS=Yes
hostname=smtp.gmail.com
mailhub=smtp.gmail.com:587
AuthUser=me@gmail.com
AuthPass=gmailpassword
Not sure how this happened or why it worked, as the docs clearly state the vault_mail_password
is all that’s to be defined in vault.yml
. Does vault.yml
override mail.yml
?