/
vhost-docs-infra.yml
83 lines (70 loc) · 1.78 KB
/
vhost-docs-infra.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This task is just for the docs.infra.centos.org node, automatically rendering (through podman) website content
- import_role:
name: httpd
vars:
httpd_tls: True
- import_role:
name: httpd
tasks_from: pki-tls
vars:
pki_hostname: docs.infra.centos.org
- name: Adding specific user to build mkdocs site
user:
name: "{{ httpd_docs_infra_user }}"
state: present
comment: CentOS Web content user
- name: Ensuring we have a DocumentRoot
file:
path: "{{ httpd_docs_infra_rootdir }}"
state: directory
owner: '{{ httpd_docs_infra_user }}'
group: '{{ httpd_docs_infra_user }}'
mode: 0775
- name: Configuring httpd vhost for www
template:
src: "{{ item }}.j2"
dest: "/etc/httpd/conf.d/{{ item }}"
mode: 0644
with_items:
- 02_vhost-docs-infra.conf
- ssl-vhost-docs-infra.conf
notify:
- reload_httpd
tags:
- config
- name: Install some tools to render website locally
yum:
name:
- podman
- git
state: installed
- name: Enabling needed selinux booleans
seboolean:
name: "{{ item }}"
persistent: yes
state: on
with_items:
- httpd_can_network_connect
- name: Wrapper tool to build website
template:
src: docs-infra/mkdocs-infra.j2
dest: /usr/libexec/centos/mkdocs-infra
mode: 0750
owner: "{{ httpd_docs_infra_user }}"
register: mkdocs_infra_script
tags:
- script
- name: Init podman containers
command: /usr/libexec/centos/mkdocs-infra init
when: mkdocs_infra_script is changed
become_user: "{{ httpd_docs_infra_user }}"
tags:
- script
- name: Cron to compare upstream git
cron:
name: Build mkdcos from git
job: /usr/libexec/centos/mkdocs-infra build
minute: "*/2"
user: "{{ httpd_docs_infra_user }}"
tags:
- cron