---
# This playbook configures SSL
- name: copy SSL certificate to correct location
  copy: src=config/data.england.nhs.uk.crt dest=/etc/ssl/data.england.nhs.uk.crt owner=root

- name: copy SSL key to correct location
  copy: src=config/data.england.nhs.uk.key_secure dest=/etc/ssl/data.england.nhs.uk.key_secure owner=root

- name: decrypt SSL certificate
  command: openssl rsa -in /etc/ssl/data.england.nhs.uk.key_secure -out /etc/ssl/data.england.nhs.uk.key -passin pass:{{ssl_passphrase}}

- name: copy nginx config
  copy: src=config/nginx_ckan dest=/etc/nginx/sites-available/ckan mode=0644 owner=root

---
# This playbook configures SSL
- name: copy SSL certificate to correct location
  copy: src=config/data.england.nhs.uk.crt dest=/etc/ssl/data.england.nhs.uk.crt owner=root

- name: copy SSL key to correct location
  copy: src=config/data.england.nhs.uk.key_secure dest=/etc/ssl/data.england.nhs.uk.key_secure owner=root

- name: decrypt SSL certificate
  command: openssl rsa -in /etc/ssl/data.england.nhs.uk.key_secure -out /etc/ssl/data.england.nhs.uk.key -passin pass:{{ssl_passphrase}}

- name: copy nginx config
  copy: src=config/nginx_ckan dest=/etc/nginx/sites-available/ckan mode=0644 owner=root

- name: deactivate default nginx site
  file:
    name: /etc/nginx/sites-enabled/default
    state: absent

- name: activate ckan nginx site
  file:
    src: /etc/nginx/sites-available/ckan
    dest: /etc/nginx/sites-enabled/ckan
    state: link

Enable our CKAN nginx config
Enable our CKAN nginx config
