Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing behavior of new fullchain argument. #34916

Merged

Conversation

felixfontein
Copy link
Contributor

SUMMARY

This PR should initiate a discussion on whether #18996 might not be solved in a better way than in #22074, namely by not making the user choose between getting a leaf certificate or a fullchain certificate (i.e. certificate followed by intermediate certificates), but to allow the user to get both.

The approach in #22074 was to provide a new boolean option fullchain, which determines whether the file written to dest/cert will be a leaf certificate or a fullchain certificate.

This PR creates a new option fullchain_dest with alias fullchain (i.e. the boolean option is removed),

@resmo, @manicai: what do you think?

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

letsencrypt

ANSIBLE VERSION
devel
ADDITIONAL INFORMATION

The current fullchain option only exists in the devel branch (to my knowledge), not in any release branch. So changing it shouldn't hurt backwards compatibility. Everyone using the devel version will notice that something changed when 2.5 will be released, i.e. there should be no silent failures.

This PR is related to #34328, which adds another option chain_dest/chain which allows to write the intermediate certificate chain into a separate file. With both this and #34328 merged, the user can choose which one of certificate, fullchain, and chain to be written to disk, and is not forced to do additional file operations to extract the chain or create a fullchain certificate.

@ansibot
Copy link
Contributor

ansibot commented Jan 16, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 community_review In order to be merged, this PR must follow the community review workflow. feature_pull_request module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jan 16, 2018
@resmo resmo self-requested a review January 16, 2018 07:32
@maxamillion maxamillion removed the needs_triage Needs a first human triage before being processed. label Jan 16, 2018
@felixfontein felixfontein force-pushed the letsencrypt-change-fullchain-behavior branch from f2d1695 to 8a5cf0e Compare January 16, 2018 19:53
@ansibot ansibot added the owner_pr This PR is made by the module's maintainer. label Jan 16, 2018
@felixfontein felixfontein force-pushed the letsencrypt-change-fullchain-behavior branch from 8a5cf0e to eef53a6 Compare January 17, 2018 08:11
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. owner_pr This PR is made by the module's maintainer. labels Jan 17, 2018
@felixfontein felixfontein force-pushed the letsencrypt-change-fullchain-behavior branch from eef53a6 to d1abf9a Compare January 17, 2018 10:45
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. owner_pr This PR is made by the module's maintainer. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 17, 2018
@felixfontein
Copy link
Contributor Author

This PR must be either merged or closed by end of February 7th, since then there's community module freeze and we shouldn't change module options once they are released (fullchain will first appear in Ansible 2.5).

Copy link
Contributor

@resmo resmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs_info

- "The destination file for the full chain (i.e. certificate followed
by chain of intermediate certificates)."
- "If C(dest) is specified, C(fullchain_dest) can be left away."
required: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according code, it is not required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below. How should this (i.e. at least one of dest and fullchain is specified) be marked here? My idea was to mark both as required, but add some text that only one needs to be specified. Should I mark both as not required, and add a note to each that at least one of them must be specified?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, both not required, but put a note in the doc that "Either C(dest) or C(fullchain_dest) is required."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the documentation. I hope it's better explained now.

- "The destination file for the full chain (i.e. certificate followed
by chain of intermediate certificates)."
- "If C(dest) is specified, C(fullchain_dest) can be left away."
required: true
default: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according code, there is no default, so can be left off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I just forgot to remove this. The type isn't bool anymore anyway, so false makes no sense.

@@ -950,7 +964,10 @@ def main():
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C')
locale.setlocale(locale.LC_ALL, 'C')

cert_days = get_cert_days(module, module.params['dest'])
if module.params.get('dest'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it looks like they fullchain_dest and dest are also mutually exclusive, aren't they? require one of but not both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both dest and fullchain_dest are not required, but at least one of them must be specified. Both can be specified as well. If both are specified, the module assumes that both are equivalent for determining whether the certificate is new enough (if dest is given, the certificate it points to is checked, otherwise the certificate where fullchain_dest points to).

While only one of them is required, both will be created (if both are specified) if a new certificate is retrieved. So the user can decide whether she wants to work with leaf certificates, fullchain certificates, or both (without the need to manually concatenating or splitting files).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. owner_pr This PR is made by the module's maintainer. labels Jan 24, 2018
@felixfontein felixfontein force-pushed the letsencrypt-change-fullchain-behavior branch from 9544f33 to 25b1db5 Compare January 24, 2018 14:45
@felixfontein
Copy link
Contributor Author

I rebased and squashed the commits.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. owner_pr This PR is made by the module's maintainer. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 24, 2018
@felixfontein
Copy link
Contributor Author

bot_status

@resmo
Copy link
Contributor

resmo commented Jan 25, 2018

shipit

@ansibot
Copy link
Contributor

ansibot commented Jan 25, 2018

Components

lib/ansible/modules/web_infrastructure/letsencrypt.py
support: community
maintainers: felixfontein mgruener resmo

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 1
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 1
shipit_actors (maintainers or core team members): resmo felixfontein
shipit_actors_other: []

click here for bot help

@ansibot ansibot added automerge This PR was automatically merged by ansibot. shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jan 25, 2018
@ansibot ansibot merged commit e750559 into ansible:devel Jan 25, 2018
@felixfontein felixfontein deleted the letsencrypt-change-fullchain-behavior branch January 25, 2018 13:34
felixfontein added a commit to felixfontein/ansible that referenced this pull request Jan 25, 2018
ansibot pushed a commit that referenced this pull request Jan 26, 2018
* Allowing to write intermediate certificate into file.

* Fixing merge errors introduced in 25b1db5 (#34916).
Lujeni pushed a commit to Lujeni/ansible that referenced this pull request Feb 1, 2018
Lujeni pushed a commit to Lujeni/ansible that referenced this pull request Feb 1, 2018
* Allowing to write intermediate certificate into file.

* Fixing merge errors introduced in 25b1db5 (ansible#34916).
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 5, 2018
@dagwieers dagwieers added the crypto Crypto community (ACME, openssl, letsencrypt) label Feb 7, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 automerge This PR was automatically merged by ansibot. crypto Crypto community (ACME, openssl, letsencrypt) feature This issue/PR relates to a feature request. module This issue/PR relates to a module. owner_pr This PR is made by the module's maintainer. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants