Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cron schedule to monitor deployment playbook #161

Merged
merged 11 commits into from
Jul 26, 2019
Merged

Add cron schedule to monitor deployment playbook #161

merged 11 commits into from
Jul 26, 2019

Conversation

rzadp
Copy link
Contributor

@rzadp rzadp commented Jul 23, 2019

Tested by performing:

  • Deployed the monitor with MONITOR_CRON_SCHEDULE not-set
    • The tasks to set up cron are skipped, playbook finishes successfully
  • Deployed the monitor with MONITOR_CRON_SCHEDULE set
    • The cron job runs on schedule and runs the checks
  • Deployed the monitor with MONITOR_CRON_SCHEDULE set, then stopped the tokenbridge-monitor service
    • The cron job runs on schedule and skips checking

@rzadp rzadp changed the title [WIP] Monitor cron Add cron schedule to monitor deployment playbook Jul 23, 2019
@rzadp rzadp marked this pull request as ready for review July 23, 2019 13:37
---
- name: Parse cron schedule
set_fact:
minute: "{{ MONITOR_CRON_SCHEDULE.split(' ')[0] }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work when MONITOR_CRON_SCHEDULE is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If MONITOR_CRON_SCHEDULE is not set or invalid, task fails.
The playbook continues because ignore_errors: True.
The Add cron entry is then skipped because when: not set_fact_result.failed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always install cron for monitor (otherwise it just checks ones), and so add a default for MONITOR_CRON_SCHEDULE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I made the changes in the playbook and the docs, and also renamed MONITOR_CRON_SCHEDULE to monitor_cron_schedule to match style.

@rzadp rzadp added the deployment related to deployment playbooks/scripts/configs label Jul 24, 2019
Copy link
Collaborator

@akolotov akolotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge as soon as @phahulin or @ArseniiPetrovich approve. thanks!

@phahulin phahulin self-requested a review July 26, 2019 13:55
@rzadp rzadp merged commit 9c82597 into master Jul 26, 2019
@rzadp rzadp deleted the monitor-cron branch July 26, 2019 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment related to deployment playbooks/scripts/configs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cron schedule to monitor deployment playbook
3 participants