cw-ansible / cw.letsencrypt

Generate Let's Encrypt SSL certificate with Ansible.
5 stars 1 forks source link

"DNS name was empty" error #1

Open ghost opened 8 years ago

ghost commented 8 years ago

On stage 1 I get this error:

TASK [cw.letsencrypt : Run letsencrypt stage 1] ********************************
[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the 
environment value uses the full variable syntax ('{{letsencrypt_certificates}}').
This feature will be 
removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False
 in ansible.cfg.
failed: [localhost] (item={u'domains': [{u'name': u'snipped.com', u'cn': True}, u'snipped.com']}) => {"failed": true, "item": {"domains": [{"cn": true, "name": "snipped.com"}, "snipped.com"]}, "msg": "u'Error creating new authz :: DNS name was empty'"}

My host has a working local dns name but it is not using public DNS over the internet, is that causing a problem? My default main.yml contains:


---

# Set of default values that can be overriden in each
# letsencrypt_certificates definition. See the letsencrypt module
# documentation for details on the meaning of these keys.
letsencrypt_defaults:
  dir: store/letsencrypt-test
  email: 'it@snip.com'
  host: hostname.snip.com 
  webroot: /opt/gitlab/embedded/service/gitlab-rails/public
  min_days: 7
  domains_key_size: 4096
  user_key_size: 4096  
  staging: yes

# A list of dictionnary suitable for the letsencrypt module.
# Each item can be either a FQDN or a dict. See the letsencrypt module (the
# domains option) for description of the keys.
letsencrypt_certificates:
  - domains:
      - name: snip.com
        cn: yes        
      - hostname.snip.com
patphobos commented 7 years ago

@Andrew415 this patch may fix your issue

diff --git a/roles/letsencrypt/library/letsencrypt b/roles/letsencrypt/library/letsencrypt
index 621c0fd..9e46119 100755
--- a/roles/letsencrypt/library/letsencrypt
+++ b/roles/letsencrypt/library/letsencrypt
@@ -612,7 +612,7 @@ class LetsEncryptModule(AnsibleModule):
                 stage = dict(required = False, choices=[1, 2],
                              default=1, type='int'),
                 staging = dict(required=False, type='bool', default=True),
-                domains = dict(required = True),
+                domains = dict(required = True, type='list'),
                 domains_key_size = dict(required = False,
                                         default=4096, type='int'),
                 dir = dict(required = False, default='.'),
renard commented 7 years ago

@patphobos if you send me a pull request, you gonna have credit for that ;-)