Skip to content

Commit 9ca60f6

Browse files
Merge branch 'master' into swarm-api
2 parents 0b7422b + cc6b768 commit 9ca60f6

20 files changed

Lines changed: 158 additions & 60 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ node_modules
22
ca-key.pem
33
pass
44
hellorunnable
5+
dump.rdb
6+
erl_crash.dump
7+
npm-debug.log

ansible/beta-hosts/hosts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@ api
2020
[api]
2121
beta-api
2222

23+
[consul]
24+
beta-services
25+
beta-api
26+
beta-web
27+
28+
[vault]
29+
beta-services
30+
2331
[worker]
2432
beta-api
2533

2634
[eru]
2735
beta-services
2836

2937
[navi]
30-
beta-services
38+
beta-navi
3139

3240
[charon]
3341
beta-services

ansible/consul-values.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- hosts: "{{ target }}"
3+
tasks:
4+
- name: make sure `jq` is present
5+
apt:
6+
name=jq
7+
state=present
8+
9+
- name: get versions in ansible
10+
script: getVersions {{ ansible_default_ipv4.address }}
11+
register: versions_result
12+
13+
- name: print versions to stdout
14+
debug:
15+
msg="Versions in Consul\n{{ versions_result.stdout }}"

ansible/consul.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- hosts: consul
3+
serial: 1
4+
vars_files:
5+
- group_vars/alpha-consul.yml
6+
roles:
7+
- { role: notify, tags: notify }
8+
- { role: database }
9+
- { role: container_kill_start, tags: deploy }

ansible/gamma-hosts/docks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var params = {
1414
// Only search for docks in the cluster security group
1515
{
1616
Name: 'instance.group-id',
17-
Values: ['sg-87ca04e3']
17+
Values: ['sg-577a0d33']
1818
},
1919
// Only fetch instances that are tagged as docks
2020
{

ansible/gamma-hosts/variables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ domain=runnable-gamma.com
5353
new_relic_license_key=338516e0826451c297d44dc60aeaf0a0ca4bfead
5454
node_env=production-gamma
5555
pg_host=gamma-infrastructure-db.cnksgdqarobf.us-west-2.rds.amazonaws.com
56-
pg_pass=QBjSpAXVYwmGHu4Y
56+
pg_pass=e9G7zYRCxYmxG9HQ8J9x2BDB
5757
rabbit_password=wKK7g7NWKpQXEeSzyWB7mIpxZIL8H2mDSf3Q6czR3Vk
5858
rabbit_username=o2mdLh9N9Ke2GzhoK8xsruYPhIQFN7iEL44dQJoq7OM
5959
registry_host=10.4.4.82

ansible/getVersions.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
consul=localhost:8500/v1
4+
5+
if [[ $1 != "" ]]; then
6+
consul=$1:8500/v1
7+
fi
8+
9+
kv=$consul/kv
10+
11+
echo NODE_ENV: $(curl -s $kv/node/env | jq -r '.[0].Value' | base64 -d)
12+
13+
echo image-builder: $(curl -s $kv/image-builder/version | jq -r '.[0].Value' | base64 -d)
14+
echo docker-listener: $(curl -s $kv/docker-listener/version | jq -r '.[0].Value' | base64 -d)
15+
echo filibuster: $(curl -s $kv/filibuster/version | jq -r '.[0].Value' | base64 -d)
16+
echo krain: $(curl -s $kv/krain/version | jq -r '.[0].Value' | base64 -d)
17+
echo sauron: $(curl -s $kv/sauron/version | jq -r '.[0].Value' | base64 -d)
18+
echo charon: $(curl -s $kv/charon/version | jq -r '.[0].Value' | base64 -d)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: consul
2+
3+
# for database role
4+
db_path: /etc/consul.d
5+
6+
# for container_kill_start
7+
pause_length_minutes: 3
8+
9+
container_image: progrium/consul
10+
container_tag: latest
11+
12+
container_run_opts: >
13+
-d
14+
-h {{ inventory_hostname }}
15+
-v /consul:/data
16+
-v /etc/consul.d:/etc/consul.d:ro
17+
-p {{ ansible_default_ipv4.address }}:8300:8300
18+
-p {{ ansible_default_ipv4.address }}:8301:8301
19+
-p {{ ansible_default_ipv4.address }}:8301:8301/udp
20+
-p {{ ansible_default_ipv4.address }}:8302:8302
21+
-p {{ ansible_default_ipv4.address }}:8302:8302/udp
22+
-p {{ ansible_default_ipv4.address }}:8400:8400
23+
-p {{ ansible_default_ipv4.address }}:8500:8500
24+
--restart=always
25+
26+
container_run_args: >
27+
-server
28+
-node {{ inventory_hostname }}
29+
-advertise {{ ansible_default_ipv4.address }}
30+
-config-dir /etc/consul.d
31+
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
32+
-data-dir /data
33+
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
34+
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] != ansible_default_ipv4.address %}-retry-join {{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}{% endif %}

ansible/group_vars/alpha-navi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ container_envs: >
2121
-e NODE_ENV={{ node_env }}
2222
-e REDIS_IPADDRESS={{redis_host}}
2323
-e LOG_LEVEL_STDOUT=trace
24+
-e CLUSTER_WORKERS=20
2425
2526
container_run_opts: "-d -p {{hosted_ports[0]}}:{{hosted_ports[0]}} {{container_envs}}"

ansible/group_vars/alpha-vault.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: vault
2+
3+
# for database role
4+
db_path: /opt/runnable/vault
5+
6+
container_image: runnable/vault
7+
container_tag: v0.3.1
8+
9+
container_run_opts: >
10+
-d
11+
-h {{ inventory_hostname }}
12+
-v /opt/runnable/vault/vault.hcl:/vault.hcl:ro
13+
-p {{ ansible_default_ipv4.address }}:8200:8200
14+
--cap-add IPC_LOCK
15+
--restart=always
16+
17+
container_run_args: >
18+
server
19+
-log-level=warn
20+
-config=/vault.hcl

0 commit comments

Comments
 (0)