Init
This commit is contained in:
commit
5ad5d96e07
2 changed files with 53 additions and 0 deletions
35
tasks/main.yml
Normal file
35
tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
- apt:
|
||||
name: python3
|
||||
state: present
|
||||
|
||||
- apt:
|
||||
name: python3-dev
|
||||
state: present
|
||||
|
||||
- apt:
|
||||
name: setuptools
|
||||
state: present
|
||||
|
||||
- apt:
|
||||
name: python3-pip
|
||||
state: present
|
||||
|
||||
- pip:
|
||||
name: psutil
|
||||
|
||||
- pip:
|
||||
name: statsd
|
||||
|
||||
- git:
|
||||
repo: 'https://git.keks.cloud/kekskurse/monitoring.py.git'
|
||||
dest: /opt/monitoring.py
|
||||
update: no
|
||||
|
||||
- template:
|
||||
src: monitoringpy.service.j2
|
||||
dest: /etc/systemd/system/monitoringpy.service
|
||||
|
||||
- systemd:
|
||||
state: started
|
||||
enabled: yes
|
||||
name: monitoringpy.service
|
18
templates/monitoringpy.service.j2
Normal file
18
templates/monitoringpy.service.j2
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Montiroing.py
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
WorkingDirectory=/opt/monitoring.py/
|
||||
ExecStart=/opt/monitoring.py/run.py
|
||||
SyslogIdentifier=monitoringpy
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue