Skip to content

Commit 8d15514

Browse files
author
Christopher M. Neill
committed
Merge branch 'master' into one-last-docker-log-fix
2 parents 3e63d43 + 510d6db commit 8d15514

8 files changed

Lines changed: 57 additions & 5 deletions

File tree

ansible/delta-hosts/variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ khronos_canary_logs_instance_id=56f07f5c1e089a200077f2a3
5050
khronos_canary_rebuild_instance_id=571b39b9d35173300021667d
5151
khronos_canary_rebuild_navi_url=http://canary-build-staging-runnabletest.runnableapp.com:8000/
5252
khronos_canary_token=24592325a6f881e77a01e3bacf0952c49f4e9f1c
53+
khronos_canary_failover_token=84549e76545306de61d47f23b1d1831e1c95a400
5354
khronos_mongo_auth=api:72192e5a-a5e1-11e5-add9-0270db32f7ad
5455
khronos_mongo_database=delta
5556
khronos_mongo_replset_name=delta

ansible/group_vars/alpha-khronos.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ canary_cron_queues: "\
2222
khronos:canary:network \
2323
khronos:metrics:container-status"
2424

25+
hourly_canary_cron_queues: "\
26+
khronos:canary:failover"
27+
2528
# a nice version of the rabbitmq host
2629
cron_rabbit_host_address: "{{ rabbit_host_address }}:{{ rabbit_port }}"
2730
# a quick version of authentication for rabbit for cron
@@ -33,6 +36,9 @@ container_envs: >
3336
-e API_URL={{ api_url }}
3437
-e CONSUL_HOST={{ consul_host_address }}:{{ consul_api_port }}
3538
-e CANARY_API_TOKEN={{ khronos_canary_token | default('undefined') }}
39+
{% if khronos_canary_failover_token is defined %}
40+
-e CANARY_API_FAILOVER_TOKEN={{ khronos_canary_failover_token }}
41+
{% endif %}
3642
-e CANARY_GITHUB_BRANCHES_INSTANCE_ID={{ khronos_canary_github_branches_instance_id | default('undefined') }}
3743
-e CANARY_LOG_INSTANCE_ID={{ khronos_canary_logs_instance_id | default('undefined') }}
3844
-e CANARY_LOG_TERMINAL_SLEEP=10
@@ -57,6 +63,7 @@ container_envs: >
5763
-e RABBITMQ_PORT={{ rabbit_port }}
5864
-e RABBITMQ_USERNAME={{ rabbit_username }}
5965
-e SWARM_HOST=http://{{ swarm_host_address }}:{{ swarm_master_port }}
66+
-e USER_CONTENT_DOMAIN={{ user_content_domain }}
6067
-e WORKER_MAX_RETRY_DELAY=3600000
6168
6269
container_run_opts: >

ansible/group_vars/alpha-palantiri.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: "palantiri"
33
container_image: "registry.runnable.com/runnable/{{ name }}"
44
container_tag: "{{ git_branch }}"
55
repo: "git@github.com:CodeNow/{{ name }}.git"
6-
node_version: "0.10.38"
7-
npm_version: "2.1.18"
6+
node_version: "4.2.2"
7+
npm_version: "2.14.7"
88

99
# container settings
1010
container_envs: >

ansible/roles/khronos/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
with_items:
99
- { cron_queues: "{{ main_cron_queues }}", script: "main-cron.sh"}
1010
- { cron_queues: "{{ canary_cron_queues }}", script: "canary-cron.sh"}
11+
- { cron_queues: "{{ hourly_canary_cron_queues }}", script: "hourly-canary-cron.sh"}
1112

1213
- name: Put Khronos script into crontab
1314
become: yes
@@ -27,6 +28,10 @@
2728
minute: "*/5"
2829
script: canary-cron.sh
2930
state: "{% if node_env == 'production-delta' %}present{% else %}absent{% endif %}"
31+
- name: Khronos CLI - Half-Hourly Canary
32+
minute: "*/30"
33+
script: hourly-canary-cron.sh
34+
state: "{% if node_env == 'production-delta' %}present{% else %}absent{% endif %}"
3035

3136
- name: make directory for mongo certificates
3237
become: yes

ansible/roles/vault/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
recurse=yes
2222

2323
- name: copy vault config
24+
tags: [ deploy ]
2425
become: true
2526
template:
2627
src=vault.hcl

ansible/roles/vault/templates/vault.hcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ listener "tcp" {
1919
tls_cert_file = "/opt/vault/server/cert.pem"
2020
tls_key_file = "/opt/vault/server/key.pem"
2121
}
22+
23+
max_lease_ttl = "8760h"

ansible/vault-values.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
return_content=yes
3131
register: mounts
3232

33-
- name: mount aws backend in vault
33+
- name: mount 1h aws backend in vault
3434
run_once: true
3535
when: write_values is defined and mounts.json['aws_1h/'] is not defined
3636
uri:
@@ -47,9 +47,26 @@
4747
default_lease_ttl: "3600s" # 1 hour, in seconds
4848
max_lease_ttl: "3600s" # 1 hour, in seconds
4949

50-
- name: configure aws root credentials
50+
- name: mount 1yr aws backend in vault
5151
run_once: true
52-
when: (write_values is defined and write_root_creds is defined) or (write_values is defined and mounts.json['aws/'] is not defined)
52+
when: write_values is defined and mounts.json['aws_1yr/'] is not defined
53+
uri:
54+
method=POST
55+
follow_redirects=all
56+
url=http://{{ ansible_default_ipv4.address }}:8200/v1/sys/mounts/aws_1yr
57+
HEADER_X-Vault-Token="{{ vault_auth_token }}"
58+
body_format=json
59+
body='{{ item | to_json }}'
60+
status_code=204
61+
with_items:
62+
- type: "aws"
63+
config:
64+
default_lease_ttl: "8760h" # 1 year, in hours
65+
max_lease_ttl: "8760h" # 1 year, in hours
66+
67+
- name: configure 1h aws root credentials
68+
run_once: true
69+
when: (write_values is defined and write_root_creds is defined) or (write_values is defined and mounts.json['aws_1h/'] is not defined)
5370
uri:
5471
method=POST
5572
follow_redirects=all
@@ -64,6 +81,23 @@
6481
secret_key: "{{ vault_aws_secret_key }}"
6582
region: "{{ vault_aws_region }}"
6683

84+
- name: configure 1yr aws root credentials
85+
run_once: true
86+
when: (write_values is defined and write_root_creds is defined) or (write_values is defined and mounts.json['aws_1yr/'] is not defined)
87+
uri:
88+
method=POST
89+
follow_redirects=all
90+
url=http://{{ ansible_default_ipv4.address }}:8200/v1/aws_1yr/config/root
91+
HEADER_X-Vault-Token="{{ vault_auth_token }}"
92+
body_format=json
93+
body='{{ item | to_json }}'
94+
status_code=204
95+
register: creds
96+
with_items:
97+
- access_key: "{{ vault_aws_access_key_id }}"
98+
secret_key: "{{ vault_aws_secret_key }}"
99+
region: "{{ vault_aws_region }}"
100+
67101
- name: check for the dock-init role
68102
run_once: true
69103
when: write_values is defined

ansible/vault.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
tasks:
1212
- name: get seal status
13+
tags: [ deploy ]
1314
uri:
1415
method=GET
1516
url=http://{{ ansible_default_ipv4.address }}:8200/v1/sys/seal-status
@@ -18,6 +19,7 @@
1819
register: seal_status
1920

2021
- name: unseal vault
22+
tags: [ deploy ]
2123
when: seal_status.json.sealed
2224
uri:
2325
method=PUT

0 commit comments

Comments
 (0)