File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -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
You can’t perform that action at this time.
0 commit comments