summaryrefslogtreecommitdiffstats
path: root/roles/lists/tasks/nginx.yml
blob: fa527818626973b23bf0f7a9fe2f9b506a29d39f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
- name: Install Nginx
  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: Start nginx
  service: name=nginx state=started
  when: not (r1.changed or r2.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.pem
  tags:
    - genkey