summaryrefslogtreecommitdiffstats
path: root/roles/lists/tasks/nginx.yml
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-07-12 03:10:33 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-07-12 03:10:33 +0200
commitef430522256013665205cdda05636846cc622251 (patch)
tree0912b6175af9e97fa76aaf47613bd1926893dc67 /roles/lists/tasks/nginx.yml
parent4e347178a85468cb2a6451a3a57c3379f832ca97 (diff)
nginx: Don't hard-code the HPKP headers.
Instead, lookup the pubkeys and compute the digests on the fly. But never modify the actual header snippet to avoid locking our users out.
Diffstat (limited to 'roles/lists/tasks/nginx.yml')
-rw-r--r--roles/lists/tasks/nginx.yml13
1 files changed, 12 insertions, 1 deletions
diff --git a/roles/lists/tasks/nginx.yml b/roles/lists/tasks/nginx.yml
index 20b3262..6bf4afc 100644
--- a/roles/lists/tasks/nginx.yml
+++ b/roles/lists/tasks/nginx.yml
@@ -2,34 +2,45 @@
apt: pkg=nginx
- name: Copy /etc/nginx/sites-available/sympa
copy: src=etc/nginx/sites-available/sympa
dest=/etc/nginx/sites-available/sympa
owner=root group=root
mode=0644
register: r1
notify:
- Restart Nginx
- name: Create /etc/nginx/sites-enabled/sympa
file: src=../sites-available/sympa
dest=/etc/nginx/sites-enabled/sympa
owner=root group=root
state=link
register: r2
notify:
- Restart Nginx
+- name: Copy HPKP header snippet
+ # never modify the pined pubkeys as we don't want to lock out our users
+ template: src=etc/nginx/snippets/lists.fripost.org.hpkp-hdr.j2
+ dest=/etc/nginx/snippets/lists.fripost.org.hpkp-hdr
+ validate=/bin/false
+ owner=root group=root
+ mode=0644
+ register: r3
+ notify:
+ - Restart Nginx
+
- name: Start nginx
service: name=nginx state=started
- when: not (r1.changed or r2.changed)
+ when: not (r1.changed or r2.changed or r3.changed)
- meta: flush_handlers
- name: Fetch Nginx's X.509 certificate
# Ensure we don't fetch private data
become: False
fetch_cmd: cmd="openssl x509 -noout -pubkey"
stdin=/etc/nginx/ssl/lists.fripost.org.pem
dest=certs/public/lists.fripost.org.pub
tags:
- genkey