- 
                Notifications
    
You must be signed in to change notification settings  - Fork 37
 
Support Let's Encrypt for Open OnDemand #714
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -120,28 +120,34 @@ | |
| when: "'openhpc' in group_names" | ||
| 
     | 
||
| # - import_playbook: portal.yml | ||
| - name: Open Ondemand server (packages) | ||
| - name: Open OnDemand server (packages) | ||
| include_role: | ||
| name: osc.ood | ||
| tasks_from: install-package.yml | ||
| vars_from: "Rocky/{{ ansible_distribution_major_version }}.yml" | ||
| when: "'openondemand' in group_names" | ||
| # # FUTURE: install-apps.yml - this is git clones | ||
| 
     | 
||
| - name: Open Ondemand server (apps) | ||
| - name: Open OnDemand server (apps) | ||
| include_role: | ||
| name: osc.ood | ||
| tasks_from: install-apps.yml | ||
| vars_from: "Rocky/{{ ansible_distribution_major_version }}.yml" | ||
| when: "'openondemand' in group_names" | ||
| 
     | 
||
| - name: Open Ondemand remote desktop | ||
| - name: Open OnDemand certbot | ||
| import_role: | ||
| name: openondemand | ||
| tasks_from: certbot.yml | ||
| when: "'openondemand' in group_names" | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should also add    | 
||
| 
     | 
||
| - name: Open OnDemand remote desktop | ||
| import_role: | ||
| name: openondemand | ||
| tasks_from: vnc_compute.yml | ||
| when: "'openondemand_desktop' in group_names" | ||
| 
     | 
||
| - name: Open Ondemand jupyter node | ||
| - name: Open OnDemand jupyter node | ||
| import_role: | ||
| name: openondemand | ||
| tasks_from: jupyter_compute.yml | ||
| 
          
            
          
           | 
    @@ -173,7 +179,7 @@ | |
| name: cloudalchemy.node_exporter | ||
| when: "'node_exporter' in group_names" | ||
| 
     | 
||
| - name: openondemand exporter | ||
| - name: Open OnDemand Prometheus exporter | ||
| dnf: | ||
| name: ondemand_exporter | ||
| when: "'openondemand' in group_names" | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -46,8 +46,16 @@ No other authentication options are required for this method. | |
| 
     | 
||
| ### SSL Certificates | ||
| This role enables SSL on the Open Ondemand server, using the following self-signed certificate & key which are autogenerated by the `mod_ssl` package installed as part of the `ondemand-apache` package. Replace with your own keys if required. | ||
| - `openondemand_ssl_cert`: Optional. Default `/etc/pki/tls/certs/localhost.crt`. | ||
| - `openondemand_ssl_cert_key`: Optional. Default `/etc/pki/tls/private/localhost.key` | ||
| - `openondemand_ssl_cert`: Optional. Default `/etc/pki/tls/certs/localhost.crt` (unless `openondemand_certbot` is true). | ||
| - `openondemand_ssl_cert_key`: Optional. Default `/etc/pki/tls/private/localhost.key` (unless `openondemand_certbot` is true). | ||
| 
     | 
||
| Alternatively, you can generate a certificate from Let's Encrypt automatically by configuring the following variables: | ||
| - `openondemand_certbot`: Optional. Default is false. Set to true to request a certificate from Let's Encrypt. | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree this is the correct default, but wonder if we should set it   | 
||
| - `openondemand_certbot_email`: Optional. Default is empty. Set to the admin email address if using Let's Encrypt. | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the domain for this have to match e.g. the cluster_domain_suffix or anything?  | 
||
| 
     | 
||
| If using Let's Encrypt, leave `openondemand_ssl_cert` and `openondemand_ssl_cert_key` set to their default values. | ||
| 
     | 
||
| Note that this only generates the initial certificate for now: automated renewal is not yet implemented. | ||
| 
     | 
||
| ### Dashboard and application configuration | ||
| - `openondemand_dashboard_docs_url`: Optional. URL of docs to show under Help in dashboard. Default `(undefined)`. | ||
| 
          
            
          
           | 
    ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| --- | ||||||
| - name: Install EPEL | ||||||
| tags: install | ||||||
| dnf: | ||||||
| name: epel-release | ||||||
| 
     | 
||||||
| - name: Install certbot | ||||||
| tags: install | ||||||
| dnf: | ||||||
| name: | ||||||
| - certbot | ||||||
| - python3-certbot-apache | ||||||
| 
     | 
||||||
| - block: | ||||||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move these to ansible/roles/openondemand/tasks/validate.yml? That is called much earlier (buy ansible/validate) than this, and only from site.yml so doesn't run during build.  | 
||||||
| - name: Validate that server name is set | ||||||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually already done in ansible/roles/openondemand/tasks/validate.yml?  | 
||||||
| assert: | ||||||
| that: | ||||||
| - openondemand_servername | length > 0 | ||||||
| fail_msg: openondemand_servername must be set | ||||||
| 
     | 
||||||
| - name: Validate that email address is set | ||||||
| assert: | ||||||
| that: | ||||||
| - openondemand_certbot_email | length > 0 | ||||||
| fail_msg: openondemand_certbot_email must be set | ||||||
| 
     | 
||||||
| - name: Generate Let's Encrypt certificate | ||||||
| command: sudo certbot certonly --standalone -d {{ openondemand_servername }} -n -m {{ openondemand_certbot_email }} --agree-tos | ||||||
| when: appliances_mode == 'configure' | ||||||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be more consistent as: 
        Suggested change
       
    
 b/c you can use e.g.  But its definitely not totally consistent so not very fussed.  | 
||||||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -259,6 +259,7 @@ variable "login_security_groups" { | |
| default = [ | ||
| "default", # allow all in-cluster services | ||
| "SSH", # access via ssh | ||
| "HTTP", # HTTP-01 challenge and redirect to HTTPS | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really don't like the fact this means all existing deployments, when they merge this, are either going to have to add this HTTP secgroup or else override   | 
||
| "HTTPS", # access OpenOndemand | ||
| ] | ||
| } | ||
| 
          
            
          
           | 
    ||
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.
See above.