Hi, everyone. Here’s a question that betrays how little I really understand about Ansible.
After a recent update to ansible 2.4.1.0
, and a merge of recent Trellis changes, I’m getting the following when trying to reprovision an existing server. I haven’t tried provisioning a new server from this repo yet.
I ran into this while trying to test the fix for the LetsEncrypt issue from this morning. I got around it by running ansible-playbook server.yml -e env=staging --tags letsencrypt
which works fine.
Here’s the error (sanitized to remove my site name and directory path):
The conditional check 'package_vars_wrong_format | count' failed. The error
was: error while evaluating conditional (package_vars_wrong_format | count):
[{% for k,v in package_vars.iteritems() if v | type_debug != 'dict' %}'{{ k
}}',{% endfor %}]: {u'apt_packages_custom': u'{{ apt_packages_custom }}',
u'memcached_packages_custom': u'{{ memcached_packages_custom }}',
u'sshd_packages_default': u'{{ sshd_packages_default }}',
u'sshd_packages_custom': u'{{ sshd_packages_custom }}',
u'php_extensions_custom': u'{{ php_extensions_custom }}',
u'apt_packages_default': u'{{ apt_packages_default }}',
u'php_extensions_default': u'{{ php_extensions_default }}',
u'memcached_packages_default': u'{{ memcached_packages_default }}'}: {u
'openssh-server': u'{{ apt_security_package_state }}', u'openssh-client':
u'{{ apt_security_package_state }}'}: 'apt_security_package_state' is
undefined
The error appears to have been in '/path/to/example.com/trellis/roles/common/tasks/main.yml': line 15, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Verify dict format for apt package component variables
^ here
fatal: [staging.example.com]: FAILED! => {"failed": true}
The method I used to update Trellis is going to horrify you, but just in case it’s related: I deleted everything in my Trellis directory except ansible.cfg
, deploy-hooks
, group_vars
, and hosts
, and replaced it all with the latest from the Trellis repo (again, except for those files and directories).
Deploys work fine, it’s just provisioning that’s broken.
Did I bring this on myself with my hacky update method?
Thanks!