I just upgraded my server to xenial and trellis to 0.9.8. on provisioning the server, I get this error:
TASK [wordpress-setup : Create database of sites] ******************************
System info:
Ansible 2.1.2.0; Darwin
Trellis at "Enable per-site setup for permalink structure"
---------------------------------------------------
The conditional check 'site_uses_local_db and item.value.db_create |
default(True)' failed. The error was: {{ site_env.db_host == 'localhost' }}:
{{ wordpress_env_defaults | combine(item.value.env | default({}),
vault_wordpress_sites[item.key].env) }}: {u'rundumhamburg.com': {u'env':
{u'auth_salt':
u'}LYJeYt;qL/&Azkl.C;gRp8##.KIS,5Ajz%A{!R*+kpBI*xCOUORJc;1*K9AA_,q',
u'nonce_salt':
u'eUy(ENZ&jC?@r$^sUqRmX=HZ3_1s;C/T]}OxGf.9D9kUk(Yi2,*/#>h_*<+H}(84',
u'auth_key':
u'4N/nA,xw^C4w6=U2k8Y1sno;c7M)jW=g^7C!XIph>D=kV.=eQtRF@n^L7h&S2<F8',
u'db_password': u'blablablablamyPasswordhere', u'secure_auth_key':
u'H3WX}dec_f5xViNcE(Zg9{mQ!_u,#^#-tOt#,Te.2u|nVq1}Lb@0*[v::n;I7)D=',
u'nonce_key':
u'Jh|XL3V@cS!B&|mB(8DwkaVT7&1Bb1@f^_uU@4{iIRv5n}?=3+{hz=P:2Uze]6<M',
u'logged_in_salt': u'Xh$a_.<xZPH6yVH8^.;7c0!%_%$|qA;_!I.LBFw)cjM]%XuV-
sCmnA8T!o*p<#jN', u'logged_in_key':
u'BO(>Mt<yHT6ax)d^gf[V>#K>ZBW9p0^DdlE78JN<Q5GPoU0|{{FT!dJpv^hlNENu',
u'secure_auth_salt':
u'C]xr!+9:gyoEhAR}*5#rlnsyNc46%bdUPOqNTzkOc9m={(Flywx$98e6pFLO?r<'}}}:
template error while templating string: unexpected char u'!' at 52. String:
BO(>Mt<yHT6ax)d^gf[V>#K>ZBW9p0^DdlE78JN<Q5GPoU0|{{FT!dJpv^hlNENu
The error appears to have been in '/Users/Allmighty/Sites/ruh/trellis/roles
/wordpress-setup/tasks/database.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create database of sites
^ here
fatal: [37.17.229.126]: FAILED! => {"failed": true}
I triple checked everything and keep and all files should be working.
I also look at this but it seems it applies to an old version of trellis since the file is different from the one at 0.9.8.
The error implies that an unexpected char â!â on my salts is causing the error. I tried replacing those chars from my salts but didnât work. Any Ideas?
Ok I got it working. You really have to generate the salts on the roots generator.
The problem was in the salts I generated somewhere else and somehow broke the templating.
I wonder what are the parameters to generate the salts by myself. Any Hints?
I believe the problem was that your original value for logged_in_salt contained {{ which is a jinja templating delimiter. So, where the parser saw {{FT!dJpv^hlNENu it was expecting {{var_name}} but the ! is not allowed in variable names, so there was a templating error. Although the roots salts generator is awesome, other generators should work fine too, except in the rare case that the values produced include delimiters like {{.
Trellis tries to prevent interpretation of delimiters like {{ in salts and keys, e.g., as in roots/trellis#615. However, Ansible >= 2.1.1.0 introduced an internal API change (discussion at Ansible) causing get_group_vars to return nothing, causing Trellis to not take any action on the matter. In other words, I canât reproduce your issue on Ansible 2.0.2.0, but I can reproduce on Ansible >= 2.1.1.0.
I am getting the same error and have listed it on a seperate ticket so to speak as part of my provisioning a remote server droplet.
Mine isnât failing at the salts but here which is a bit weirdâŚ
The conditional check âsite_uses_local_db and item.value.db_create |
default(True)â failed. The error was: error while evaluating conditional
(site_uses_local_db and item.value.db_create | default(True)): {{
site_env.db_host == âlocalhostâ }}: {{ wordpress_env_defaults |
combine(item.value.env | default({}), vault_wordpress_sites[item.key].env)
}}: âdict objectâ has no attribute uâxxx.xx.xx.xxxâ
The error appears to have been in â/Users/xxxxxxx/Sites/CGW/trellis/roles
/wordpress-setup/tasks/database.ymlâ: line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
`TASK [wordpress-setup : Create database of sites] ******************************
System info:
Ansible 2.2.1.0; Darwin
Trellis at âCheck Ansible version before Ansible validates task attributesâ
The conditional check âsite_uses_local_db and item.value.db_create |
default(True)â failed. The error was: error while evaluating conditional
(site_uses_local_db and item.value.db_create | default(True)): {{
site_env.db_host == âlocalhostâ }}: {{ wordpress_env_defaults |
combine(item.value.env | default({}), vault_wordpress_sites[item.key].env)
}}: âdict objectâ has no attribute uâkangapestcontrol.comâ
The error appears to have been in
â/Users/spencerhill/Sites/kangapestcontrol.com/trellis/roles/wordpress-
setup/tasks/database.ymlâ: line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
Initially I did not set the site name (just oversight on my part) but I corrected that and reran the script and got the same issue. But I slept on it and re-ran it today and it completed without errors. So it must have been a user error this last time.