-
Notifications
You must be signed in to change notification settings - Fork 0
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
Comment out monitoring cron if unused. #119
Conversation
35ee374
to
e1bfc9c
Compare
|
2b73634
to
1308243
Compare
playbooks/roles/cron/tasks/el.yml
Outdated
@@ -35,15 +35,15 @@ | |||
- name: Create a commented Slurm monitoring cron file under /etc/cron.d | |||
cron: | |||
name: slurm monitoring | |||
minute: "*" | |||
minute: "#*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this will only add a single #?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a better way to add a disabled cron job: https://stackoverflow.com/questions/52324616/does-ansible-support-comment-cron-job#:~:text=If%20you%20want%20to%20comment,to%20change%20disabled%20to%20no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find! I like it.
I switched to using the built in ansible disabled.
playbooks/roles/cron/tasks/el.yml
Outdated
@@ -35,15 +35,15 @@ | |||
- name: Create a commented Slurm monitoring cron file under /etc/cron.d | |||
cron: | |||
name: slurm monitoring | |||
minute: "*" | |||
minute: "#*" | |||
user: '{{ ansible_user }}' | |||
job: "#source /opt/oci-hpc/monitoring/env; /opt/oci-hpc/monitoring/monitor_slurm.sh >> /opt/oci-hpc/monitoring/monitor_slurm_`date '+\\%Y\\%m\\%d'`.log 2>&1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're adding a # before the minute then you can remove # from the beginning of this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched everything to disabled: true
playbooks/roles/cron/tasks/el.yml
Outdated
user: '{{ ansible_user }}' | ||
job: "#source /opt/oci-hpc/monitoring/env; /opt/oci-hpc/monitoring/monitor_slurm.sh >> /opt/oci-hpc/monitoring/monitor_slurm_`date '+\\%Y\\%m\\%d'`.log 2>&1" | ||
when: not autoscaling_monitoring | bool | ||
|
||
- name: Create a commented OCI monitoring cron file under /etc/cron.d | ||
cron: | ||
name: OCI monitoring | ||
minute: "*" | ||
minute: "#*" | ||
user: '{{ ansible_user }}' | ||
job: "#source /opt/oci-hpc/monitoring/env; /opt/oci-hpc/monitoring/monitor_oci.sh >> /opt/oci-hpc/monitoring/monitor_oci_`date '+\\%Y\\%m\\%d'`.log 2>&1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Remove the leading #.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Twitter needs the hashtags bro!
fixed it @andriy-safe-ai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Bug in cron tab setup. Does not properly comment out the lines.