Skip to content

Commit 59bbde7

Browse files
author
Bryan Kendall
committed
consul_value role and division
1 parent 646e550 commit 59bbde7

15 files changed

Lines changed: 80 additions & 31 deletions

ansible/charon.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
- hosts: redis
3+
- hosts: consul
34

45
- hosts: docks
56
vars_files:
67
- "group_vars/alpha-charon.yml"
78
roles:
89
- { role: notify, tags: "notify" }
910
- { role: git_node_service, tags: "deploy" }
11+
- { role: consul_value, tags: [deploy, consul_value] }

ansible/docker-listener.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
22
- hosts: rabbitmq
33
- hosts: redis
4+
- hosts: consul
45

56
- hosts: docks
67
vars_files:
7-
- "group_vars/alpha-docker-listener.yml"
8+
- group_vars/alpha-docker-listener.yml
89
roles:
9-
- { role: notify, tags: "notify" }
10+
- { role: notify, tags: [notify] }
1011
- { role: build_essential }
1112
- { role: docker_client }
12-
- { role: git_node_service, tags: "deploy" }
13+
- { role: git_node_service, tags: [deploy] }
14+
- { role: consul_value, tags: [deploy, consul_value] }

ansible/filibuster.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
2+
- hosts: consul
3+
24
- hosts: docks
35
vars_files:
46
- "group_vars/alpha-filibuster.yml"
57
roles:
68
- { role: notify, tags: "notify" }
79
- { role: git_node_service, tags: "deploy" }
8-
10+
- { role: consul_value, tags: [deploy, consul_value] }

ansible/group_vars/all.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,7 @@ swarm_master_port: 2375
108108
navi_mongo_database: navi
109109
navi_mongo_host_address: "{{ hostvars[groups['mongo-navi'][0]]['ansible_default_ipv4']['address'] }}"
110110
navi_mongo_port: 27017
111+
112+
# consul
113+
consul_hostname: "{{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}"
114+
consul_port: 8500
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
name: "charon"
1+
name: charon
22
app_name: "{{ name }}"
3-
app_repo: "git@github.com:CodeNow/{{ name }}.git"
3+
app_repo: git@github.com:CodeNow/{{ name }}.git
44
hosted_ports: ["{{ charon_port }}"]
55

66
enviroment_vars:
77
API_HOST: "{{ api_hostname }}"
8-
API_TOKEN: "51c61b779f3de616a9639cfc44a22c79fbd8e328"
8+
API_TOKEN: 51c61b779f3de616a9639cfc44a22c79fbd8e328
99
DATADOG_HOST: "{{ datadog_host_address }}"
1010
DATADOG_PORT: "{{ datadog_port }}"
1111
DOMAIN_FILTER: "{{ user_content_domain }}"
1212
PORT: "{{ hosted_ports[0] }}"
1313
REDIS_HOST: "{{ redis_host_address }}"
1414
REDIS_PORT: "{{ redis_port }}"
15+
16+
# consul values
17+
consul_values:
18+
- key: "{{ name }}/version"
19+
value: "{{ git_branch }}"

ansible/group_vars/alpha-consul.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ container_run_args: >
3232
-config-dir /etc/consul.d
3333
-client 0.0.0.0
3434
-recursor 8.8.8.8
35-
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
35+
{% if consul_hostname == ansible_default_ipv4.address %}-bootstrap-expect {{ groups['consul'] | length }}{% endif %}
3636
-data-dir /data
37-
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
38-
{% if hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] != ansible_default_ipv4.address %}-retry-join {{ hostvars[groups['consul'][0]]['ansible_default_ipv4']['address'] }}{% endif %}
37+
{% if consul_hostname == ansible_default_ipv4.address %}-ui-dir /ui{% endif %}
38+
{% if consul_hostname != ansible_default_ipv4.address %}-retry-join {{ consul_hostname }}{% endif %}
3939
> /var/log/consul.log 2>&1
4040
4141
# some seed values
@@ -45,15 +45,3 @@ consul_seed:
4545
value: "{{ node_env }}"
4646
- key: api/hostname
4747
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
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: docker-listener
22

33
# upstart template variables
4-
app_name: "docker-listener"
5-
app_repo: "git@github.com:CodeNow/docker-listener.git"
4+
app_name: docker-listener
5+
app_repo: git@github.com:CodeNow/docker-listener.git
66

77
enviroment_vars:
88
LOGGLY_TOKEN: "{{ loggly_token }}"
@@ -12,3 +12,8 @@ enviroment_vars:
1212
RABBITMQ_USERNAME: "{{ rabbit_username }}"
1313
REDIS_IPADDRESS: "{{ redis_host_address }}"
1414
REDIS_PORT: "{{ redis_port }}"
15+
16+
# consul values
17+
consul_values:
18+
- key: "{{ name }}/version"
19+
value: "{{ git_branch }}"

ansible/group_vars/alpha-filibuster.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ app_name: "filibuster"
77
app_repo: "git@github.com:Runnable/Filibuster.git"
88
node_env: "{{ filibuster_env }}"
99

10-
enviroment_vars: {}
10+
enviroment_vars: {}
11+
12+
# consul values
13+
consul_values:
14+
- key: "{{ name }}/version"
15+
value: "{{ git_branch }}"
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
app_name: "image-builder"
1+
app_name: image-builder
22
name: "{{ app_name }}"
33
# namespace (can include "registry.runnable.com:")
44
image_builder_docker_namespace: runnable/image-builder
55

66
# we need to push this
77
do_not_push: false
8+
9+
# consul values
10+
consul_values:
11+
- key: "{{ name }}/version"
12+
value: "{{ git_branch }}"

ansible/group_vars/alpha-krain.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ name: krain
44
krain_env: default
55

66
# upstart template variables
7-
app_name: "krain"
8-
app_repo: "git@github.com:CodeNow/krain.git"
7+
app_name: krain
8+
app_repo: git@github.com:CodeNow/krain.git
99
node_env: "{{ krain_env }}"
1010

11-
enviroment_vars: {}
11+
enviroment_vars: {}
12+
13+
# consul values
14+
consul_values:
15+
- key: "{{ name }}/version"
16+
value: "{{ git_branch }}"

0 commit comments

Comments
 (0)