Compare commits
9 commits
ldap-van-r
...
main
Author | SHA1 | Date | |
---|---|---|---|
1d8e07bf04 | |||
3a0071abfa | |||
4f6025849f | |||
1b04d0f5c3 | |||
b9be1729b3 | |||
2f9ca22e90 | |||
e65ffd5dc7 | |||
a5930bb1aa | |||
eb0a724309 |
12 changed files with 42 additions and 108 deletions
|
@ -58,6 +58,7 @@
|
||||||
|
|
||||||
- hosts: services
|
- hosts: services
|
||||||
roles:
|
roles:
|
||||||
|
- { role: "deb_forgejo", tags: [ "deb_forgejo" ] }
|
||||||
- { role: "services", tags: ["services"] }
|
- { role: "services", tags: ["services"] }
|
||||||
|
|
||||||
- hosts: wiki
|
- hosts: wiki
|
||||||
|
|
|
@ -37,5 +37,7 @@ debian_repourl: "http://deb.debian.org/debian/"
|
||||||
debian_securityurl: "http://security.debian.org/debian-security"
|
debian_securityurl: "http://security.debian.org/debian-security"
|
||||||
|
|
||||||
deb_forgejo_repos:
|
deb_forgejo_repos:
|
||||||
|
- host: git.bitlair.nl
|
||||||
|
owner: bitlair
|
||||||
- host: git.polyfloyd.net
|
- host: git.polyfloyd.net
|
||||||
owner: polyfloyd
|
owner: polyfloyd
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
bank_user: bank
|
bank_user: bank
|
||||||
bank_revbank_git: https://git.bitlair.nl/bitlair/revbank.git
|
|
||||||
bank_local_tty: no
|
bank_local_tty: no
|
||||||
|
bank_revbank_version: "10.3.0"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
name: bank
|
name: bank
|
||||||
password: $6$idklol$QrOE/21LDR0vhZBAXwgA7AvnmR6Ju4ZqzAzgeazC08i2yw9kyQjgwu.uuV692iL/cyE7AteDYUxCpcorONXom. # "bank"
|
password: $6$idklol$QrOE/21LDR0vhZBAXwgA7AvnmR6Ju4ZqzAzgeazC08i2yw9kyQjgwu.uuV692iL/cyE7AteDYUxCpcorONXom. # "bank"
|
||||||
home: /home/{{ bank_user }}
|
home: /home/{{ bank_user }}
|
||||||
shell: /home/{{ bank_user }}/revbank.git/revbank
|
shell: /usr/local/share/revbank/revbank
|
||||||
update_password: always
|
update_password: always
|
||||||
|
|
||||||
- name: Allow password auth for bank user
|
- name: Allow password auth for bank user
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
insertafter: EOF
|
insertafter: EOF
|
||||||
validate: "/usr/sbin/sshd -t -f %s"
|
validate: "/usr/sbin/sshd -t -f %s"
|
||||||
block: |-
|
block: |-
|
||||||
Match User bank
|
Match User {{ bank_user }}
|
||||||
PasswordAuthentication yes
|
PasswordAuthentication yes
|
||||||
notify: reload sshd
|
notify: reload sshd
|
||||||
|
|
||||||
|
|
|
@ -1,50 +1,22 @@
|
||||||
---
|
---
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: [ git, libterm-readline-gnu-perl, libcurses-ui-perl, qrencode ]
|
name: [ git, libterm-readline-gnu-perl, libcurses-ui-perl ]
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Clone revbank source
|
- name: Clone revbank source
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "{{ bank_revbank_git }}"
|
repo: https://github.com/revspace/revbank.git
|
||||||
version: master
|
version: "v{{ bank_revbank_version }}"
|
||||||
dest: /home/{{ bank_user }}/revbank.git
|
dest: /usr/local/share/revbank
|
||||||
accept_hostkey: yes
|
accept_hostkey: yes
|
||||||
|
|
||||||
- name: Create data files
|
- name: Clone revbank-plugin source
|
||||||
ansible.builtin.command: cp /home/{{ bank_user }}/revbank.git/{{ item }} /home/{{ bank_user }}/{{ item }}
|
ansible.builtin.git:
|
||||||
args:
|
repo: https://git.bitlair.nl/bitlair/revbank-plugins.git
|
||||||
creates: /home/{{ bank_user }}/{{ item }}
|
version: main
|
||||||
with_items:
|
dest: /usr/local/share/revbank-plugins
|
||||||
- revbank.accounts
|
accept_hostkey: yes
|
||||||
- revbank.market
|
|
||||||
- revbank.products
|
|
||||||
|
|
||||||
- name: Ensure data file permissions
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /home/{{ bank_user }}/{{ item }}
|
|
||||||
state: touch
|
|
||||||
owner: "{{ bank_user }}"
|
|
||||||
group: "{{ bank_user }}"
|
|
||||||
mode: 0644
|
|
||||||
with_items:
|
|
||||||
- revbank.accounts
|
|
||||||
- revbank.market
|
|
||||||
- revbank.products
|
|
||||||
|
|
||||||
- name: Link plugins
|
|
||||||
ansible.builtin.file:
|
|
||||||
state: link
|
|
||||||
path: /home/{{ bank_user }}/{{ item }}
|
|
||||||
src: /home/{{ bank_user }}/revbank.git/{{ item }}
|
|
||||||
with_items:
|
|
||||||
- plugins
|
|
||||||
- revbank.plugins
|
|
||||||
|
|
||||||
- name: Create git data dir
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /home/{{ bank_user }}/data.git
|
|
||||||
state: directory
|
|
||||||
|
|
||||||
- name: Install git cronjob
|
- name: Install git cronjob
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
|
|
||||||
#m h dom mon dow user command
|
#m h dom mon dow user command
|
||||||
*/10 * * * * {{ bank_user }} (cd /home/{{ bank_user }}/data.git && git pull -r && git push && git gc --auto && cp revbank.products ../revbank.products)
|
*/10 * * * * {{ bank_user }} git -C ~/.revbank pull -r && git -C ~/.revbank push
|
||||||
|
|
|
@ -3,30 +3,36 @@
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name:
|
name:
|
||||||
- python3-paho-mqtt
|
- openscad
|
||||||
- python3-tz
|
|
||||||
- virtualenv
|
- virtualenv
|
||||||
|
|
||||||
- name: Create virtualenv
|
- name: Create virtualenv
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: virtualenv /opt/miflora_exporter/.venv
|
cmd: virtualenv /var/lib/discord-bot/.venv
|
||||||
args:
|
args:
|
||||||
creates: /var/lib/discord-bot/.venv
|
creates: /var/lib/discord-bot/.venv
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Clone bottleclip source
|
||||||
ansible.builtin.shell:
|
ansible.builtin.git:
|
||||||
cmd: . .venv/bin/activate && pip install -r requirements.txt
|
repo: https://git.bitlair.nl/bitlair/bottle-clip.git
|
||||||
args:
|
version: main
|
||||||
chdir: /var/lib/discord-bot
|
dest: /var/lib/bottle-clip
|
||||||
|
accept_hostkey: yes
|
||||||
|
notify: Restart discord-bot
|
||||||
|
|
||||||
- name: Clone source
|
- name: Clone discord-bot source
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: https://git.bitlair.nl/bitlair/discord-bot.git
|
repo: https://git.bitlair.nl/bitlair/discord-bot.git
|
||||||
version: main
|
version: main
|
||||||
dest: /var/lib/discord-bot
|
dest: /var/lib/discord-bot
|
||||||
accept_hostkey: yes
|
accept_hostkey: yes
|
||||||
notify: Restart discord-bot
|
notify: Restart discord-bot
|
||||||
ignore_errors: true
|
|
||||||
|
- name: Install Python dependencies
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: . .venv/bin/activate && pip install -r requirements.txt
|
||||||
|
args:
|
||||||
|
chdir: /var/lib/discord-bot
|
||||||
|
|
||||||
- name: Install service file
|
- name: Install service file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
---
|
---
|
||||||
# TODO: Install and build
|
- name: Install siahsd
|
||||||
|
apt:
|
||||||
|
name: siahsd
|
||||||
|
|
||||||
- name: Create directories
|
- name: Create directories
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: /var/log/siahsd
|
||||||
state: directory
|
state: directory
|
||||||
owner: siahsd
|
owner: siahsd
|
||||||
group: nogroup
|
group: nogroup
|
||||||
mode: "0750"
|
mode: "0750"
|
||||||
with_items:
|
|
||||||
- /var/log/siahsd
|
|
||||||
- /var/lib/siahsd
|
|
||||||
|
|
||||||
- name: Install config file
|
- name: Install config file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@ -21,19 +20,9 @@
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
notify: Restart siahsd
|
notify: Restart siahsd
|
||||||
|
|
||||||
- name: Install service file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: siahsd.service
|
|
||||||
dest: /etc/systemd/system/siahsd.service
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "0644"
|
|
||||||
notify: Restart siahsd
|
|
||||||
|
|
||||||
- name: Start siahsd
|
- name: Start siahsd
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: siahsd
|
name: siahsd
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=HobbyBot
|
Description=HobbyBot
|
||||||
|
@ -13,6 +13,7 @@ DynamicUser=true
|
||||||
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||||
Environment="DISCORD_WEBHOOK_URL={{ lookup('passwordstore', 'services/discord', subkey='webhook_url') }}"
|
Environment="DISCORD_WEBHOOK_URL={{ lookup('passwordstore', 'services/discord', subkey='webhook_url') }}"
|
||||||
Environment="DISCORD_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='token') }}"
|
Environment="DISCORD_TOKEN={{ lookup('passwordstore', 'services/discord', subkey='token') }}"
|
||||||
|
Environment="BOTTLECLIP_RESOURCES=/var/lib/bottle-clip"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
[siahsd]
|
[siahsd]
|
||||||
pid file = /var/lib/siahsd/siahsd.pid
|
pid file = /var/lib/siahsd/siahsd.pid
|
||||||
log file = /var/log/siahsd/siahsd.log
|
log file = /var/log/siahsd/siahsd.log
|
||||||
|
@ -5,13 +7,6 @@ log level = 3
|
||||||
foreground = 0
|
foreground = 0
|
||||||
event handlers = script
|
event handlers = script
|
||||||
|
|
||||||
#[database]
|
|
||||||
#driver = mysql
|
|
||||||
#host = localhost
|
|
||||||
#name = siahsd
|
|
||||||
#username = siahsd
|
|
||||||
#password = MysbJxAaawmwKPqD
|
|
||||||
|
|
||||||
[siahs]
|
[siahs]
|
||||||
port = 4000
|
port = 4000
|
||||||
|
|
||||||
|
@ -19,21 +14,5 @@ port = 4000
|
||||||
port = 9000
|
port = 9000
|
||||||
rsa key file = something.sexp
|
rsa key file = something.sexp
|
||||||
|
|
||||||
#[jsonbot]
|
|
||||||
#address = 192.168.88.15
|
|
||||||
#port = 5500
|
|
||||||
#aes key = blablablablablaz
|
|
||||||
#password = mekker
|
|
||||||
#privmsg to = #bitlair
|
|
||||||
|
|
||||||
#[spacestate]
|
|
||||||
#driver = mysql
|
|
||||||
#host = localhost
|
|
||||||
#name = bitwifi
|
|
||||||
#username = bitwifi
|
|
||||||
#password = aGWERQpLEQPUaXJV
|
|
||||||
#open script = /opt/alarm/disarmed.sh
|
|
||||||
#close script = /opt/alarm/armed.sh
|
|
||||||
|
|
||||||
[script]
|
[script]
|
||||||
path = /opt/alarm/siahsd_handler.sh
|
path = /opt/alarm/siahsd_handler.sh
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Managed by Ansible
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=Siahsd
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=forking
|
|
||||||
PIDFile=/var/lib/siahsd/siahsd.pid
|
|
||||||
Restart=always
|
|
||||||
RestartSec=10s
|
|
||||||
ExecStartPre=-/bin/rm /var/lib/siahsd/siahsd.pid
|
|
||||||
ExecStart=/usr/local/src/siahsd/build/siahsd
|
|
||||||
User=siahsd
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -3,4 +3,5 @@
|
||||||
- hosts: services
|
- hosts: services
|
||||||
roles:
|
roles:
|
||||||
- { role: "common", tags: [ "common" ] }
|
- { role: "common", tags: [ "common" ] }
|
||||||
|
- { role: "deb_forgejo", tags: [ "deb_forgejo" ] }
|
||||||
- { role: "services", tags: [ "services" ] }
|
- { role: "services", tags: [ "services" ] }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue