ansible-letsencrypt icon indicating copy to clipboard operation
ansible-letsencrypt copied to clipboard

letsencrypt_certbot_args

Open tdobson opened this issue 8 years ago • 1 comments

Thanks for making this. I'm trying to use it in my first ansible project, but I'm struggling to get the extra arguments option to work as I'd expect:

TASK [jaywink.letsencrypt : set_fact] ****************************************** fatal: [staging1]: FAILED! => {"failed": true, "msg": "Unexpected templating type error occurred on ({{ letsencrypt_certbot_args + ['--keep-until-expiring'] }}): coercing to Unicode: need string or buffer, list found"}

in my playbook: - {role: jaywink.letsencrypt, letsencrypt_domain: example.com, letsencrypt_certbot_args: --staging --webroot -w /mnt -d example.com }

(other things in my vars file)

As far as I can understand, the problem is related to concatenating strings in python, and possibly that python is reading what I'm giving it as a 'list' rather than a string. I wondered if I should quote the arguments, but I didn't manage to get that to work.

If it's PEBKAC, perhaps we could add an example use of that argument to the documentation.

I'm using: Python 2.7.9 ansible 2.2.1.0 on Debian 7

Thanks again for putting this out there!

tdobson avatar May 31 '17 16:05 tdobson

Hi Tim,

I think the problem might be that your vars are afaict just a string. Can you try supplying a YAML list, as follows?

letsencrypt_certbot_args:
  - --staging 
  - --webroot 
  - -w /mnt 
  - -d example.com

If this works, I'll clarify the readme :) The error message seems confusing probably because it is trying to join a string and a list together. Ansible doesn't know that what we really should complain about is that the string should be a list instead.

Thanks for the positive feedback and for trying the role! ✨

jaywink avatar Jun 01 '17 07:06 jaywink