mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
registering monitor and haproxy service in consul
This commit is contained in:
parent
3989833a5d
commit
61c8e70735
7 changed files with 55 additions and 3 deletions
9
ansible/roles/haproxy/handlers/main.yml
Normal file
9
ansible/roles/haproxy/handlers/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
# File: main.yml - Handlers for Consul
|
||||
|
||||
- name: reload consul configuration
|
||||
become: yes
|
||||
service:
|
||||
name: consul
|
||||
state: reloaded
|
||||
listen: reload consul
|
|
@ -18,3 +18,11 @@
|
|||
- /etc/letsencrypt/live/newsblur.com/:/etc/letsencrypt/live/newsblur.com/
|
||||
- /etc/letsencrypt/archive/newsblur.com/:/etc/letsencrypt/archive/newsblur.com/
|
||||
- /srv/newsblur/docker/haproxy:/usr/local/etc/haproxy
|
||||
|
||||
- name: Register haproxy in consul
|
||||
become: yes
|
||||
template:
|
||||
src: consul_service.json
|
||||
dest: /etc/consul.d/haproxy.json
|
||||
notify:
|
||||
- reload consul
|
||||
|
|
9
ansible/roles/haproxy/templates/consul_service.json
Normal file
9
ansible/roles/haproxy/templates/consul_service.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"service": {
|
||||
"name": "haproxy",
|
||||
"tags": [
|
||||
"haproxy"
|
||||
],
|
||||
"port": 80
|
||||
}
|
||||
}
|
9
ansible/roles/monitor/handlers/main.yml
Normal file
9
ansible/roles/monitor/handlers/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
# File: main.yml - Handlers for Consul
|
||||
|
||||
- name: reload consul configuration
|
||||
become: yes
|
||||
service:
|
||||
name: consul
|
||||
state: reloaded
|
||||
listen: reload consul
|
|
@ -12,4 +12,12 @@
|
|||
- 5000:5000
|
||||
restart_policy: unless-stopped
|
||||
volumes:
|
||||
- /srv/newsblur:/srv/newsblur
|
||||
- /srv/newsblur:/srv/newsblur
|
||||
|
||||
- name: Register monitor in consul
|
||||
become: yes
|
||||
template:
|
||||
src: consul_service.json
|
||||
dest: /etc/consul.d/monitor.json
|
||||
notify:
|
||||
- reload consul
|
||||
|
|
9
ansible/roles/monitor/templates/consul_service.json
Normal file
9
ansible/roles/monitor/templates/consul_service.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"service": {
|
||||
"name": "monitor",
|
||||
"tags": [
|
||||
"www"
|
||||
],
|
||||
"port": 5000
|
||||
}
|
||||
}
|
|
@ -11,8 +11,8 @@
|
|||
- base
|
||||
- docker
|
||||
- {role: 'repo', tags: 'repo'}
|
||||
- {role: 'letsencrypt', tags: 'letsencrypt'}
|
||||
- monitor
|
||||
#- {role: 'letsencrypt', tags: 'letsencrypt'}
|
||||
- {role: 'consul', tags: 'consul'}
|
||||
- {role: 'consul-client', tags: 'consul'}
|
||||
- {role: 'monitor', tags: 'monitor'}
|
||||
- {role: 'haproxy', tags: 'haproxy'}
|
||||
|
|
Loading…
Add table
Reference in a new issue