commit 5ad5d96e075185cdb49d6bc352e1a9105419602f Author: Kekskurse Date: Mon Dec 30 17:07:31 2019 +0100 Init diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..4c82141 --- /dev/null +++ b/tasks/main.yml @@ -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 diff --git a/templates/monitoringpy.service.j2 b/templates/monitoringpy.service.j2 new file mode 100644 index 0000000..5251bcd --- /dev/null +++ b/templates/monitoringpy.service.j2 @@ -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