-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
76 lines (67 loc) · 1.67 KB
/
site.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
---
- hosts: all
become: true
pre_tasks:
- name: install updates (CentOS)
dnf:
update_only: yes
update_cache: yes
when: ansible_distribution == "CentOS"
- name: install updates (Ubuntu)
apt:
upgrade: dist
update_cache: yes
when: ansible_distribution in ["Ubuntu","Debian"]
- hosts: web_servers
become: true
tasks:
- name: install httpd package (CentOS)
dnf:
name:
- httpd
- php
state: latest
when: ansible_distribution == "CentOS"
- name: star httpd (CentnOS)
tags: apache, centos, httpd
service: # like systemctl start httpd
name: httpd
state: start
enabled: yes
when: ansible_distribution == "CentOS"
- name: install apache2 package (Ubuntu)
apt:
name:
- apache2
- libapache2-mod-php
state: latest
when: ansible_distribution in ["Ubuntu","Debian"]
- name: copy default html file for site
tags: apache,apache2,httpd
copy:
src: default_site.html
dest: /var/www/html/index.html
owner: root
group: root
mode: 0644
- hosts: db_servers
#become: true
become_user: root
tasks:
- name: install mariadb server package (CentOS)
dnf:
name: mariadb
state: latest
when: ansible_distribution == "CentOS"
- name: install mariadb server
apt:
name: mariadb-server
state: latest
when: ansible_distribution in ["Ubuntu","Debian"]
- hosts: file_servers
become: true
tasks:
- name: install samba package
package:
name: samba
state: latest