2023-02-12 18:38:38 +01:00
|
|
|
# tasks file for stats script
|
|
|
|
|
|
|
|
- name: Create sentinel directory
|
|
|
|
file:
|
|
|
|
state: directory
|
2023-02-12 19:15:48 +01:00
|
|
|
path: "{{ item }}/sentinel"
|
2023-02-12 18:38:38 +01:00
|
|
|
with_items:
|
2023-02-12 19:15:48 +01:00
|
|
|
- /usr/local/bin
|
|
|
|
- /etc
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Template virtualhost
|
|
|
|
template:
|
|
|
|
src: virtualhost.j2
|
|
|
|
dest: /etc/sentinel/virtualhost
|
|
|
|
mode: "0755"
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Template getinfo day script
|
|
|
|
template:
|
|
|
|
src: getinfo_day.sh.j2
|
|
|
|
dest: /usr/local/bin/sentinel/getinfo_day.sh
|
|
|
|
mode: "0755"
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Template getinfo month and week script
|
2023-02-12 18:38:38 +01:00
|
|
|
copy:
|
2023-02-12 19:15:48 +01:00
|
|
|
src: "getinfo_{{ item }}.sh.j2"
|
|
|
|
dest: "/usr/local/bin/sentinel/getinfo_{{ item }}.sh"
|
|
|
|
mode: "0755"
|
|
|
|
with_items:
|
|
|
|
- week
|
|
|
|
- month
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Crontab get info day
|
|
|
|
ansible.builtin.cron:
|
|
|
|
name: "get info day"
|
|
|
|
minute: "0"
|
|
|
|
hour: "3"
|
|
|
|
job: "bash /usr/local/bin/sentinel/getinfo_day.sh"
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Crontab get info week
|
|
|
|
ansible.builtin.cron:
|
|
|
|
name: "get info week"
|
|
|
|
minute: "15"
|
|
|
|
hour: "3"
|
|
|
|
weekday: "1"
|
|
|
|
job: "bash /usr/local/bin/sentinel/getinfo_week.sh"
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|
2023-02-12 19:15:48 +01:00
|
|
|
- name: Crontab get info month
|
|
|
|
ansible.builtin.cron:
|
|
|
|
name: "get info mongth"
|
|
|
|
minute: "30"
|
|
|
|
hour: "3"
|
|
|
|
day: "1"
|
|
|
|
job: "bash /usr/local/bin/sentinel/getinfo_month.sh"
|
2023-02-12 18:38:38 +01:00
|
|
|
vars:
|
|
|
|
ansible_become: yes
|
|
|
|
ansible_become_method: sudo
|
|
|
|
ansible_become_password: "{{ sudo_password }}"
|
|
|
|
|