-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress.yml
61 lines (58 loc) · 1.64 KB
/
wordpress.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: Create EC2 instance
hosts: localhost
gather_facts: false
vars:
access_key: "{{ access_key }}"
secret_key: "{{ secret_key }}"
region: "{{ region }}"
vpc_name: "{{ vpc_name }}"
vpc_cidr: "{{ vpc_cidr }}"
subnet_name: "{{ subnet_name }}"
subnet_cidr: "{{ subnet_cidr }}"
subnet_zone: "{{ subnet_zone }}"
security_group_name: "{{ security_group_name }}"
rules: "{{ rules }}"
key_name: "{{ key_name }}"
key_path: "{{ key_path }}"
machine_name: "{{ machine_name }}"
machine_type: "{{ machine_type }}"
image_id: "{{ image_id }}"
system_disk_device: "{{ system_disk_device }}"
system_disk_size: "{{ system_disk_size }}"
system_disk_type: "{{ system_disk_type }}"
roles:
- create_ec2
- name: Install wordpress
hosts: new_instance
become: true
gather_facts: false
remote_user: ubuntu
vars:
ansible_ssh_common_args: '-o IdentitiesOnly=yes'
token: "{{ token }}"
mysql_db: "{{ mysql_db }}"
mysql_user: "{{ mysql_user }}"
mysql_password: "{{ mysql_password }}"
roles:
- install_wordpress
- name: Install MySQL
hosts: new_instance
become: true
gather_facts: false
remote_user: ubuntu
vars:
ansible_ssh_common_args: '-o IdentitiesOnly=yes'
mysql_db: "{{ mysql_db }}"
mysql_user: "{{ mysql_user }}"
mysql_password: "{{ mysql_password }}"
mysql_root_password: "{{ mysql_root_password }}"
roles:
- install_mysql
- name: Output the EC2 instance endpoint
hosts: localhost
gather_facts: false
tasks:
- name: Output the EC2 instance endpoint
debug:
msg: "The EC2 instance endpoint is http://{{ eip.public_ip }}"