aboutsummaryrefslogtreecommitdiffstats
path: root/roles/httpd/tasks/main.yml
blob: 584ae0bddc8466679b4885634d57cc7d5f9a1bdf (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
---

- name: create httpd directory
  ansible.builtin.file:
    path: "{{ httpd_configuration_dir }}"
    state: directory
    owner: 0
    group: 0
    mode: "0644"

- name: create passwords directory
  ansible.builtin.file:
    path: "{{ httpd_passwords_dir }}"
    state: directory
    owner: "{{ httpd_user }}"
    group: "{{ httpd_group }}"
    mode: "0700"

- name: create sites directory
  ansible.builtin.file:
    path: "{{ httpd_sites_dir }}"
    state: directory
    owner: 0
    group: 0
    mode: "0755"

- name: retrieve all configuration files
  ansible.builtin.find:
    path: "{{ httpd_configuration_dir }}"
    patterns: "*.conf"
  register: httpd_configuration_files

- name: generate httpd configuration
  ansible.builtin.template:
    src: httpd.conf.j2
    dest: "{{ httpd_configuration_file }}"
    owner: 0
    group: 0
    mode: "0644"

- name: enable and restart httpd
  ansible.builtin.service:
    name: httpd
    state: restarted
    enabled: true
remember that computers suck.