Skip to content

Commit

Permalink
Added an Ansible script for updating the SSL certificates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Liang committed Jul 8, 2024
1 parent fdc132c commit 78def9e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
4 changes: 1 addition & 3 deletions cluster-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ These must be acquired securely from IT or within the software group, and placed

The files needed are:

* `DigiCertCA.crt`: the DigiCert certificate authority (CA) key, which specifies that DigiCert
issued the key.
* `star_cfe.crt`: the wildcard certificate issued by DigiCert, which certifies that this server
* `star_cfe_chained.crt`: the chained SSL certificate issued by DigiCert, which certifies that this server
belongs to the `cfenet.ubc.ca` or `bccfe.ca` domain.
* `star_cfe.key`: our private signing key, used to issue a public key for HTTPS connections.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

SSLEngine on

SSLCertificateFile /etc/ssl/certs/star_cfe.crt
SSLCertificateFile /etc/ssl/certs/star_cfe_chained.crt
SSLCertificateKeyFile /etc/ssl/private/star_cfe.key
SSLCertificateChainFile /etc/ssl/certs/DigiCertCA.crt
# SSLCertificateChainFile /etc/ssl/certs/DigiCertCA.crt

#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
Expand Down
16 changes: 8 additions & 8 deletions cluster-setup/deployment/roles/kive_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@

- name: install SSL certificate
copy:
src: star_cfe.crt
dest: /etc/ssl/certs/star_cfe.crt
src: star_cfe_chained.crt
dest: /etc/ssl/certs/star_cfe_chained.crt
owner: root
group: root

Expand All @@ -169,12 +169,12 @@
group: root
mode: "0600"

- name: install SSL certificate chain file
copy:
src: DigiCertCA.crt
dest: /etc/ssl/certs/DigiCertCA.crt
owner: root
group: root
# - name: install SSL certificate chain file
# copy:
# src: DigiCertCA.crt
# dest: /etc/ssl/certs/DigiCertCA.crt
# owner: root
# group: root


- name: set up log purging
Expand Down
14 changes: 14 additions & 0 deletions cluster-setup/deployment/update_apache_ssl_2024_07_08.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---

- name: update the Apache SSL configuration file
hosts: head
tasks:
- name: install the httpd site configuration for Kive
copy:
src: deployment/roles/kive_server/files/001-kive-ssl.conf
dest: /etc/apache2/sites-available
owner: root
group: root

- name: update the SSL certificates and restart Apache
ansible.builtin.import_playbook: update_ssl_certs.yaml
29 changes: 29 additions & 0 deletions cluster-setup/deployment/update_ssl_certs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---

- name: update SSL certificates
hosts: head
tasks:
- name: install SSL certificate
copy:
src: star_cfe_chained.crt
dest: /etc/ssl/certs/star_cfe_chained.crt
owner: root
group: root

- name: install SSL key
copy:
src: star_cfe.key
dest: /etc/ssl/private/star_cfe.key
owner: root
group: root
mode: "0600"

- name: reload Apache configuration
hosts: head
tasks:
- name: reload Apache configuration
systemd:
name: apache2
state: reloaded
enabled: true
daemon_reload: true

0 comments on commit 78def9e

Please sign in to comment.