76 lines
1.8 KiB
YAML

# tasks file for stats script
- name: Template virtualhost
template:
src: virtualhost.j2
dest: /etc/sentinel/virtualhost
mode: "0444"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Template token ipinfo
template:
src: token.j2
dest: /etc/sentinel/token
mode: "0555"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Copy getinfo script
copy:
src: "getinfo_{{ item }}.sh"
dest: "/usr/local/bin/sentinel/getinfo_{{ item }}.sh"
mode: "0555"
with_items:
- day
- week
- month
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Crontab get info day
ansible.builtin.cron:
name: "get info day"
cron_file: "get_info_day_cron"
minute: "0"
hour: "3"
user: root
job: "bash /usr/local/bin/sentinel/getinfo_day.sh"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Crontab get info week
ansible.builtin.cron:
name: "get info week"
cron_file: "get_info_week_cron"
minute: "15"
hour: "3"
weekday: "1"
user: root
job: "bash /usr/local/bin/sentinel/getinfo_week.sh"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
- name: Crontab get info month
ansible.builtin.cron:
name: "get info month"
cron_file: "get_info_month_cron"
minute: "30"
hour: "3"
day: "1"
user: root
job: "bash /usr/local/bin/sentinel/getinfo_month.sh"
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"