famedly / ansible-collection-base

`famedly.base` ansible collection for common basic services/tools like dns, ldap, ssh, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lego: "Compare pubkey type, notify handler if it differs" fails with default configuration

famedly-bot opened this issue · comments

In GitLab by @jadyn.dev on Jun 15, 2023, 20:09

The task "Compare pubkey type, notify handler if it differs" fails with the minimal configuration.

Configuration:

---
lego_certificate:
  domains:
    - "{{ inventory_hostname }}"
  email: "acme@example.domain"

lego_letsencrypt_environment: prod

Error:

TASK [famedly.base.lego : Compare pubkey type, notify handler if it differs] ***************************************************************************************************************************************************************
task path: /home/******/ansible/environment/ansible_collections/famedly/base/roles/lego/tasks/main.yml:160
fatal: [******]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: {{\n  \"ECC\" if \"ec\" in lego_configuration.command_parameters.global[\"key-type\"]\n  else \"RSA\" if \"rsa\" in lego_configuration.command_parameters.global[\"key-type\"]\n}}: 'lego_configuration' is undefined. 'lego_configuration' is undefined. {{\n  \"ECC\" if \"ec\" in lego_configuration.command_parameters.global[\"key-type\"]\n  else \"RSA\" if \"rsa\" in lego_configuration.command_parameters.global[\"key-type\"]\n}}: 'lego_configuration' is undefined. 'lego_configuration' is undefined\n\nThe error appears to be in '/home/******/ansible/environment/ansible_collections/famedly/base/roles/lego/tasks/main.yml': line 160, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: \"Compare pubkey type, notify handler if it differs\"\n      ^ here\n"

Fix ideas:

  1. Please change lego_configuration to lego_configuration_merged in the task
  2. The key-type is not set in lego_configuration_defaults which should be set to a reasonable default.