Skip to content

Commit 4cc3115

Browse files
Merge pull request #487 from CodeNow/SAN-3868-Failover-Canary
Create hourly canary script for Failover
2 parents 67af7a5 + f888ba6 commit 4cc3115

3 files changed

Lines changed: 13 additions & 0 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/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 - Hourly Canary
32+
minute: "*/50"
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

0 commit comments

Comments
 (0)