Skip to content

Commit d1ac25b

Browse files
committed
update application playbook
1 parent 811f0ac commit d1ac25b

File tree

3 files changed

+37
-22
lines changed

3 files changed

+37
-22
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
<details open>
4040
<summary><b>Table of Contents</b></summary>
4141

42-
- [Getting Started](#toolbox-getting-started)
42+
- [:toolbox: Getting Started](#toolbox-getting-started)
4343
- [Prerequisites](#prerequisites)
4444
- [Environment Variables](#environment-variables)
4545
- [Run Locally](#run-locally)
46-
- [Usage](#rocket-usage)
47-
- [Roadmap](#world_map-roadmap)
48-
- [Contributors](#busts_in_silhouette-contributors)
49-
- [Credits](#sparkles-credits)
50-
- [License](#scroll-license)
46+
- [:rocket: Usage](#rocket-usage)
47+
- [:world_map: Roadmap](#world_map-roadmap)
48+
- [:busts_in_silhouette: Contributors](#busts_in_silhouette-contributors)
49+
- [:sparkles: Credits](#sparkles-credits)
50+
- [:scroll: License](#scroll-license)
5151
</details>
5252

5353
# :toolbox: Getting Started
@@ -126,6 +126,19 @@ To deploy this project, with each base, follow these steps:
126126
bash ./container_deploy.sh
127127
```
128128

129+
You can watch IPv4 address of all container in `ansible-net` network
130+
131+
```sh
132+
$ docker network inspect --format='{{range .Containers}}{{.Name}}: {{.IPv4Address}}{{"\n"}}{{end}}' ansible-net
133+
134+
ansible-controller: 172.18.0.2/16
135+
backend: 172.18.0.7/16
136+
prometheus: 172.18.0.3/16
137+
alertmanager: 172.18.0.4/16
138+
grafana: 172.18.0.5/16
139+
frontend: 172.18.0.6/16
140+
```
141+
129142
**Virtual machine base:**
130143

131144
```sh

ansible/inventories/hosts.ini

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
[backend]
2+
backend_host ansible_host=172.18.0.7
3+
14
[prometheus]
2-
prometheus_host ansible_host=18.143.102.28
5+
prometheus_host ansible_host=172.18.0.3
36

47
[alertmanager]
5-
alertmanager_host ansible_host=13.229.48.66
8+
alertmanager_host ansible_host=172.18.0.4
69

710
[grafana]
8-
grafana_host ansible_host=54.255.215.125
9-
10-
[frontend]
11-
frontend_host ansible_host=52.77.213.237
11+
grafana_host ansible_host=172.18.0.5
1212

13-
[backend]
14-
backend_host ansible_host=18.143.139.245
13+
[ansible-controller]
14+
ansible-controller_host ansible_host=172.18.0.2
1515

16-
[ansible_controller]
17-
ansible_controller_host ansible_host=54.169.231.124
16+
[frontend]
17+
frontend_host ansible_host=172.18.0.6
1818

1919
[node_exporter]
20-
frontend_host ansible_host=52.77.213.237
21-
backend_host ansible_host=18.143.139.245
20+
backend_host ansible_host=172.18.0.7
21+
frontend_host ansible_host=172.18.0.6

ansible/playbooks/roles/application/tasks/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@
3939
command:
4040
chdir: "{{work_dir}}"
4141
cmd: watch -n 0.1 "npm start" & # restart the process if/when it stops
42-
async: 1000
42+
async: 3600
4343
poll: 0
4444

45-
- name: pause for 5 second wait starting application
46-
pause:
47-
seconds: 5
45+
- name: Wait for the application to start
46+
wait_for:
47+
host: "{{server_domain}}"
48+
port: "{{app_port}}"
49+
timeout: 60
4850

4951
- name: "Check if application is accessible"
5052
uri:

0 commit comments

Comments
 (0)