-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathdeploywebapp.yml
52 lines (42 loc) · 1.29 KB
/
deploywebapp.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
---
- name: Deploy Web server
hosts: localhost
remote_user: ansibu1
become: yes
tasks:
- name: Installing HTTPD
yum: name=httpd state=latest
- name: Installing MariaDB package
yum:
name:
- mariadb-server
- mariadb-devel
- mariadb-connector-odbc
- mariadb-server-utils
- python3-PyMySQL
- php
state: latest
- name: Start and Enable MariaDB Service
service: name=mariadb state=started
- name: Update MariaDB root password
mysql_user:
name: root
host: localhost
password: mysql
login_user: root
login_password: mysql
check_implicit_admin: yes
priv: "*.*:ALL,GRANT"
- name: Create a New Database called inventory
mysql_db: name=inventory state=present login_user=root login_password=mysql
- name: Copy SQL file
copy: src=/source/servers.sql dest=/tmp/servers.sql
- name: Create empty table called servers
shell: mysql -u root -pmysql inventory < /tmp/servers.sql
- name: Copy Connection PHP File
copy: src=/source/connection.php dest=/var/www/html/
- name: Copy Index PHP file
copy: src=/source/index.php dest=/var/www/html/
- name: Restart Web Service
service: name=httpd state=restarted
...