summaryrefslogtreecommitdiffstats
path: root/tasks/main.yml
blob: f32b490ba0b94425ff8d962d4b18fdb55026fff8 (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
36
---
# tasks file for MicroJoe.staticwebsite

- name: Make sure {{ upload_user }} user exists
  user:
    name: "{{ upload_user }}"
    group: "{{ upload_group }}"

- name: Make sure {{ upload_user }} has .ssh directory
  file:
    path: "/home/{{ upload_user }}/.ssh"
    state: directory
    owner: "{{ upload_user }}"
    group: "{{ upload_group }}"

- name: Make sure {{ upload_user }} has .ssh/authorized_keys file
  file:
    path: "/home/{{ upload_user }}/.ssh/authorized_keys"
    state: touch
    owner: "{{ upload_user }}"
    group: "{{ upload_group }}"

- name: Make sure root directory exists
  file:
    path: "{{ nginx_root }}"
    state: directory
    owner: "{{ upload_user }}"
    group: "{{ upload_group }}"

- name: Install nginx configuration file {{ nginx_filename }}
  template:
    src: templates/nginx.j2
    dest: /etc/nginx/sites-available/{{ nginx_filename }}
    owner: root
    group: root
  notify: restart nginx