Skip to content

Commit ec27821

Browse files
author
Ryan Sandor Richards
committed
Merge branch 'prune-ssh-config' of github.com:CodeNow/devops-scripts into prune-ssh-config
2 parents 1aa81bc + 5a1cc11 commit ec27821

11 files changed

Lines changed: 72 additions & 31 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ erl_crash.dump
77
npm-debug.log
88
ca.srl
99
.DS_Store
10+
ansible/roles/hipache/templates/runnable*

ansible/delta-hosts/variables

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[api_group:vars]
2-
api_aws_access_key_id=AKIAIDC4WVMTCGV7KRVQ
3-
api_aws_secret_access_key=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
4-
api_github_client_id=b6072dc57062faca7fcb
5-
api_github_client_secret=ba73a9294dc4bfaa7ed02ba187f73918506e4293
2+
api_aws_access_key_id=AKIAJWSSSJYUXKNW2ZDA
3+
api_aws_secret_access_key=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
4+
api_github_client_id=d42d6634d4070c9d9bf9
5+
api_github_client_secret=d6cfde38fef5723e25e52629e3d25825c8a704c9
66
api_github_deploy_keys_bucket=runnable.deploykeys.production
7-
api_mixpanel_app_id=c41affa4b08818443365c526cbb51606
7+
api_mixpanel_app_id=57260a5b6fc972e9c69184882efd009e
88
api_mongo_auth=api:72192e5a-a5e1-11e5-add9-0270db32f7ad
99
api_mongo_database=delta
1010
api_mongo_replset_name=delta-rs0
@@ -17,27 +17,27 @@ api_s3_context_bucket=runnable.context.resources.production
1717
docker_config=docks
1818

1919
[eru:vars]
20-
eru_github_id=8abb08f83f6d1c52bd1a
21-
eru_github_secret=74a23ee56486d57b14f292283cb04625f600917c
20+
eru_github_id=46a23f5f99f0aa9460f8
21+
eru_github_secret=a0336d72e3d540fb9fbbed2c123a81e1cb329dab
2222

2323
[khronos:vars]
2424
khronos_mongo_auth=api:oW4c7x9Wiv28oiNBy2Bc
2525
khronos_mongo_database=delta
2626
khronos_mongo_replset_name=delta
2727

2828
[optimus:vars]
29-
optimus_aws_access_id=AKIAJPA2ZYSVVA5V7XXQ
30-
optimus_aws_secret_id=5V70AUxfIyHeLvlYZe0xaYevDAdgTOWOn5G7nHlt
29+
optimus_aws_access_id=AKIAJWSSSJYUXKNW2ZDA
30+
optimus_aws_secret_id=tyvGiCbj5jWCiQnMLvfrfD64dFo8i6prkdcga86y
3131
optimus_github_deploy_keys_bucket=runnable.deploykeys.production
3232

3333
[palantiri:vars]
3434
palantiri_rollbar_key=f675e9090d6f483ca4e742af2c7f2f83
3535

3636
[registry:vars]
37-
registry_s3_access_key=AKIAJK5EN7W6E62A3C3Q
37+
registry_s3_access_key=AKIAJKCSFJCHFDITLBUQ
3838
registry_s3_bucket=runnableimages.alpha
39-
registry_s3_secret_key=ZFLePZdrHUNhTzuV4Ir/NgwPWOnU41Ur9DbH6UAp
40-
registry_s3_region=us-east-1
39+
registry_s3_secret_key=LXxpb4F7Kxum1HvYkG0P20Yb/9Qpr+e5Gtt/0bIY
40+
registry_s3_region=us-west-2
4141

4242
[shiva:vars]
4343
aws_access_key_id=AKIAJ3RCYU6FCULAJP2Q
@@ -56,9 +56,10 @@ vault_aws_region=us-east-1
5656

5757
[delta:vars]
5858
ansible_ssh_private_key_file=~/.ssh/delta.pem
59+
api_hello_runnable_github_token=88ddc423c2312d02a8bbcaad76dd4c374a30e4af
5960
datadog_host_address=10.8.5.63
6061
datadog_tags=env:delta
61-
domain=runnable-delta.com
62+
domain=runnable.io
6263
mongo_port=27017
6364
new_relic_license_key=338516e0826451c297d44dc60aeaf0a0ca4bfead
6465
node_env=production-delta
@@ -67,9 +68,7 @@ pg_pass=59a5524e-a772-11e5-bedc-1bdc0db458b3
6768
rabbit_password=wKK7g7NWKpQXEeSzyWB7mIpxZIL8H2mDSf3Q6czR3Vk
6869
rabbit_username=o2mdLh9N9Ke2GzhoK8xsruYPhIQFN7iEL44dQJoq7OM
6970
registry_host=10.8.4.126
70-
swarm_token=d363b783f03a845a2c82b081bfe8443e
7171
user_content_domain=runnableapp.com
72-
api_hello_runnable_github_token=88ddc423c2312d02a8bbcaad76dd4c374a30e4af
7372

7473
[ec2:vars]
7574
aws_custid=437258487404

ansible/group_vars/all.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,24 @@ docker_cert_path: /etc/ssl/docker/cert.pem
6565
docker_key_path: /etc/ssl/docker/key.pem
6666
docker_port: 4242
6767

68+
# ec2
69+
aws_access_key: "AKIAIB3IJCCJZQWQMVSQ"
70+
aws_secret_key: "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"
71+
6872
# eru
6973
eru_port: 57831
7074
eru_hostname: admin.{{ domain }}
7175

76+
# filibuster
77+
filibuster_port: 3112
78+
7279
# fluffy
7380
fluffy_port: 80
7481
fluffy_hostname: "fluffy.{{ domain }}"
7582

83+
# krain
84+
krain_port: 3100
85+
7686
# mavis
7787
mavis_hostname: mavis.{{ domain }}
7888
mavis_port: 3000
@@ -115,11 +125,3 @@ swarm_container_name: swarm
115125
navi_mongo_database: navi
116126
navi_mongo_host_address: "{{ hostvars[groups['mongo-navi'][0]]['ansible_default_ipv4']['address'] }}"
117127
navi_mongo_port: 27017
118-
119-
# consul
120-
consul_hostname: "{{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}"
121-
consul_port: 8500
122-
123-
# ec2
124-
aws_access_key: "AKIAIB3IJCCJZQWQMVSQ"
125-
aws_secret_key: "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"

ansible/group_vars/alpha-api.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ container_envs: >
2424
-e DATADOG_HOST={{ datadog_host_address }}
2525
-e DATADOG_PORT={{ datadog_port }}
2626
-e DOMAIN={{ domain }}
27+
-e FILIBUSTER_PORT={{ filibuster_port }}
2728
-e GITHUB_CALLBACK_URL=https://{{ api_hostname }}/auth/github/callback
2829
-e GITHUB_CLIENT_ID={{ api_github_client_id }}
2930
-e GITHUB_CLIENT_SECRET={{ api_github_client_secret }}
3031
-e GITHUB_DEPLOY_KEYS_BUCKET={{ api_github_deploy_keys_bucket }}
3132
-e GITHUB_HOOK_URL=https://{{ api_hostname }}/actions/github
3233
-e HELLO_RUNNABLE_GITHUB_TOKEN={{ api_hello_runnable_github_token }}
34+
-e KRAIN_PORT={{ krain_port }}
3335
-e MAVIS_HOST=http://{{ mavis_hostname }}:80
3436
-e MIXPANEL_APP_ID={{ api_mixpanel_app_id }}
3537
-e MONGO=mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}
@@ -52,8 +54,8 @@ container_envs: >
5254
-e ROLLBAR_KEY={{ api_rollbar_key }}
5355
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
5456
-e SENDGRID_KEY={{ sendgrid_key }}
55-
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
5657
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
58+
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
5759
5860
container_run_opts: >
5961
-h {{ name }}

ansible/group_vars/alpha-consul.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ container_run_args: >
3131
-config-dir /etc/consul.d
3232
-client 0.0.0.0
3333
-recursor 8.8.8.8
34-
{% if consul_hostname == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
34+
{% if consul_host_address == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
3535
-data-dir /data
36-
{% if consul_hostname == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
37-
{% if consul_hostname != ansible_default_ipv4.address %}-retry-join {{ consul_hostname }}{% endif %}
36+
{% if consul_host_address == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
37+
{% if consul_host_address != ansible_default_ipv4.address %}-retry-join {{ consul_host_address }}{% endif %}
3838
> /var/log/consul.log 2>&1
3939
4040
# some seed values

ansible/group_vars/alpha-hipache.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ container_image: registry.runnable.com/runnable/hipache
55
container_tag: latest
66
hosted_ports: [ 80, 443 ]
77

8+
log_driver: json-file
9+
810
container_run_opts: >
911
-d
1012
-p 80:80

ansible/group_vars/alpha-registry.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ container_image: "registry"
55
container_tag: "2.1.1"
66
hosted_ports: ["80"]
77

8+
log_driver: json-file
9+
810
container_envs: >
911
-e REGISTRY_STORAGE_S3_ACCESSKEY={{ registry_s3_access_key }}
1012
-e REGISTRY_STORAGE_S3_SECRETKEY={{ registry_s3_secret_key }}

ansible/group_vars/alpha-workers.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ container_envs: >
1717
-e DATADOG_HOST={{ datadog_host_address }}
1818
-e DATADOG_PORT={{ datadog_port }}
1919
-e DOMAIN={{ domain }}
20+
-e FILIBUSTER_PORT={{ filibuster_port }}
2021
-e GITHUB_CALLBACK_URL=https://{{ api_hostname }}/auth/github/callback
2122
-e GITHUB_CLIENT_ID={{ api_github_client_id }}
2223
-e GITHUB_CLIENT_SECRET={{ api_github_client_secret }}
2324
-e GITHUB_DEPLOY_KEYS_BUCKET={{ api_github_deploy_keys_bucket }}
2425
-e GITHUB_HOOK_URL=https://{{ api_hostname }}/actions/github
2526
-e HELLO_RUNNABLE_GITHUB_TOKEN={{ api_hello_runnable_github_token }}
2627
-e IS_QUEUE_WORKER=true
28+
-e KRAIN_PORT={{ krain_port }}
2729
-e MAVIS_HOST=http://{{ mavis_hostname }}:80
2830
-e MIXPANEL_APP_ID={{ api_mixpanel_app_id }}
2931
-e MONGO=mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}
@@ -44,8 +46,8 @@ container_envs: >
4446
-e REDIS_PORT={{ redis_port }}
4547
-e ROLLBAR_KEY={{ api_rollbar_key }}
4648
-e S3_CONTEXT_RESOURCE_BUCKET={{ api_s3_context_bucket }}
47-
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
4849
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
50+
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
4951
5052
container_run_opts: >
5153
-h {{ name }}

ansible/roles/consul_value/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
- name: put values into consul
1212
run_once: true
13-
when: consul_hostname is defined and consul_port is defined and consul_values is defined
13+
when: consul_host_address is defined and consul_api_port is defined and consul_values is defined
1414
uri:
1515
method=PUT
16-
url=http://{{ consul_hostname }}:{{ consul_port }}/v1/kv/{{ item.key }}
16+
url=http://{{ consul_host_address }}:{{ consul_api_port }}/v1/kv/{{ item.key }}
1717
body="{{ item.value }}"
1818
with_items: "{{ consul_values }}"

ansible/roles/hipache/tasks/main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
---
2+
- name: create certs path
3+
sudo: yes
4+
file:
5+
path=/etc/ssl/certs/{{ domain }}
6+
state=directory
7+
8+
- name: create private cert path
9+
sudo: yes
10+
file:
11+
path=/etc/ssl/private
12+
state=directory
13+
14+
# the keys below must be placed inside devops-scripts/ansible/roles/hipache/files
15+
- name: copy ca.crt
16+
sudo: yes
17+
template:
18+
src={{ domain }}-ca.crt
19+
dest=/etc/ssl/certs/ca.crt
20+
21+
- name: copy {{ domain }}.crt
22+
sudo: yes
23+
template:
24+
src={{ domain }}.crt
25+
dest=/etc/ssl/certs/{ domain }}.crt
26+
27+
- name: copy private ssl key
28+
sudo: yes
29+
template:
30+
src={{ domain }}.key
31+
dest=/etc/ssl/private/{{ domain }}.key
32+
233
- name: create hipache config directory
334
sudo: yes
435
file:

0 commit comments

Comments
 (0)