-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathweb_install.yml
46 lines (44 loc) · 877 Bytes
/
web_install.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
---
- name: update
hosts: all
gather_facts: false
tasks:
- name: Update
dnf:
update_only: yes
update_cache: yes
- name: Install Apache on web and start service
hosts: web
gather_facts: false
tasks:
- name: Install Apache
dnf:
name: httpd
state: latest
- name: Start Apache service
systemd:
name: httpd
state: started
- name: Open TCP 80 and 443
firewalld:
service: "{{ item }}"
permanent: yes
state: enabled
immediate: yes
loop:
- http
- https
- name: Install MySQL and start service
hosts: db
gather_facts: false
tasks:
- name: Install MySQL
dnf:
name: mysql-server
state: latest
- name: Start MySQL service
systemd:
name: mysqld
state: started
enabled: yes
...