File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22- hosts : consul
33 vars_files :
44 - " group_vars/alpha-consul.yml"
5- - " group_vars/alpha-consul-values.yml"
6- roles :
7- - role : k8-job
5+ tasks :
6+ - name : make sure httplib2 is installed
7+ become : true
8+ pip :
9+ name : httplib2
10+ executable : pip
11+
12+ - name : put values into consul
13+ run_once : true
14+ when : write_values is defined
15+ uri :
16+ method=PUT
17+ url={{ consul_url }}/v1/kv/{{ item.key }}
18+ body="{{ item.value }}"
19+ with_items : " {{ consul_seed }}"
20+
21+ - name : get values from consul
22+ tags : consul_values
23+ run_once : true
24+ when : read_values is defined
25+ uri :
26+ method=GET
27+ url={{ consul_url }}/v1/kv/{{ item.key }}
28+ with_items : " {{ consul_seed }}"
29+ register : values
30+
31+ - name : print values to screen
32+ tags : consul_values
33+ run_once : true
34+ when : read_values is defined
35+ debug : msg="{{ item.item.key }}" -> "{{ item.json[0].Value | b64decode }}"
36+ with_items : " {{ values.results }}"
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ ansible_ssh_private_key_file: ~/.ssh/delta.pem
161161api_hello_runnable_github_token : 88ddc423c2312d02a8bbcaad76dd4c374a30e4af
162162bastion_sshd_port : 60506
163163builder : delta-builder
164+ consul_url : " {{ ansible_default_ipv4.address }}"
164165consul_host_address : 10.8.6.122
165166cream_stripe_publishable_key : pk_live_5yYYZlYIwY3LwvKFaXY0jNlm
166167datadog_mongodb_pwd : sqa3WBgkCgZsFZuex0kBNahZ
Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ ansible_ssh_private_key_file: ~/.ssh/gamma.pem
143143api_hello_runnable_github_token : 88ddc423c2312d02a8bbcaad76dd4c374a30e4af
144144bastion_sshd_port : 60709
145145builder : gamma-builder
146+ consul_url : " {{ ansible_default_ipv4.address }}"
146147consul_host_address : 10.4.5.144
147148cream_stripe_publishable_key : pk_test_sHr5tQaPtgwiE2cpW6dQkzi8
148149datadog_mongodb_pwd : sqa3WBgkCgZsFZuex0kBNahZ
You can’t perform that action at this time.
0 commit comments