Skip to content

Commit 5feded7

Browse files
Merge pull request #472 from CodeNow/SAN-4260-remove-hipache
add https to navi, remove userland hipache
2 parents 79ac462 + 30f1afa commit 5feded7

7 files changed

Lines changed: 45 additions & 11 deletions

File tree

ansible/group_vars/all.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ mongo_hosts: "{% for host in groups['mongodb'] %}{{ hostvars[host]['ansible_defa
126126

127127
# navi
128128
navi_host_address: "{{ hostvars[groups['navi'][0]]['ansible_default_ipv4']['address'] }}"
129-
navi_port: 3567
129+
navi_http_port: 3567
130+
navi_https_port: 443
130131
navi_rollbar_token: 719269e87b9b42848472542a8b2059ae
131132

132133
# neo4j

ansible/group_vars/alpha-api-base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ api_base_container_envs: >-
3232
-e MONGO_KEY=/opt/ssl/mongodb-client/key.pem
3333
-e MONGO_REPLSET_NAME={{ api_mongo_replset_name }}
3434
-e MONGO=mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}
35-
-e NAVI_HOST=http://{{ navi_host_address }}:{{ navi_port }}
35+
-e NAVI_HOST=http://{{ navi_host_address }}:{{ navi_http_port }}
3636
-e NEO4J={{ api_neo4j_protocol }}{{ api_neo4j_auth }}@{{ neo4j_host_address }}:{{ api_neo4j_port }}
3737
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_APP_NAME={{ api_new_relic_app_name }} {% endif %}
3838
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }} {% endif %}

ansible/group_vars/alpha-navi.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ 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_port }}" ]
6+
hosted_ports: [ "{{ navi_http_port }}", "{{ navi_https_port }}" ]
77
node_version: "4.2.4"
88
npm_version: "2.8.3"
99

1010
redis_ca_cert_path: /opt/ssl/{{ name }}/redis/ca.pem
11+
content_domain_certs: /opt/ssl/{{ user_content_domain }}
12+
1113
container_envs: >
1214
-e API_URL={{ api_url }}
15+
-e CERT_PATH={{ content_domain_certs }}
1316
-e COOKIE_DOMAIN=.{{ user_content_domain }}
1417
-e COOKIE_SECRET={{ navi_cookie_secret }}
1518
-e DATADOG_HOST={{ datadog_host_address }}
@@ -18,12 +21,9 @@ container_envs: >
1821
-e ENABLE_LRU_CACHE=1
1922
-e ERROR_URL=http://{{ detention_host_address }}:{{ detention_port }}
2023
-e HTTP_PORT={{ hosted_ports[0] }}
24+
-e HTTPS_PORT={{ hosted_ports[1] }}
2125
-e LOG_LEVEL_STDOUT=trace
2226
-e MONGO=mongodb://{{ navi_mongo_host_address }}:{{ navi_mongo_port }}/{{ navi_mongo_database }}
23-
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_APP_NAME={{ navi_new_relic_app_name }} {% endif %}
24-
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }} {% endif %}
25-
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LOG_LEVEL=fatal {% endif %}
26-
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_NO_CONFIG_FILE=true {% endif %}
2727
-e NODE_ENV={{ node_env }}
2828
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
2929
-e RABBITMQ_PASSWORD={{ rabbit_password }}
@@ -32,12 +32,18 @@ container_envs: >
3232
-e REDIS_CACERT={{ redis_ca_cert_path }}
3333
-e REDIS_IPADDRESS={{ redis_host_address }}
3434
-e REDIS_PORT={{ redis_tls_port }}
35-
{% if navi_intercom_app_id is defined %} -e INTERCOM_APP_ID={{ navi_intercom_app_id }} {% endif %}
3635
{% if navi_intercom_api_key is defined %} -e INTERCOM_API_KEY={{ navi_intercom_api_key }} {% endif %}
36+
{% if navi_intercom_app_id is defined %} -e INTERCOM_APP_ID={{ navi_intercom_app_id }} {% endif %}
37+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_APP_NAME={{ navi_new_relic_app_name }} {% endif %}
38+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }} {% endif %}
39+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LOG_LEVEL=fatal {% endif %}
40+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_NO_CONFIG_FILE=true {% endif %}
3741
3842
container_run_opts: >
3943
-h {{ name }}
4044
-d
4145
-p {{ hosted_ports[0] }}:{{ hosted_ports[0] }}
46+
-p {{ hosted_ports[1] }}:{{ hosted_ports[1] }}
4247
-v {{ redis_ca_cert_path }}:{{ redis_ca_cert_path }}
48+
-v {{ content_domain_certs }}:{{ content_domain_certs }}
4349
{{ container_envs }}

ansible/group_vars/ec2_sg.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ https_port: 443
1717
ip_all: "0.0.0.0/0"
1818
krain_port: 3100
1919
named_port: 53
20-
navi_port: 3567
20+
navi_http_port: 3567
21+
navi_https_port: 443
2122
neo4j_port: 7473
2223
neo4j_tls_port: 7474
2324
redis_port: 6379

ansible/navi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
rollbar_token: "{{ navi_rollbar_token }}"
1414
tags: [ notify ]
1515
- { role: builder, tags: [ build ] }
16+
- { role: content-domain-certs }
1617
- { role: tls-server-ca, ca_dest: "{{ redis_ca_cert_path }}" }
1718
- { role: container_kill_start }
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
- name: make sure cert directory is in place
3+
tags: [ certs ]
4+
become: true
5+
file:
6+
dest: /opt/ssl/{{ user_content_domain }}
7+
state: directory
8+
9+
- name: put certs in place
10+
tags: [ certs ]
11+
become: true
12+
copy:
13+
src: "{{ user_content_domain }}/{{ item }}"
14+
dest: /opt/ssl/{{ user_content_domain }}/{{ item }}
15+
mode: 0400
16+
owner: root
17+
group: root
18+
with_items:
19+
- ca.pem
20+
- key.pem
21+
- cert.pem

ansible/roles/ec2/sg_configure/tasks/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,12 @@
222222
to_port: "{{ sshd_port }}"
223223
group_id: "{{ sg_bastion }}"
224224
- proto: tcp
225-
from_port: "{{ navi_port }}"
226-
to_port: "{{ navi_port }}"
225+
from_port: "{{ navi_http_port }}"
226+
to_port: "{{ navi_http_port }}"
227+
group_id: "{{ sg_hipache }}"
228+
- proto: tcp
229+
from_port: "{{ navi_https_port }}"
230+
to_port: "{{ navi_https_port }}"
227231
group_id: "{{ sg_hipache }}"
228232

229233
- name: Neo4J SG

0 commit comments

Comments
 (0)