Merge branch 'statping' into 'newinfra'
Init statping role See merge request nounous/ansible!132certbot_on_virtu
commit
f3413d6a84
|
@ -88,3 +88,6 @@
|
|||
# Monitor logs with mtail
|
||||
#- hosts: thot.adm.crans.org
|
||||
# roles: ["mtail"]
|
||||
|
||||
- hosts: sputnik.adm.crans.org
|
||||
roles: ["statping"]
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Restart nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
|
||||
- name: Restart statping
|
||||
service:
|
||||
name: statping
|
||||
state: restarted
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- name: Install statping
|
||||
unarchive:
|
||||
src: https://github.com/statping/statping/releases/download/v0.90.74/statping-linux-amd64.tar.gz
|
||||
dest: /usr/local/bin/
|
||||
remote_src: yes
|
||||
|
||||
- name: Create statping user
|
||||
user:
|
||||
create_home: yes
|
||||
home: /var/lib/statping
|
||||
system: yes
|
||||
state: present
|
||||
password: "!"
|
||||
update_password: always
|
||||
name: statping
|
||||
|
||||
- name: Install statping systemd unit
|
||||
template:
|
||||
src: "systemd/system/statping.service.j2"
|
||||
dest: "/etc/systemd/system/statping.service"
|
||||
mode: 0644
|
||||
notify: Restart statping
|
||||
|
||||
- name: Load and activate statping systemd unit
|
||||
systemd:
|
||||
name: statping.service
|
||||
daemon_reload: true
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
- name: Indicate role in motd
|
||||
template:
|
||||
src: update-motd.d/05-service.j2
|
||||
dest: /etc/update-motd.d/05-statping
|
||||
mode: 0755
|
|
@ -0,0 +1,17 @@
|
|||
{{ ansible_header | comment }}
|
||||
|
||||
[Unit]
|
||||
Description=Statping Server
|
||||
After=network.target
|
||||
After=systemd-user-sessions.service
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=statping
|
||||
Restart=always
|
||||
ExecStart=/usr/local/bin/statping
|
||||
WorkingDirectory=/var/local/statping
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/tail +14
|
||||
{{ ansible_header | comment }}
|
||||
[0m> [38;5;82mStatping[0m a été déployé sur cette machine. Voir [38;5;6m/var/local/statping/[0m.
|
Loading…
Reference in New Issue