[ninjabot] Added NinjaBot role
parent
0b161f1f7a
commit
f1eb12bcab
|
@ -46,3 +46,8 @@
|
|||
ldap_grafana_passwd: "{{ vault_ldap_grafana_passwd }}"
|
||||
roles:
|
||||
- grafana
|
||||
|
||||
# Deploy NinjaBot
|
||||
- hosts: fyre.adm.crans.org
|
||||
roles:
|
||||
- ninjabot
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- name: Install python3 IRC library
|
||||
apt:
|
||||
name: python3-irc
|
||||
state: present
|
||||
update_cache: true
|
||||
register: apt_result
|
||||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
|
||||
- name: Install Flask for python3
|
||||
apt:
|
||||
name: python3-flask
|
||||
state: present
|
||||
update_cache: true
|
||||
register: apt_result
|
||||
retries: 3
|
||||
until: apt_result is succeeded
|
||||
|
||||
- name: Deploy NinjaBot main systemd unit
|
||||
template:
|
||||
src: systemd/system/ninjabot.service.j2
|
||||
dest: /etc/systemd/system/ninjabot.service
|
||||
mode: 0755
|
||||
|
||||
- name: Deploy NinjaBot webhook systemd unit
|
||||
template:
|
||||
src: systemd/system/ninjabot-webhook.service.j2
|
||||
dest: /etc/systemd/system/ninjabot-webhook.service
|
||||
mode: 0755
|
||||
|
||||
- name: Indicate NinjaBot in motd
|
||||
template:
|
||||
src: update-motd.d/60-ninjabot.j2
|
||||
dest: /etc/update-motd.d/60-ninjabot
|
||||
mode: 0755
|
|
@ -0,0 +1,15 @@
|
|||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=NinjaBot IRC bot
|
||||
After=network.target ninjabot.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/var/local/ninjabot
|
||||
User=ninjabot
|
||||
Group=nogroup
|
||||
ExecStart=/usr/bin/python3 /var/local/ninjabot/main.py
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,15 @@
|
|||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=NinjaBot IRC bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/var/local/ninjabot
|
||||
User=ninjabot
|
||||
Group=nogroup
|
||||
ExecStart=/usr/bin/python3 /var/local/ninjabot/ninjabot.py
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
# {{ ansible_managed }}
|
||||
echo "> NinjaBot a été déployé sur cette machine."
|
||||
echo " Voir /var/local/ninjabot"
|
Loading…
Reference in New Issue