Skip to content

Commit 336a331

Browse files
author
Christopher M. Neill
committed
Merge branch 'master' into set-rsyslog-queue-types
2 parents a7d2586 + acc70f6 commit 336a331

17 files changed

Lines changed: 245 additions & 149 deletions

File tree

ansible/group_vars/all.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ mongo_hosts: "{% for host in groups['mongodb'] %}{{ hostvars[host]['ansible_defa
127127
# navi
128128
navi_host_address: "{{ hostvars[groups['navi'][0]]['ansible_default_ipv4']['address'] }}"
129129
navi_http_port: 3567
130-
navi_https_port: 443
131130
navi_rollbar_token: 719269e87b9b42848472542a8b2059ae
132131

133132
# neo4j
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: nginx
3+
4+
container_image: "{{ name }}"
5+
container_tag: "1.10"
6+
7+
container_run_opts: >
8+
-d
9+
-h {{ name }}
10+
-p 0.0.0.0:443:443
11+
-p 0.0.0.0:80:80
12+
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
13+
-v /etc/nginx/sites-enabled/:/etc/nginx/sites-enabled/:ro
14+
-v /etc/ssl/certs/{{ user_content_domain }}:/etc/ssl/certs/{{ user_content_domain }}:ro
15+
-v /var/log/nginx:/var/log/nginx

ansible/group_vars/alpha-navi.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: navi
33
container_image: registry.runnable.com/runnable/{{ name }}
44
container_tag: "{{ git_branch }}"
55
repo: git@github.com:CodeNow/{{ name }}.git
6-
hosted_ports: [ "{{ navi_http_port }}", "{{ navi_https_port }}" ]
6+
hosted_ports: [ "{{ navi_http_port }}" ]
77
node_version: "4.2.4"
88
npm_version: "2.8.3"
99

@@ -17,11 +17,9 @@ container_envs: >
1717
-e COOKIE_SECRET={{ navi_cookie_secret }}
1818
-e DATADOG_HOST={{ datadog_host_address }}
1919
-e DATADOG_PORT={{ datadog_port }}
20-
-e ENABLE_CLUSTERING=1
2120
-e ENABLE_LRU_CACHE=1
2221
-e ERROR_URL=http://{{ detention_host_address }}:{{ detention_port }}
2322
-e HTTP_PORT={{ hosted_ports[0] }}
24-
-e HTTPS_PORT={{ hosted_ports[1] }}
2523
-e LOG_LEVEL_STDOUT=trace
2624
-e MONGO=mongodb://{{ navi_mongo_host_address }}:{{ navi_mongo_port }}/{{ navi_mongo_database }}
2725
-e NODE_ENV={{ node_env }}
@@ -32,7 +30,6 @@ container_envs: >
3230
-e REDIS_CACERT={{ redis_ca_cert_path }}
3331
-e REDIS_IPADDRESS={{ redis_host_address }}
3432
-e REDIS_PORT={{ redis_tls_port }}
35-
-e USERLAND_IP={{ userland_host_address }}
3633
{% if navi_intercom_api_key is defined %} -e INTERCOM_API_KEY={{ navi_intercom_api_key }} {% endif %}
3734
{% if navi_intercom_app_id is defined %} -e INTERCOM_APP_ID={{ navi_intercom_app_id }} {% endif %}
3835
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_APP_NAME={{ navi_new_relic_app_name }} {% endif %}
@@ -43,8 +40,6 @@ container_envs: >
4340
container_run_opts: >
4441
-h {{ name }}
4542
-d
46-
-p {{ hosted_ports[0] }}:{{ hosted_ports[0] }}
47-
-p {{ hosted_ports[1] }}:{{ hosted_ports[1] }}
43+
-P
4844
-v {{ redis_ca_cert_path }}:{{ redis_ca_cert_path }}
49-
-v {{ content_domain_certs }}:{{ content_domain_certs }}
5045
{{ container_envs }}

ansible/group_vars/alpha-swarm-manager.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "swarm-manager"
22

33
# container_kill_start settings
44
container_image: swarm
5-
container_tag: 1.2.0
5+
container_tag: 1.2.0-0
66

77
container_run_opts: >
88
-d

ansible/group_vars/ec2_sg.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ip_all: "0.0.0.0/0"
1818
krain_port: 3100
1919
named_port: 53
2020
navi_http_port: 3567
21-
navi_https_port: 443
2221
neo4j_port: 7473
2322
neo4j_tls_port: 7474
2423
redis_port: 6379

ansible/navi-proxy.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- hosts: userland
3+
vars_files:
4+
- group_vars/alpha-navi-proxy.yml
5+
roles:
6+
- role: datadog
7+
has_dd_integration: yes
8+
9+
- role: content-domain-proxy
10+
11+
- role: container_kill_start

ansible/navi.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
- hosts: mongo-navi
55
- hosts: rabbitmq
66
- hosts: consul
7-
- hosts: userland
87

98
- hosts: navi
109
vars_files:
@@ -13,7 +12,18 @@
1312
- role: notify
1413
rollbar_token: "{{ navi_rollbar_token }}"
1514
tags: [ notify ]
16-
- { role: builder, tags: [ build ] }
17-
- { role: content-domain-certs }
18-
- { role: tls-server-ca, ca_dest: "{{ redis_ca_cert_path }}" }
19-
- { role: container_kill_start }
15+
16+
- role: builder
17+
tags: [ build ]
18+
19+
- role: tls-server-ca
20+
ca_dest: "{{ redis_ca_cert_path }}"
21+
22+
- role: container_start
23+
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

ansible/roles/container_start/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
set_fact:
2929
number_of_containers: 1
3030

31-
- debug:
31+
- name: print number of contaienrs
32+
tags: deploy
33+
debug:
3234
msg: starting this many containers -- {{ number_of_containers }}
3335

3436
- name: start new container

ansible/roles/content-domain-certs/tasks/main.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
- name: make sure cert directory is in place
3+
tags: [ configure_proxy, certs ]
4+
become: true
5+
file:
6+
dest: /etc/ssl/certs/{{ user_content_domain }}
7+
state: directory
8+
9+
- name: put certs in place
10+
tags: [ configure_proxy, certs ]
11+
become: true
12+
register: add_certs
13+
copy:
14+
src: "{{ user_content_domain }}/{{ item }}"
15+
dest: /etc/ssl/certs/{{ user_content_domain }}/{{ item }}
16+
mode: 0400
17+
owner: root
18+
group: root
19+
with_items:
20+
- ca.pem
21+
- key.pem
22+
- cert.pem
23+
24+
- name: create chained cert
25+
tags: [ configure_proxy, certs ]
26+
become: true
27+
when: add_certs.changed
28+
shell: >
29+
cat
30+
/etc/ssl/certs/{{ user_content_domain }}/cert.pem
31+
/etc/ssl/certs/{{ user_content_domain }}/ca.pem
32+
>
33+
/etc/ssl/certs/{{ user_content_domain }}/chained.pem
34+
35+
- name: create dhparam.pem
36+
tags: [ configure_proxy, certs ]
37+
become: yes
38+
command: openssl dhparam -out /etc/ssl/certs/{{ user_content_domain }}/dhparam.pem 2048
39+
40+
- name: make sure nginx directory is in place
41+
tags: [ configure_proxy ]
42+
become: true
43+
file:
44+
dest: /etc/nginx
45+
state: directory
46+
47+
48+
- name: assert nginx sites-enabled directory
49+
tags: [ configure_proxy ]
50+
become: yes
51+
file:
52+
state: directory
53+
dest: /etc/nginx/sites-enabled
54+
55+
- name: put nginx configuration in place
56+
tags: [ configure_proxy ]
57+
become: yes
58+
template:
59+
src: proxy-nginx.conf
60+
dest: /etc/nginx/nginx.conf

0 commit comments

Comments
 (0)