home-server/roles/privatebin/tasks/main.yml

65 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
# The home-server project produces a multi-purpose setup using Ansible.
# Copyright © 20182023 Y. Gablin, under the GPL-3.0-or-later license.
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
### UPSTREAM BEGIN ⇒ ###
- name: pull prerequisites from upstream
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=upstream.yml
vars:
msg: privatebin
### ⇐ UPSTREAM BEGIN ###
- name: install AUR software
include_role:
name: aur.inc
allow_duplicates: true
vars:
packages:
- privatebin
aur_user: git
### UPSTREAM END ⇒ ###
- name: merge upstream
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=merge.yml
vars:
msg: privatebin
### ⇐ UPSTREAM END ###
- name: configure privatebin
template:
src: templates/conf.php.j2
dest: /etc/webapps/privatebin/conf.php
group: http
mode: 0640
- name: create the data directory
file:
path: /var/lib/privatebin
state: directory
owner: http
group: http
mode: 0770
- name: configure nginx for privatebin
copy:
content: |
location {{http_pfx_privatebin}} {
alias /usr/share/webapps/privatebin;
rewrite ^({{http_pfx_privatebin}})(/.*?\.php)(/.*)?$ /php...$document_root/...$1/...$2/...$3 last;
}
dest: /etc/nginx/inc.d/privatebin.http.inc
mode: 0440
owner: http
group: http
notify:
- restart openresty.service
### LOCAL COMMIT ⇒ ###
- name: commit local changes
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=local.yml
vars:
msg: privatebin
### ⇐ LOCAL COMMIT ###
- meta: flush_handlers