Stashing my work
This commit is contained in:
parent
8b7f8e4beb
commit
7f1fcdfea2
4
defaults/main.yml
Normal file
4
defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# vim:ft=ansible:
|
||||||
|
pleroma_home: /opt/pleroma
|
||||||
|
pleroma_enabled: yes
|
||||||
|
pleroma_name: default
|
8
handlers/main.yml
Normal file
8
handlers/main.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# vim:ft=ansible:
|
||||||
|
---
|
||||||
|
- name: "restart pleroma {{ pleroma_name }}"
|
||||||
|
systemd:
|
||||||
|
name: "pleroma@{{ pleroma_name }}"
|
||||||
|
state: restarted
|
||||||
|
become: yes
|
||||||
|
when: pleroma_enabled
|
14
tasks/main.yml
Normal file
14
tasks/main.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
# vim:ft=ansible:
|
||||||
|
---
|
||||||
|
- name: set up system
|
||||||
|
block:
|
||||||
|
- name: install packages
|
||||||
|
apt: name=curl,python3-psycopg2,unzip,libmagic-dev,ncurses-bin
|
||||||
|
- name: assure pleroma uesr
|
||||||
|
user: name=pleroma system=yes home={{ pleroma_home }}
|
||||||
|
- name: assure operational directory
|
||||||
|
file: path={{ pleroma_home }} state=directory owner=pleroma group=pleroma mode="3775"
|
||||||
|
- name: assure systemd unit
|
||||||
|
template: src=pleroma.service dest=/etc/systemd/system/pleroma@.service
|
||||||
|
notify: "restart pleroma {{ pleroma_name }}"
|
26
templates/pleroma.service
Normal file
26
templates/pleroma.service
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# vim:ft=systemd
|
||||||
|
[Unit]
|
||||||
|
Description=Pleroma social network %i
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=pleroma
|
||||||
|
Environment="HOME={{ pleroma_home }}/%i}"
|
||||||
|
WorkingDirectory={{ pleroma_home }}/%i
|
||||||
|
|
||||||
|
KillMode=process
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
ExecStart={{ pleroma_home }}/%i/bin/pleroma start
|
||||||
|
ExecStop={{ pleroma_home }}/%i/bin/pleroma stop
|
||||||
|
|
||||||
|
PrivateTmp=true
|
||||||
|
ProtectHome=true
|
||||||
|
ProtectSystem=full
|
||||||
|
PrivateDevice=false
|
||||||
|
NoNewPrivileges=true
|
||||||
|
CapabilityBoundingSet=~CAP_SYS_ADMIN
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue
Block a user