Skip to content

Commit 1f4c21a

Browse files
merge with master
2 parents a6558ed + 94a9eef commit 1f4c21a

22 files changed

Lines changed: 360 additions & 73 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,6 @@ It is the custom at Runnable to play a song to the entire team when deploying. F
9999

100100
[swarm-deamon: Pink Floyd - Another Brick In The Wall](https://www.youtube.com/watch?v=5IpYOF4Hi6Q)
101101

102+
[vault / vault-values: Seal - Kiss From A Rose](https://www.youtube.com/watch?v=zP3so2hY4CM)
103+
102104
**IMPORTANT:** Make sure the play the song loud and proud when deploying!

ansible/beta-hosts/hosts

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ beta-services
3737
[navi]
3838
beta-navi
3939

40+
[link]
41+
beta-navi
42+
43+
[mongo-navi]
44+
beta-navi
45+
4046
[charon]
4147
beta-services
4248

@@ -82,25 +88,27 @@ beta-services
8288
[docks]
8389

8490
[beta:children]
85-
bastion
86-
hipache
87-
mongodb
8891
api
89-
web
90-
redis
91-
redis-slave
92-
docks
93-
registry
94-
neo4j
95-
navi
92+
bastion
9693
charon
94+
docks
95+
eru
96+
hipache
9797
khronos
98+
link
9899
mavis
100+
mongodb
101+
mongo-navi
102+
navi
103+
neo4j
99104
optimus
100105
rabbitmq
101-
eru
106+
redis
107+
redis-slave
108+
registry
102109
shiva
103110
swarm-manager
111+
web
104112

105113
[targets]
106114
localhost ansible_connection=local bastion_name=beta-bastion

ansible/consul-values.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
---
2-
- hosts: "{{ target }}"
2+
- hosts: consul
3+
vars_files:
4+
- "group_vars/alpha-consul.yml"
35
tasks:
4-
- name: make sure `jq` is present
5-
apt:
6-
name=jq
7-
state=present
6+
- name: make sure httplib2 is installed
7+
sudo: yes
8+
apt: package=python-httplib2 state=present
89

9-
- name: get versions in ansible
10-
script: getVersions {{ ansible_default_ipv4.address }}
11-
register: versions_result
10+
- name: put values into consul
11+
run_once: true
12+
when: write_values is defined
13+
uri:
14+
method=PUT
15+
url=http://{{ ansible_default_ipv4.address }}:8500/v1/kv/{{ item.key }}
16+
body="{{ item.value }}"
17+
with_items: "{{ consul_seed }}"
1218

13-
- name: print versions to stdout
14-
debug:
15-
msg="Versions in Consul\n{{ versions_result.stdout }}"
19+
- name: get values from consul
20+
run_once: true
21+
when: read_values is defined
22+
uri:
23+
method=GET
24+
url=http://{{ ansible_default_ipv4.address }}:8500/v1/kv/{{ item.key }}
25+
with_items: "{{ consul_seed }}"
26+
register: values
27+
28+
- name: print values to screen
29+
run_once: true
30+
when: read_values is defined
31+
debug: msg='{{ item.item.key }}: {{ item.json[0].Value | b64decode }}'
32+
with_items: "{{ values.results }}"

ansible/gamma-hosts/hosts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ api
2020
[api]
2121
gamma-api
2222

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

ansible/gamma-hosts/variables

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,25 @@ palantiri_rollbar_key=f675e9090d6f483ca4e742af2c7f2f83
3636

3737
[registry:vars]
3838
registry_s3_access_key=AKIAJZQHOFYKTZP52XCQ
39-
registry_s3_bucket=runnableimages.gamma
39+
registry_s3_bucket=runnableimages.beta
4040
registry_s3_secret_key=iOKNwff7HhUnTmHxt1HrJj1lUkrccZTqWvrKi54C
41-
registry_s3_region=us-west-2
41+
registry_s3_region=us-east-1
4242

4343
[shiva:vars]
4444
aws_access_key_id=AKIAJ3RCYU6FCULAJP2Q
4545
aws_secret_access_key=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
4646
shiva_rollbar_key=0526a90faec845d796e1ef5361a00526
4747

48+
[vault:vars]
49+
vault_auth_token=e22c3ebc-11cf-653b-7df0-79d78a499458
50+
vault_token_01=71d7b4754686013c8b9cfb22bafae79c661849dcd67c483c89efba12c0466aa201
51+
vault_token_02=794d6f7a3459c332a1fd2bbcc9230a7f84f1639806039ee8be547828cd7ab03a02
52+
vault_token_03=2e67faeffe4343c038d0f3210bdb83f3d3a5bc468975cf13e977ce9b5922aefe03
53+
vault_hello_runnable_github_token=88ddc423c2312d02a8bbcaad76dd4c374a30e4af
54+
vault_aws_access_key_id=AKIAJ7R4UIM45KH2WGWQ
55+
vault_aws_secret_key=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
56+
vault_aws_region=us-east-1
57+
4858
[gamma:vars]
4959
ansible_ssh_private_key_file=~/.ssh/gamma.pem
5060
datadog_host_address=10.4.6.251

ansible/group_vars/all.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,8 @@ shiva_port: 3000
108108
# swarm
109109
swarm_master_port: 2375
110110
swarm_host_address: "{{ hostvars[groups['swarm-manager'][0]]['ansible_default_ipv4']['address'] }}"
111+
112+
# navi/link
113+
navi_mongo_database: navi
114+
navi_mongo_host_address: "{{ hostvars[groups['mongo-navi'][0]]['ansible_default_ipv4']['address'] }}"
115+
navi_mongo_port: 27017

ansible/group_vars/alpha-consul.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ db_path: /etc/consul.d
66
# for container_kill_start
77
pause_length_minutes: 3
88

9-
container_image: progrium/consul
10-
container_tag: latest
9+
container_image: runnable/consul
10+
container_tag: v0.5.2
1111

1212
container_run_opts: >
1313
-d
1414
-h {{ inventory_hostname }}
1515
-v /consul:/data
1616
-v /etc/consul.d:/etc/consul.d:ro
17+
-v /var/log:/var/log
1718
-p {{ ansible_default_ipv4.address }}:8300:8300
1819
-p {{ ansible_default_ipv4.address }}:8301:8301
1920
-p {{ ansible_default_ipv4.address }}:8301:8301/udp
@@ -24,11 +25,35 @@ container_run_opts: >
2425
--restart=always
2526
2627
container_run_args: >
28+
consul agent
2729
-server
2830
-node {{ inventory_hostname }}
2931
-advertise {{ ansible_default_ipv4.address }}
3032
-config-dir /etc/consul.d
33+
-client 0.0.0.0
34+
-recursor 8.8.8.8
3135
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
3236
-data-dir /data
3337
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
3438
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] != ansible_default_ipv4.address %}-retry-join {{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}{% endif %}
39+
> /var/log/consul.log 2>&1
40+
41+
# some seed values
42+
# pulled 2015/16/11 - Bryan
43+
consul_seed:
44+
- key: node/env
45+
value: "{{ node_env }}"
46+
- key: api/hostname
47+
value: "{{ api_hostname }}"
48+
- key: image-builder/version
49+
value: d1.6.2-v4.0.0
50+
- key: docker-listener/version
51+
value: v1.0.0
52+
- key: filibuster/version
53+
value: v0.1.6
54+
- key: krain/version
55+
value: v0.1.0
56+
- key: sauron/version
57+
value: v2.0.3
58+
- key: charon/version
59+
value: v2.0.2

ansible/group_vars/alpha-eru.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: eru
33
container_image: registry.runnable.com/runnable/{{ name }}
44
container_tag: "{{ git_branch }}"
55
repo: git@github.com:CodeNow/{{ name }}.git
6-
hosted_ports: [{{ eru_port }}]
6+
hosted_ports: ["{{ eru_port }}"]
77
node_version: "0.12.0"
88
npm_version: "2.1.18"
99

ansible/group_vars/alpha-link.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: link
2+
3+
container_image: registry.runnable.com/runnable/{{ name }}
4+
container_tag: "{{ git_branch }}"
5+
repo: git@github.com:CodeNow/{{ name }}.git
6+
node_version: "4.2.1"
7+
npm_version: "2.14.7"
8+
9+
container_envs: >
10+
-e API_HOST=http://{{ api_hostname }}
11+
-e DATADOG_HOST={{ datadog_host_address }}
12+
-e DATADOG_PORT={{ datadog_port }}
13+
-e HELLO_RUNNABLE_GITHUB_TOKEN=5d8f7029d3d6941b0fc62a7eb8c605d8e0bc7c29
14+
-e MONGO=mongodb://{{ navi_mongo_host_address }}:{{ navi_mongo_port }}/{{ navi_mongo_database }}
15+
-e NODE_ENV={{ node_env }}
16+
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
17+
-e RABBITMQ_PASSWORD={{ rabbit_password }}
18+
-e RABBITMQ_PORT={{ rabbit_port }}
19+
-e RABBITMQ_USERNAME={{ rabbit_username }}
20+
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
21+
22+
container_run_opts: >
23+
-h {{ name }}
24+
-d
25+
{{ container_envs }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# database vars
2+
name: mongo-navi
3+
4+
db_path: /opt/mongodb/db
5+
6+
# container_kill_start settings
7+
container_image: mongo
8+
container_tag: latest
9+
container_run_opts: >
10+
-h {{ name }}
11+
-d
12+
-p 27017:27017
13+
-v {{ db_path }}:/data/db:rw

0 commit comments

Comments
 (0)