Skip to content

Commit 5b4bde1

Browse files
author
Anandkumar Patel
committed
add certs to navi
1 parent 46401da commit 5b4bde1

5 files changed

Lines changed: 38 additions & 9 deletions

File tree

ansible/delta-hosts/docks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var params = {
1818
},
1919
// Only fetch instances that are tagged as docks
2020
{
21-
Name: 'tag:role',
22-
Values: ['dock']
21+
Name: 'tag:org',
22+
Values: ['2335750']
2323
},
2424
// Only fetch running instances
2525
{

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-navi.yml

Lines changed: 11 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 }}
@@ -20,10 +23,6 @@ container_envs: >
2023
-e HTTP_PORT={{ hosted_ports[0] }}
2124
-e LOG_LEVEL_STDOUT=trace
2225
-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 %}
2726
-e NODE_ENV={{ node_env }}
2827
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
2928
-e RABBITMQ_PASSWORD={{ rabbit_password }}
@@ -32,12 +31,18 @@ container_envs: >
3231
-e REDIS_CACERT={{ redis_ca_cert_path }}
3332
-e REDIS_IPADDRESS={{ redis_host_address }}
3433
-e REDIS_PORT={{ redis_tls_port }}
35-
{% if navi_intercom_app_id is defined %} -e INTERCOM_APP_ID={{ navi_intercom_app_id }} {% endif %}
3634
{% if navi_intercom_api_key is defined %} -e INTERCOM_API_KEY={{ navi_intercom_api_key }} {% endif %}
35+
{% if navi_intercom_app_id is defined %} -e INTERCOM_APP_ID={{ navi_intercom_app_id }} {% endif %}
36+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_APP_NAME={{ navi_new_relic_app_name }} {% endif %}
37+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }} {% endif %}
38+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_LOG_LEVEL=fatal {% endif %}
39+
{% if navi_new_relic_app_name is defined %} -e NEW_RELIC_NO_CONFIG_FILE=true {% endif %}
3740
3841
container_run_opts: >
3942
-h {{ name }}
4043
-d
4144
-p {{ hosted_ports[0] }}:{{ hosted_ports[0] }}
45+
-p {{ hosted_ports[1] }}:{{ hosted_ports[1] }}
4246
-v {{ redis_ca_cert_path }}:{{ redis_ca_cert_path }}
47+
-v {{ content_domain_certs }}:{{ content_domain_certs }}
4348
{{ container_envs }}

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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: make sure cert directory is in place
3+
tags: [ certs ]
4+
when: ca_dest is defined
5+
become: true
6+
file:
7+
dest: /opt/ssl/{{ user_content_domain }}
8+
state: directory
9+
10+
- name: put certs in place
11+
tags: [ certs ]
12+
become: true
13+
copy:
14+
src: "{{ user_content_domain }}/{{ item }}"
15+
dest: /opt/ssl/{{ 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

0 commit comments

Comments
 (0)