Skip to content

Commit f817dea

Browse files
author
Christopher M. Neill
committed
Merge branch 'master' into SAN-4042-log-cleanup
2 parents 0ac4fd5 + e4a08f7 commit f817dea

17 files changed

Lines changed: 128 additions & 203 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ ca.srl
1010
.DS_Store
1111
ansible/roles/hipache/templates/runnable*
1212
ansible/certs/*
13+
*.retry
14+

ansible/delta-hosts/variables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ intercom_api_key=14771f14efb617900724a16345e57beb55ba9beb
4343
intercom_app_id=wqzm3rju
4444
khronos_canary_github_branches_instance_id=56f05754a443842400b66a53
4545
khronos_canary_logs_instance_id=56f07f5c1e089a200077f2a3
46-
khronos_canary_rebuild_instance_id=56df6674058d592500f76c9f
46+
khronos_canary_rebuild_instance_id=571b39b9d35173300021667d
4747
khronos_canary_rebuild_navi_url=http://canary-build-staging-runnabletest.runnableapp.com:8000/
4848
khronos_canary_token=24592325a6f881e77a01e3bacf0952c49f4e9f1c
4949
khronos_mongo_auth=api:72192e5a-a5e1-11e5-add9-0270db32f7ad

ansible/eru.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- hosts: consul
33
- hosts: mongodb
44
- hosts: redis
5+
- hosts: socket-server-proxy
56

67
- hosts: eru
78
vars_files:
@@ -10,9 +11,7 @@
1011
- { role: notify, tags: [ notify ] }
1112
- { role: builder, tags: [ build ] }
1213
- role: container_start
13-
14-
- hosts: socket-server-proxy
15-
vars_files:
16-
- group_vars/alpha-eru.yml
17-
roles:
18-
- role: eru
14+
- role: nginx-proxied-service
15+
nginx_host: "{{ groups['socket-server-proxy'][0] }}"
16+
target_ip_address: "{{ hostvars[groups['eru'][0]]['ansible_default_ipv4']['address'] }}"
17+
templates: [ 11-eru-server.conf ]

ansible/group_vars/alpha-eru.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ container_tag: "{{ git_branch }}"
66
repo: git@github.com:CodeNow/{{ name }}.git
77
hosted_ports: [ "5501", "5502" ]
88
node_version: lts
9-
npm_version: 2
9+
npm_version: 3
1010
has_shrinkwrap: true
1111

1212
dockerfile_post_install_commands:
@@ -17,6 +17,7 @@ container_envs: >-
1717
-e AWS_ACCESS_KEY={{ eru_aws_access_key_id }}
1818
-e AWS_ENVIRONMENT={{ eru_aws_environment }}
1919
-e AWS_SECRET_KEY={{ eru_aws_secret_access_key }}
20+
-e CONSUL_HOST={{ consul_host_address }}:{{ consul_api_port }}
2021
-e DOMAIN={{ eru_subdomain }}.{{ domain }}
2122
-e GITHUB_CLIENT_ID={{ eru_github_id }}
2223
-e GITHUB_CLIENT_SECRET={{ eru_github_secret }}

ansible/group_vars/alpha-swarm-daemon.yml

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

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

77
container_run_opts: >
88
--name {{ swarm_container_name }}

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.1.2
5+
container_tag: 1.2.0
66

77
container_run_opts: >
88
-d

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
from_port: "{{ consul_api_port }}"
8282
to_port: "{{ consul_api_ssl_port }}"
8383
group_id: "{{ sg_dock_services }}"
84+
- proto: tcp
85+
from_port: "{{ consul_api_port }}"
86+
to_port: "{{ consul_api_port }}"
87+
group_id: "{{ sg_app_services }}"
8488
- proto: tcp
8589
from_port: "{{ consul_api_port }}"
8690
to_port: "{{ consul_api_ssl_port }}"

ansible/roles/eru/tasks/main.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

ansible/roles/khronos/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
with_items:
2222
- name: Khronos CLI - Daily Cleanup
2323
minute: 13
24-
hour: 1,7,13,19
24+
hour: 1,4,7,10,13,16,19,22
2525
script: main-cron.sh
2626
- name: Khronos CLI - Canary
2727
minute: "*/5"
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
# these are pretty hacky, but it should work
3+
# Get port information from the hosted service
4+
- name: get eru ports
5+
when: name == "eru"
6+
tags: [ configure_proxy, deploy ]
7+
become: true
8+
shell: |
9+
for c in $(docker ps | awk '/eru/{ print $1 }'); do
10+
docker port $c 5501 | cut -d ':' -f 2
11+
docker port $c 5502 | cut -d ':' -f 2
12+
done
13+
args:
14+
executable: /bin/bash
15+
register: eru_target_ports
16+
17+
- name: get socket server ports
18+
when: name == "api-socket-server"
19+
tags: [ configure_proxy, deploy ]
20+
become: true
21+
shell: |
22+
for c in $(docker ps | awk '/api-socket-server/{ print $1 }'); do
23+
docker port $c 80 | cut -d ':' -f 2
24+
done
25+
args:
26+
executable: /bin/bash
27+
register: socket_target_ports
28+
29+
# everything from this point on is deligated to the nginx host
30+
31+
- name: print target ports
32+
delegate_to: "{{ nginx_host }}"
33+
tags: [ configure_proxy, deploy ]
34+
debug:
35+
msg: |
36+
eru ports -- {{ eru_target_ports }}
37+
socket ports -- {{ socket_target_ports }}
38+
39+
- name: print target IP address
40+
delegate_to: "{{ nginx_host }}"
41+
tags: [ configure_proxy, deploy ]
42+
debug:
43+
msg: ip -- {{ target_ip_address }}
44+
45+
- name: assert nginx config directory
46+
delegate_to: "{{ nginx_host }}"
47+
tags: [ configure_proxy, deploy ]
48+
become: yes
49+
file:
50+
state: directory
51+
dest: /etc/nginx
52+
53+
- name: assert nginx sites-available directory
54+
delegate_to: "{{ nginx_host }}"
55+
tags: [ configure_proxy, deploy ]
56+
become: yes
57+
file:
58+
state: directory
59+
dest: /etc/nginx/sites-available
60+
61+
- name: assert nginx sites-enable directory
62+
delegate_to: "{{ nginx_host }}"
63+
tags: [ configure_proxy, deploy ]
64+
become: yes
65+
file:
66+
state: directory
67+
dest: /etc/nginx/sites-enable
68+
69+
- name: put configuration in place
70+
delegate_to: "{{ nginx_host }}"
71+
tags: [ configure_proxy, deploy ]
72+
become: yes
73+
template:
74+
src: "{{ item }}"
75+
dest: /etc/nginx/sites-available/{{ item }}
76+
with_items: "{{ templates }}"
77+
78+
- name: link configuration to enable
79+
delegate_to: "{{ nginx_host }}"
80+
tags: [ configure_proxy, deploy ]
81+
become: yes
82+
file:
83+
state: link
84+
dest: /etc/nginx/sites-enabled/{{ item }}
85+
src: /etc/nginx/sites-available/{{ item }}
86+
with_items: "{{ templates }}"
87+
88+
- name: reload nginx
89+
delegate_to: "{{ nginx_host }}"
90+
tags: [ configure_proxy, deploy ]
91+
become: yes
92+
shell: >
93+
docker ps |
94+
awk '/nginx/{ print $1 }' |
95+
xargs -n 1 docker kill --signal SIGHUP
96+
args:
97+
executable: /bin/bash

0 commit comments

Comments
 (0)