ansible-role-letsencrypt
ansible-role-letsencrypt copied to clipboard
letsencrypt_opt_test_cert is undefined
Found a minor issue when the acme account is not created. The playbook fails at task Create new Let's Encrypt account.
fatal: [sub.example.org]: FAILED! =>
msg: |-
The task includes an option with an undefined variable. The error was: 'letsencrypt_opt_test_cert' is undefined. 'letsencrypt_opt_test_cert' is undefined
The error appears to be in '/home/user/linux-maintenance/roles/ansible-role-letsencrypt/tasks/account.yml': line 54, column 5, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Create new Let's Encrypt account
^ here
Looking at the code it seems the issue stems from 'letsencrypt_opt_test_cert' gets defined in certificate.yml but the var is used earlier in account.yml beforce being properly defined.
The easiest solution seems to be simply moving the set_fact that defines the var into account.yml.