aboutsummaryrefslogtreecommitdiffstats
path: root/roles/nginx/tasks/main.yml
blob: f73e5e1bc163ad7f1f6bcffe915ecae5a75e4a47 (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
- name: Configure /etc/nginx/nginx.conf
  template:
    dest: '/etc/nginx/nginx.conf'
    src: nginx.conf.j2
    owner: root
    group: root
    mode: 0644
  notify:
  - reload nginx
  tags:
  - nginx

- name: Disable default site
  file:
    path: '/etc/nginx/sites-enabled/default'
    state: absent
  notify:
  - reload nginx
  tags:
  - nginx

- name: Download dhparam
  get_url:
    dest: '/etc/nginx/dhparam'
    url: 'https://ssl-config.mozilla.org/ffdhe2048.txt'
    owner: root
    group: root
    mode: 0440
  notify:
  - reload nginx
  tags:
  - nginx

- name: Create service drop-in directory
  file:
    dest: '/etc/systemd/system/nginx.service.d'
    state: directory
    owner: root
    group: root
    mode: 0755
  tags:
  - nginx

- name: Start nginx after networks are configured
  copy:
    dest: '/etc/systemd/system/nginx.service.d/wait-online.conf'
    src: wait-online.conf
    owner: root
    group: root
    mode: 0644
  tags:
  - nginx

- name: Enable nginx service
  systemd:
    name: nginx.service
    enabled: yes
    masked: no
    state: started
  tags:
  - nginx

# vim: set ts=2 sw=2 et: