Skip to content

Commit 8155e3b

Browse files
committed
Revert consul-values. Change to use pip module.
1 parent 1829489 commit 8155e3b

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

ansible/consul-values.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
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 }}"

environments/delta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ ansible_ssh_private_key_file: ~/.ssh/delta.pem
161161
api_hello_runnable_github_token: 88ddc423c2312d02a8bbcaad76dd4c374a30e4af
162162
bastion_sshd_port: 60506
163163
builder: delta-builder
164+
consul_url: "{{ ansible_default_ipv4.address }}"
164165
consul_host_address: 10.8.6.122
165166
cream_stripe_publishable_key: pk_live_5yYYZlYIwY3LwvKFaXY0jNlm
166167
datadog_mongodb_pwd: sqa3WBgkCgZsFZuex0kBNahZ

environments/gamma/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ ansible_ssh_private_key_file: ~/.ssh/gamma.pem
143143
api_hello_runnable_github_token: 88ddc423c2312d02a8bbcaad76dd4c374a30e4af
144144
bastion_sshd_port: 60709
145145
builder: gamma-builder
146+
consul_url: "{{ ansible_default_ipv4.address }}"
146147
consul_host_address: 10.4.5.144
147148
cream_stripe_publishable_key: pk_test_sHr5tQaPtgwiE2cpW6dQkzi8
148149
datadog_mongodb_pwd: sqa3WBgkCgZsFZuex0kBNahZ

0 commit comments

Comments
 (0)