-
Notifications
You must be signed in to change notification settings - Fork 1
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
Ensure old ssl certs not copied in nginx role #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't think this is going to solve our problem on its own. If CS put the new cert in the path defined by nginx_ssl_cert_file
, while the one in the cache is the old cert, the checksums will be different and the new cert will get overwritten (i.e. it still requires someone to copy the newly placed certs into the cache location).
Ah, yep that makes sense. Okay, I'll work on this more on Monday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to add to @drmatthews point, the x509_certificate_info_module
will probably be useful here - you could check and compare the expiry dates (not after
) of the certs. It might also be worth setting backup: true
when copying the cert and key from cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good! There are quite a few tasks that run when: nginx_use_ssl
- perhaps we could put them into a separate file and include the file when SSL is enabled?
also enable ssl for molecule tests in nginx role
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruaridhg I've pushed some changes to:
- check certificate expiry date in the nginx role before copying to/from cache
- added variable to
ssl_certificates
role to set the expiry date (all usages of the role set to the default of 10 years, except for the nginx tests where two certs are generated) - update tomcat version
@@ -37,6 +37,7 @@ postgresql_ssl_certificate: | |||
csr_common_name: "{{ db_server.host }}" | |||
certificate_filename: "{{ postgresql.base_directory }}/certs/server.crt" | |||
provider: selfsigned | |||
selfsigned_not_after: +3650d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default value
@@ -7,7 +7,7 @@ java_home: /usr/lib/jvm/jre | |||
java_profile_d: /etc/profile.d | |||
|
|||
# mirsg.tomcat | |||
tomcat_version: 9.0.82 | |||
tomcat_version: 9.0.97 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated tomcat as 9.0.82 seems to no longer be available for download
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Very minor (and ignorable) but I removed some unnecessary double quotes from the example in the README.md
file of the nginx
.
Co-authored-by: Daniel Matthews <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Thanks, this looks like it covers everything we discussed! |
Fixes #145
Checks if ssl certificates exist on server and in cache and copies ssl certificates based on existence and expiry dates: