Skip to content

Commit ce3fedf

Browse files
committed
Merge branch 'master' of github.com:CodeNow/devops-scripts into add-big-poppa
* 'master' of github.com:CodeNow/devops-scripts: hotfix khronos timeout set mem limit to 1g by default bump swarm to 1.2.3 remove prefetch from khronos add memory limit and make syslog optional add delta ingress hosts add delta ingress fix nits I'm going insane make queue worker 1 wow add nginx and reggi to gamma using all.yml instead adding the email github token Adding sendgrid creds update datadog docker config
2 parents f4d2acf + c40c6f5 commit ce3fedf

25 files changed

Lines changed: 298 additions & 33 deletions

ansible/api-core.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@
1616
- role: notify
1717
rollbar_token: "{{ api_rollbar_key }}"
1818
tags: [ notify ]
19-
- { role: redis_key, tags: [ setup, redis_key ] }
20-
- { role: builder, tags: [ build ] }
21-
- { role: docker_client }
22-
- { role: tls-client, tls_service: mongodb, tags: [ tls ] }
23-
- { role: datadog, tags: [ datadog ] }
24-
- { role: container_start }
19+
20+
- role: builder
21+
tags: [ build ]
22+
23+
- role: docker_client
24+
25+
- role: tls-client
26+
tags: [ tls ]
27+
tls_service: mongodb
28+
29+
- role: datadog
30+
tags: [ datadog ]
31+
32+
- role: container_start
33+
number_of_containers: "{{ ansible_processor_cores }}"

ansible/consul-template-updater.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- hosts: consul
33

4-
- hosts: userland
4+
- hosts: "{{ host }}"
55
vars_files:
66
- group_vars/{{ var_file }}
77
- group_vars/alpha-consul-template-updater.yml

ansible/delta-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ delta-mongo-c
1515
[neo4j]
1616
delta-neo4j
1717

18+
[ingress]
19+
delta-ingress
20+
1821
[api_group:children]
1922
worker
2023
api
@@ -131,6 +134,7 @@ drake
131134
eru
132135
github-varnish
133136
hipache
137+
ingress
134138
khronos
135139
mavis
136140
metis

ansible/gamma-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ gamma-app-services
4848
[navi]
4949
gamma-navi
5050

51+
[ingress]
52+
gamma-ingress
53+
5154
[link]
5255
gamma-navi
5356

@@ -130,6 +133,7 @@ drake
130133
eru
131134
github-varnish
132135
hipache
136+
ingress
133137
khronos
134138
mavis
135139
metis

ansible/group_vars/all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ palantiri_rollbar_token: f675e9090d6f483ca4e742af2c7f2f83
150150

151151
# pheidi
152152
pheidi_rollbar_token: 6fc422ac645441bea7f6f14853eb01ab
153+
pheidi_email_github_token: 115b4d854e34e8a5ba99ab73eefe4bf7a8944d6d
153154

154155
# rabbit
155156
rabbit_host_address: "{{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}"

ansible/group_vars/alpha-api-base.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_version: 0.10.38
44
npm_version: 2.8.3
55

66
repo: git@github.com:CodeNow/api.git
7+
restart_policy: always
78

89
# for sendGrid
910
sendgrid_key: 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
@@ -42,6 +43,7 @@ api_base_container_envs: >-
4243
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_LOG_LEVEL=fatal {% endif %}
4344
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_NO_CONFIG_FILE=true {% endif %}
4445
-e NODE_ENV={{ node_env }}
46+
-e NUM_WORKERS=1
4547
-e OPTIMUS_HOST=http://{{ optimus_hostname }}
4648
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
4749
-e RABBITMQ_PASSWORD={{ rabbit_password }}

ansible/group_vars/alpha-api.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ hosted_ports: [ "{{ api_port }}" ]
88
redis_key: frontend:{{ api_hostname }}
99
is_redis_update_required: yes
1010

11+
memory_hard_limit: 1g
12+
1113
# for container settings
1214
container_envs: >
1315
{{ api_base_container_envs }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: nginx
3+
4+
# used by consul template updater
5+
proxy_service_name: api
6+
target_container_name: nginx
7+
target_updater_file_path: /etc/nginx/sites-enabled
8+
template_command: /bin/docker kill -s HUP {{ target_container_name }}
9+
template_path: /etc/nginx/template/api.tmpl
10+
11+
# used by container_kill_start
12+
container_image: "{{ name }}"
13+
container_tag: "1.10"
14+
15+
restart_policy: always
16+
17+
container_run_opts: >
18+
-d
19+
--name {{ name }}
20+
-p 0.0.0.0:443:443
21+
-p 0.0.0.0:80:80
22+
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
23+
-v {{ target_updater_file_path }}
24+
-v /etc/ssl/certs/{{ domain }}:/etc/ssl/certs/{{ domain }}:ro
25+
-v /var/log/nginx:/var/log/nginx

ansible/group_vars/alpha-khronos.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ container_envs: >
5050
-e INTERCOM_APP_ID={{ intercom_app_id | default('undefined') }}
5151
-e KHRONOS_MAVIS=http://{{ mavis_hostname }}
5252
-e KHRONOS_MONGO=mongodb://{{ khronos_mongo_auth }}@{{ mongo_hosts }}/{{ khronos_mongo_database }}
53-
-e KHRONOS_PREFETCH=6
5453
-e LOG_LEVEL=error
5554
{% if node_env != "production-epsilon" %}
5655
-e MONGO_CACERT=/opt/ssl/mongo-client/ca.pem
@@ -73,4 +72,4 @@ container_run_opts: >
7372
-v /opt/ssl/mongo-client:/opt/ssl/mongo-client:ro
7473
{{container_envs}}
7574
76-
container_run_args: timeout 5h npm start
75+
container_run_args: timeout 1h npm start

ansible/group_vars/alpha-pheidi.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ repo: "git@github.com:CodeNow/{{ name }}.git"
66
node_version: "4.2.2"
77
npm_version: "2.14.7"
88

9+
# for sendGrid
10+
sendgrid_key: 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
11+
912
container_envs: >
1013
-e DATADOG_HOST={{ datadog_host_address }}
1114
-e DATADOG_PORT={{ datadog_port }}
@@ -18,12 +21,14 @@ container_envs: >
1821
-e RABBITMQ_PORT="{{ rabbit_port }}"
1922
-e RABBITMQ_USERNAME="{{ rabbit_username }}"
2023
-e ROLLBAR_KEY={{ pheidi_rollbar_token }}
24+
-e EMAIL_GITHUB_ACCESS_TOKEN={{ pheidi_email_github_token }}
2125
-e RUNNABOT_GITHUB_ACCESS_TOKENS={{ pheidi_runnabot_tokens }}
2226
{% if node_env != "production-epsilon" %} -e MONGO_CACERT=/opt/ssl/mongo-client/ca.pem {% endif %}
2327
{% if node_env != "production-epsilon" %} -e MONGO_CERT=/opt/ssl/mongo-client/cert.pem {% endif %}
2428
{% if node_env != "production-epsilon" %} -e MONGO_KEY=/opt/ssl/mongo-client/key.pem {% endif %}
2529
-e MONGO_REPLSET_NAME={{ pheidi_mongo_replset_name }}
2630
-e MONGO=mongodb://{{ pheidi_mongo_auth }}@{{ mongo_hosts }}/{{ pheidi_mongo_database }}
31+
-e SENDGRID_KEY={{ sendgrid_key }}
2732
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
2833
-e WEB_URL=https://app.{{ domain }}
2934

0 commit comments

Comments
 (0)