r/formsubmit: Deploy formsubmit app

*formsubmit* is a simple, customizable HTML for submission handler.  I
designed it for Tabitha to use to collect information from forms on her
websites.  Notably, we will use it for the RSVP page on our wedding
invitation site.
collectd-buildroot
Dustin 2022-02-27 17:42:15 -06:00
parent 3632698f37
commit b350698148
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,10 @@
[Unit]
Description=HTML Form Submit Handler
After=network.target
[Service]
ExecStart=/usr/local/formsubmit/bin/uvicorn formsubmit:app
User=apache
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,8 @@
- name: reload systemd
systemd:
daemon_reload: true
- name: restart formsubmit
service:
name: formsubmit
state: restarted

View File

@ -0,0 +1,39 @@
- name: ensure latest formsubmit is installed # noqa package-latest
environment:
PIP_FIND_LINKS: http://files.pyrocufflink.blue/wheels/formsubmit
PIP_TRUSTED_HOST: files.pyrocufflink.blue
pip:
name: formsubmit
virtualenv: /usr/local/formsubmit
virtualenv_command: python3.9 -m venv
state: latest
notify:
- restart formsubmit
tags:
- install
- name: ensure formsubmit deployment dependencies are installed
pip:
name:
- uvicorn
virtualenv: /usr/local/formsubmit
state: present
tags:
- install
- name: ensure formsubmit systemd unit is installed
copy:
src: formsubmit.service
dest: /etc/systemd/system/formsubmit.service
mode: u=rw,go=r
notify:
- reload systemd
- restart formsubmit
tags:
- systemd
- name: ensure formsubmit configuration directory exists
file:
path: /etc/formsubmit
mode: u=rwx,go=rx
state: directory

View File

@ -3,6 +3,8 @@
apache_default_ssl_vhost: false
roles:
- apache
- role: formsubmit
tags: formsubmit
- role: websites/pyrocufflink.net
tags: websites/pyrocufflink.net
- role: websites/dustin.hatch.name