Skip to content

Fail to detect a new domain has been added #49

@MonsieurV

Description

@MonsieurV

Description

The role is currently not able to detect that a domain has been added for a certificate. Thus if we add a new domain to our list, nothing happens (generation is skipped).

What I would expect: the domain list change is detected and Certbot is run again (for e.g. for a renewal including the added domains).

Could we add a way to test for any change in the domain list and issue again the certificate when the list changed?

How to reproduce

First run the role with a domain list containing one to N items:

certbot_certs:
  - domains:
    - example1.com
    - example2.com

(Let the configuration being applied)

Then re-run the role after adding one to N domains:

certbot_certs:
  - domains:
    - example1.com
    - example2.com
    - example3.com
    - example4.com

(Here the certification will be skipped, resulting on example3.com and example4.com not being part of the certificate)

Implementation

This is due to the condition detecting that a certificate exists: it only checks we have a certificate of the name of the first domain.

- name: Check if certificate already exists.

This condition should be able to detect whether current existing certificate (if any) covers the same domains as the one provided by the role variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions