libvirt_cloud/roles/toxcore/tasks/hourly.yml

59 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2023-12-30 12:52:24 +00:00
# -*- mode: yaml; indent-tabs-mode: nil; tab-width: 2; coding: utf-8-unix -*-
---
- name: "toxcore hourly.yml"
debug:
msg: "toxcore hourly.yml ansible_virtualization_role {{ansible_virtualization_role|replace('NA', 'host')}}"
# these should test on the host
- block:
- name: check ifconfig
# was toxcore_bin.bash
shell: |
echo WARN: this maybe vagrant only
ifconfig eth0 | grep 'inet ' || \
ifconfig eth0 netmask 255.255.255.0 192.168.122.22
when:
- false # this is vagrant only
- "ansible_virtualization_role|replace('NA', 'host') != 'host'"
2023-12-30 22:09:49 +00:00
2023-12-30 12:52:24 +00:00
- name: check guest-agent
# was toxcore_bin.bash
shell: |
UNIT=qemu-guest-agent
S=/etc/init.d/$UNIT
2024-01-04 14:53:42 +00:00
$S status || {
2023-12-30 12:52:24 +00:00
retval=$?
echo WARN: $UNIT not running
exit 0 # $retval
}
exit 0
2023-12-30 22:09:49 +00:00
2023-12-30 12:52:24 +00:00
when: "ansible_virtualization_role|replace('NA', 'host') != 'host'"
- name: run toxcore_check_modules.bash
# was toxcore_bin.bash
shell: |
bash toxcore_check_modules.bash {{TOXCORE_FEATURES|join(' ')}}
args:
chdir: "{{ TOXCORE_VAR_LOCAL }}/bin"
environment: "{{ shell_proxy_env }}"
register: toxcore_log_bin
notify: summary of logs
# FixMe?
ignore_errors: true
- name: "run toxcore_hourly.bash"
environment: "{{ shell_proxy_env }}"
shell: |
umask 0027
echo "INFO: toxcore_log_hourly {{HARDEN_LOG_DIR}}"
cd {{VAR_LOCAL}}/bin
toxcore_hourly.bash
register: toxcore_log_hourly
notify: summary of logs
ignore_errors: true
when:
- not ansible_check_mode
- false