-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
82 lines (82 loc) · 2.08 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
77
78
79
80
81
82
---
- name: Install Clickhouse
hosts: clickhouse
remote_user: root
vars:
clickhouse_tcp_port: 9000
clickhouse_dbs_custom:
- { name: logs }
roles:
- ansible-clickhouse
post_tasks:
- name: Wait for Clickhouse
ansible.builtin.wait_for:
port: 9000
delay: 30
- name: Install Vector
hosts: vector
roles:
- vector-role
- name: Install Lighthouse
hosts: lighthouse
vars:
server_name: "{{ ansible_default_ipv4.address }}"
roles:
- lighthouse-role
handlers:
- name: Start Nginx
become: true
ansible.builtin.systemd:
name: nginx
state: restarted
enabled: true
pre_tasks:
- name: Install centos dependencies
become: true
ansible.builtin.command: amazon-linux-extras install epel -y
args:
creates: /etc/yum.repos.d/epel.repo
- name: Create {{ document_root }}
become: true
ansible.builtin.file:
path: "{{ document_root }}"
state: directory
owner: ec2-user
group: ec2-user
mode: 0775
- name: Create nginx directories
become: true
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: ec2-user
group: ec2-user
mode: 0775
with_items:
- "/etc/nginx/sites-available/"
- "/etc/nginx/sites-enabled/"
post_tasks:
- name: Install nginx
become: true
ansible.builtin.yum:
name: "nginx"
notify: Start Nginx
- name: Force Service Start
ansible.builtin.meta: flush_handlers
- name: Setup Nginx Config
become: true
ansible.builtin.template:
src: "nginx.conf.j2"
dest: "/etc/nginx/sites-available/default"
mode: 0644
owner: ec2-user
group: ec2-user
notify: Start Nginx
- name: Enable Nginx Config
ansible.builtin.file:
src: "/etc/nginx/sites-available/default"
dest: "/etc/nginx/sites-enabled/default"
state: link
notify: Start Nginx
- name: Force Service Start
ansible.builtin.meta: flush_handlers