-
Notifications
You must be signed in to change notification settings - Fork 2
/
git-cron.yml
37 lines (34 loc) · 942 Bytes
/
git-cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: Update once a month request csv
hosts: prometheus
become: true
tasks:
- name: Create Group
ansible.builtin.group:
name: "reqcsv"
state: present
system: true
- name: Create User
ansible.builtin.user:
name: "reqcsv"
group: "reqcsv"
create_home: true
system: true
state: present
shell: "/bin/bash"
# shell: "/usr/sbin/nologin"
- name: Copy systemd service
ansible.builtin.template:
src: files/templates/query_monthly.sh.j2
dest: /home/reqcsv/query_monthly.sh
owner: reqcsv
group: reqcsv
mode: '0644'
- name: Create cronjob
become: true
ansible.builtin.cron:
name: requests-csv-update
cron_file: "reqcsv"
user: reqcsv
job: "/usr/bin/bash /home/reqcsv/query_monthly.sh >> /home/reqcsv/logs.txt 2>&1"
special_time: daily