-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.yml
40 lines (34 loc) · 982 Bytes
/
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
---
- hosts: demoservers
gather_facts: yes
remote_user: root
vars:
ansible_password: p@ssword123
vars_files:
- vars/{{ environment_name }}/db_info.yml
tasks:
- name: Apache2のインストール
apt:
name: apache2
state: latest
- name: トップページの配置
template:
src: index.html.j2
dest: /var/www/html/index.html
- name: Apache2のサービス有効化
service:
name: apache2
state: started
enabled: yes
- name: Apache起動時の環境変数を設定
lineinfile:
path: /etc/apache2/apache2.conf
regexp: SetEnv\s+FUEL_ENV
line: SetEnv FUEL_ENV {{ environment_name }}
state: present
notify: restart_apache2
handlers:
- name: restart_apache2
service:
name: apache2
state: restarted