File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : rabbitmq
3+ - hosts : redis
4+
5+ - hosts : vault
6+ roles :
7+ - { role: consul-services }
Original file line number Diff line number Diff line change 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 }}"
Original file line number Diff line number Diff line change 2020[api]
2121gamma-api
2222
23+ [consul]
24+ gamma-services
25+ gamma-api
26+ gamma-web
27+
28+ [vault]
29+ gamma-services
30+
2331[worker]
2432gamma-api
2533
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ palantiri_rollbar_key=f675e9090d6f483ca4e742af2c7f2f83
3636
3737[registry:vars]
3838registry_s3_access_key=AKIAJZQHOFYKTZP52XCQ
39- registry_s3_bucket=runnableimages.gamma
39+ registry_s3_bucket=runnableimages.beta
4040registry_s3_secret_key=iOKNwff7HhUnTmHxt1HrJj1lUkrccZTqWvrKi54C
41- registry_s3_region=us-west-2
41+ registry_s3_region=us-east-1
4242
4343[shiva:vars]
4444aws_access_key_id=AKIAJ3RCYU6FCULAJP2Q
Original file line number Diff line number Diff line change 11---
22# registry settings
33registry_env : " prod"
4+ registry_port : 80
45
56# for docker stop old container
67stop_time : 5
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ container_envs: >
3131 -e MIXPANEL_APP_ID={{ api_mixpanel_app_id }}
3232 -e MONGO=mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}
3333 -e MONGO_REPLSET_NAME={{ api_mongo_replset_name }}
34- -e NAVI_HOST=http://{{ navi_host_addressname }}:{{ navi_port }}
34+ -e NAVI_HOST=http://{{ navi_host_address }}:{{ navi_port }}
3535 -e NEO4J={{ api_neo4j_protocol }}{{ api_neo4j_auth }}@{{ neo4j_host_address }}:{{ api_neo4j_port }}
3636 -e NEW_RELIC_APP_NAME={{ api_new_relic_app_name }}
3737 -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }}
Original file line number Diff line number Diff line change @@ -32,3 +32,23 @@ container_run_args: >
3232 -data-dir /data
3333 {% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
3434 {% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] != ansible_default_ipv4.address %}-retry-join {{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}{% endif %}
35+
36+ # some seed values
37+ # pulled 2015/16/11 - Bryan
38+ consul_seed :
39+ - key : node/env
40+ value : " {{ node_env }}"
41+ - key : api/hostname
42+ value : " {{ api_hostname }}"
43+ - key : image-builder/version
44+ value : d1.6.2-v4.0.0
45+ - key : docker-listener/version
46+ value : v1.0.0
47+ - key : filibuster/version
48+ value : v0.1.6
49+ - key : krain/version
50+ value : v0.1.0
51+ - key : sauron/version
52+ value : v2.0.3
53+ - key : charon/version
54+ value : v2.0.2
Original file line number Diff line number Diff line change @@ -34,4 +34,4 @@ container_run_opts: >
3434 -h {{ name }}
3535 -d
3636 -P
37- {{ container_envs }}"
37+ {{ container_envs }}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ container_envs: >
2828 -e MIXPANEL_APP_ID={{ api_mixpanel_app_id }}
2929 -e MONGO=mongodb://{{ api_mongo_auth }}@{{ mongo_hosts }}/{{ api_mongo_database }}
3030 -e MONGO_REPLSET_NAME={{ api_mongo_replset_name }}
31- -e NAVI_HOST=http://{{ navi_host_addressname }}:{{ navi_port }}
31+ -e NAVI_HOST=http://{{ navi_host_address }}:{{ navi_port }}
3232 -e NEO4J={{ api_neo4j_protocol }}{{ api_neo4j_auth }}@{{ neo4j_host_address }}:{{ api_neo4j_port }}
3333 -e NEW_RELIC_APP_NAME={{ api_new_relic_app_name }}
3434 -e NEW_RELIC_LICENSE_KEY={{ new_relic_license_key }}
Original file line number Diff line number Diff line change 1+ ---
2+ - name : make /etc/consul.d folder
3+ sudo : yes
4+ file :
5+ path=/etc/consul.d
6+ state=directory
7+
8+ - name : remove all current configs
9+ sudo : yes
10+ shell : rm -f /etc/consul.d/*.json
11+
12+ - name : put service files in place
13+ sudo : yes
14+ template :
15+ dest=/etc/consul.d/{{ item.name }}.json
16+ src=service.json
17+ with_items :
18+ - name : ' datadog'
19+ host_address : ' {{ datadog_host_address }}'
20+ tags : ['master']
21+ port : ' {{ datadog_port }}'
22+ - name : ' rabbitmq'
23+ host_address : ' {{ rabbit_host_address }}'
24+ tags : ['master']
25+ port : ' {{ rabbit_port }}'
26+ - name : ' redis'
27+ host_address : ' {{ redis_host_address }}'
28+ tags : ['master']
29+ port : ' {{ redis_port }}'
30+ - name : ' registry'
31+ host_address : ' {{ registry_host }}'
32+ tags : ['master']
33+ port : ' {{ registry_port }}'
34+
35+ - name : send consul SIGUP to reload services
36+ sudo : yes
37+ shell : pkill --signal SIGHUP consul
You can’t perform that action at this time.
0 commit comments