-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
57 lines (49 loc) · 1.27 KB
/
playbook.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- name: "Server setup"
hosts: server
become: yes
tasks:
- name: Import variables
include_vars: ./ansible/var.yaml
- name: Ping
ansible.builtin.ping:
- name: Install openJDK
yum:
name: java-11-openjdk-devel
state: present
- name: Install Python
yum:
name:
- python3-devel
- libselinux-python
- gcc
state: present
- name: Synchronize app
synchronize:
src: ./
dest: "{{ DEST_PATH }}"
delete: yes
recursive: true
rsync_opts:
- "--exclude=.git"
- "--exclude=*.pyc"
- name: Install specified python requirements
pip:
executable: pip3
requirements: "{{ DEST_PATH }}/requirements.txt"
state: present
- name: CPU cron
ansible.builtin.cron:
name: "Get CPU"
minute: "*/15"
job: "python3 {{ CPU_SCRIPT_PATH }} {{ CPU_CSV_PATH }}"
- name: RAM cron
ansible.builtin.cron:
name: "Get RAM"
minute: "*/15"
job: "python3 {{ MEM_SCRIPT_PATH }} {{ MEM_CSV_PATH }}"
- name: DISK cron
ansible.builtin.cron:
name: "Get DISK"
minute: "*/15"
job: "python3 {{ DISK_SCRIPT_PATH }} {{ DISK_CSV_PATH }} "