-
Notifications
You must be signed in to change notification settings - Fork 4
/
site.yaml
40 lines (36 loc) · 997 Bytes
/
site.yaml
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
- hosts: localhost
tasks:
- name: Install required packages.
tags: pkgs
ansible.builtin.package:
name:
- httpd
- firewalld
state: present
- name: Start services.
tags: services
ansible.builtin.service:
name: "{{ item }}"
state: started
enabled: yes
loop:
- httpd
- firewalld
- name: Check to see if there is already an index.html file.
tags: index
ansible.builtin.stat:
path: /var/www/html/index.html
register: index
- name: Create custom index page, if one is not already there.
tags: index
ansible.builtin.copy:
src: files/index.html
dest: /var/www/html/index.html
when: index.stat.exists == False
- name: Allow http (80/tcp) traffic through the firewall.
tags: firewall
ansible.posix.firewalld:
service: http
state: enabled
permanent: true
immediate: true