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

- name: create static sites directories
  ansible.builtin.file:
    path: "{{ httpd_pre__sites_dir }}/{{ item.domain }}"
    state: directory
    owner: "{{ httpd_pre__user }}"
    group: "{{ httpd_pre__group }}"
    mode: "0755"
  loop: "{{ httpd__rules }}"
  when: item.extra.type is defined and item.extra.type == "static"

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

- name: generate httpd configuration
  ansible.builtin.template:
    src: httpd.conf.j2
    dest: "{{ httpd_pre__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.