mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Deploying haproxy vs setting up haproxy (reload vs restart)
This commit is contained in:
parent
496347a1d7
commit
8ebf75d8ab
5 changed files with 41 additions and 0 deletions
2
Makefile
2
Makefile
|
@ -83,6 +83,8 @@ deploy_node:
|
|||
- ansible-playbook ansible/deploy_node.yml
|
||||
deploy_task:
|
||||
- ansible-playbook ansible/deploy_task.yml
|
||||
deploy_www:
|
||||
- ansible-playbook ansible/deploy_www.yml
|
||||
|
||||
# Provision
|
||||
app:
|
||||
|
|
21
ansible/deploy_www.yml
Normal file
21
ansible/deploy_www.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- hosts: www
|
||||
gather_facts: false
|
||||
vars_files:
|
||||
- env_vars/base.yml
|
||||
- env_vars/dev.yml
|
||||
- roles/letsencrypt/defaults/main.yml
|
||||
handlers:
|
||||
- include: roles/haproxy/handlers/main.yml
|
||||
|
||||
tasks:
|
||||
- name: Template haproxy.cfg file
|
||||
template:
|
||||
src: /srv/newsblur/docker/haproxy/haproxy.consul.cfg.j2
|
||||
dest: /srv/newsblur/docker/haproxy/haproxy.consul.cfg
|
||||
|
||||
- name: Reload haproxy
|
||||
debug:
|
||||
msg: Gracefully reloading HAProxy
|
||||
changed_when: yes
|
||||
notify: reload haproxy
|
|
@ -55,3 +55,10 @@
|
|||
src: /srv/secrets-newsblur/configs/hosts
|
||||
dest: /etc/hosts
|
||||
tags: hosts
|
||||
|
||||
- name: "Add inventory_hostname to /etc/hosts"
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/hosts
|
||||
line: "127.0.0.1 {{ inventory_hostname }}"
|
||||
tags: hosts
|
||||
|
|
|
@ -12,3 +12,8 @@
|
|||
become: yes
|
||||
command: docker kill --signal HUP haproxy
|
||||
listen: reload haproxy
|
||||
|
||||
- name: restart haproxy
|
||||
become: yes
|
||||
command: docker restart haproxy
|
||||
listen: restart haproxy
|
||||
|
|
|
@ -45,3 +45,9 @@
|
|||
notify: reload haproxy
|
||||
when: updated_config.changed
|
||||
changed_when: updated_config.changed
|
||||
|
||||
- name: Restart HAProxy
|
||||
debug:
|
||||
msg: Restarting HAProxy
|
||||
changed_when: yes
|
||||
notify: restart haproxy
|
||||
|
|
Loading…
Add table
Reference in a new issue