File tree Expand file tree Collapse file tree
roles/content-domain-proxy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : consul
3+
4+ - hosts : userland
5+ vars_files :
6+ - group_vars/{{ var_file }}
7+ - group_vars/alpha-consul-template-updater.yml
8+ roles :
9+ - role : notify
10+ tags : notify
11+
12+ - role : container_kill_start
Original file line number Diff line number Diff line change 1+ name : consul-template-updater
2+
3+ # container_kill_start settings
4+ container_image : avthart/consul-template
5+ container_tag : latest
6+
7+ container_run_opts : >
8+ -d
9+ --name {{ name }}
10+ -v /var/run/docker.sock:/tmp/docker.sock
11+ -v {{ template_path }}:/tmp/template
12+ --volumes-from {{ target_container_name }}
13+
14+ container_run_args : >
15+ -consul={{ consul_host_address }}:{{ consul_api_port }}
16+ -wait=1s
17+ -template="/tmp/template:{{ target_updater_file_path }}/{{ out_file }}:{{ template_command }}"
Original file line number Diff line number Diff line change 11---
22name : nginx
33
4+ # used by consul template updater
5+ target_container_name : nginx
6+ target_updater_file_path : /etc/nginx/sites-enabled
7+ template_path : /etc/nginx/template/navi.tmpl
8+ template_command : /bin/docker kill -s HUP {{ target_container_name }}
9+ out_file : navi.conf
10+
11+ # used by container_kill_start
412container_image : " {{ name }}"
513container_tag : " 1.10"
614
715container_run_opts : >
816 -d
9- -h {{ name }}
17+ --net=host
18+ --name {{ name }}
1019 -p 0.0.0.0:443:443
1120 -p 0.0.0.0:80:80
1221 -v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
13- -v /etc/nginx/sites-enabled/:/etc/nginx/sites-enabled/:ro
22+ -v {{ target_updater_file_path }}
1423 -v /etc/ssl/certs/{{ user_content_domain }}:/etc/ssl/certs/{{ user_content_domain }}:ro
1524 -v /var/log/nginx:/var/log/nginx
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ hosted_ports: [ "{{ navi_http_port }}" ]
77node_version : " 4.2.4"
88npm_version : " 2.8.3"
99
10+ restart_policy : always
11+
1012redis_ca_cert_path : /opt/ssl/{{ name }}/redis/ca.pem
1113content_domain_certs : /opt/ssl/{{ user_content_domain }}
1214
Original file line number Diff line number Diff line change 1+ name : registrator
2+
3+ # container_kill_start settings
4+ container_image : gliderlabs/registrator
5+ container_tag : v7
6+
7+ container_run_opts : >
8+ -d
9+ --hostname={{ ansible_hostname }}
10+ --name={{ name }}
11+ --volume=/var/run/docker.sock:/tmp/docker.sock
12+
13+ container_run_args : >
14+ -ip {{ ansible_default_ipv4.address }}
15+ consul://{{ consul_host_address }}:{{ consul_api_port }}
Original file line number Diff line number Diff line change 11---
22- hosts : userland
33 vars_files :
4- - group_vars/alpha-navi-proxy.yml
4+ - group_vars/alpha-navi-proxy.yml
55 roles :
6- - role : datadog
7- has_dd_integration : yes
6+ - role : datadog
7+ has_dd_integration : yes
88
9- - role : content-domain-proxy
9+ - role : content-domain-proxy
1010
11- - role : container_kill_start
11+ - role : container_kill_start
12+
13+ - include : consul-template-updater.yml
14+ vars :
15+ var_file : alpha-navi-proxy.yml
Original file line number Diff line number Diff line change 2121
2222 - role : container_start
2323 number_of_containers : " {{ ansible_processor_cores }}"
24-
25- - role : nginx-proxied-service
26- nginx_host : " {{ groups['userland'][0] }}"
27- target_ip_address : " {{ hostvars[groups['navi'][0]]['ansible_default_ipv4']['address'] }}"
28- templates : [ 69-navi.conf ]
29- nginx_config : proxy
Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : consul
3+
4+ - hosts : navi
5+ vars_files :
6+ - group_vars/alpha-registrator.yml
7+ roles :
8+ - role : notify
9+ tags : notify
10+
11+ - role : container_kill_start
Original file line number Diff line number Diff line change 4444 dest : /etc/nginx
4545 state : directory
4646
47-
4847- name : assert nginx sites-enabled directory
4948 tags : [ configure_proxy ]
5049 become : yes
5756 become : yes
5857 template :
5958 src : proxy-nginx.conf
60- dest : /etc/nginx/nginx.conf
59+ dest : /etc/nginx/nginx.conf
60+
61+ - name : assert nginx template directory
62+ tags : [ configure_proxy ]
63+ become : yes
64+ file :
65+ state : directory
66+ dest : /etc/nginx/template
67+
68+ - name : put navi template in place
69+ tags : [ configure_proxy ]
70+ become : yes
71+ template :
72+ src : navi.tmpl
73+ dest : /etc/nginx/template
Original file line number Diff line number Diff line change @@ -4,9 +4,8 @@ map $http_upgrade $connection_upgrade {
44}
55
66upstream {{ name }} {
7- {% for port in proxy_target_ports.stdout_lines -%}
8- server {{ target_ip_address }}:{{ port }} max_fails=0 fail_timeout=1s;
9- {% endfor %}
7+ {{ '{{' }}range service " {{ name }}" {{ '}}' }} server {{ '{{' }}.Address {{ '}}' }}:{{ '{{' }}.Port {{ '}}' }} max_fails= 0 fail_timeout= 1s;
8+ {{ '{{' }}end {{ '}}' }}
109}
1110
1211server {
You can’t perform that action at this time.
0 commit comments