-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo_ansible.yml
63 lines (51 loc) · 1.44 KB
/
demo_ansible.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
- name: playbook to bootstrap managed ubuntu nodes
hosts: webservers
become: true
become_user: root
gather_facts: true
tasks:
- name: Installation PHP 7.4
command: sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
- name: install apache httpd
yum:
name: httpd
state: latest
- name: ensure httpd is running
service:
name: httpd
state: restarted
- name: copy the website template to the server
template:
src: "templates/login.php"
dest: "/var/www/html/login.php"
- name: copy the website template to the server
template:
src: "templates/signup.php"
dest: "/var/www/html/signup.php"
- name: copy the website template to the server
template:
src: "templates/endpoint.php"
dest: "/var/www/html/endpoint.php"
- name: Make sure pymysql is present
pip:
name: pymysql
state: present
- name: Copy database dump file
copy:
src: dump.sql
dest: /tmp
- name: playbook to bootstrap managed ubuntu nodes
hosts: dbserver
become: true
become_user: root
gather_facts: true
tasks:
- name: Run SQL commands to create table
mysql_db:
login_host: "{{ lookup('file','endpoint') }}"
login_password: password
login_user: admin
login_port: 3306
name: myrdsdb
state: import
target: /tmp/dump.sql