google_spell_pspell: Initial version of role

This commit is contained in:
Timo Makinen 2024-04-13 20:20:58 +00:00
parent f08c478bf6
commit 80b7a7c97f
5 changed files with 105 additions and 11 deletions

View file

@ -1,13 +1,14 @@
# Ports used by container web services
| Port | Ansible role | Service name |
|------|----------------|------------------------|
| 8001 | kerberos_kdc | Kerberos KDC |
| 8002 | grafana | Grafana |
| 8003 | authcheck | Authentication check |
| 8004 | roundcube | Roundcube webmail |
| 8005 | php4dvd | php4dvd movie catalog |
| 8006 | scanservjs | SANE Scanner webui |
| 8007 | frigate | Network video recorder |
| 8008 | hoemeassistant | Home Assistant |
| 8009 | rocketchat | Rocket.Chat |
| Port | Ansible role | Service name |
|------|---------------------|----------------------------|
| 8001 | kerberos_kdc | Kerberos KDC |
| 8002 | grafana | Grafana |
| 8003 | authcheck | Authentication check |
| 8004 | roundcube | Roundcube webmail |
| 8005 | php4dvd | php4dvd movie catalog |
| 8006 | scanservjs | SANE Scanner webui |
| 8007 | frigate | Network video recorder |
| 8008 | hoemeassistant | Home Assistant |
| 8009 | rocketchat | Rocket.Chat |
| 8010 | google-spell-pspell | Google Spell Check XML API |

View file

@ -0,0 +1,16 @@
[Unit]
Description=google-spell-pspell Container
Wants=network-online.target
After=network-online.target
[Service]
User=pspell
ExecStart=/usr/bin/podman run \
--rm -p 127.0.0.1:8010:80 \
--name google-spell-pspell \
google-spell-pspell:latest
ExecStop=/usr/bin/podman stop --ignore google-spell-pspell
ExecStopPost=/usr/bin/podman rm -f --ignore google-spell-pspell
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,18 @@
---
- name: Rebuild google-spell-pspell-container
ansible.builtin.command:
argv:
- podman
- build
- -t
- google-spell-pspell
- /usr/local/src/docker-google-spell-pspell
become: true
become_user: pspell
notify: Restart google-spell-pspell-container
- name: Restart google-spell-pspell-container
ansible.builtin.service:
name: google-spell-pspell-container
daemon_reload: true
state: restarted

View file

@ -0,0 +1,5 @@
---
dependencies:
- {role: git}
- {role: nginx}
- {role: podman}

View file

@ -0,0 +1,54 @@
---
- name: Create group
ansible.builtin.group:
name: pspell
- name: Create user
ansible.builtin.user:
name: pspell
comment: Podman google-spell-pspell
group: pspell
shell: /sbin/nologin
- name: Enable user lingering
ansible.builtin.command:
argv:
- loginctl
- enable-linger
- pspell
creates: /var/lib/systemd/linger/pspell
- name: Get container source
ansible.builtin.git:
dest: /usr/local/src/docker-google-spell-pspell
repo: https://github.com/foo-sh/docker-google-spell-pspell.git
update: true
version: main
notify: Rebuild google-spell-pspell-container
- name: Create service file
ansible.builtin.copy:
dest: /etc/systemd/system/google-spell-pspell-container.service
src: google-spell-pspell-container.service
mode: "0644"
owner: root
group: "{{ ansible_wheel }}"
notify: Restart google-spell-pspell-container
- name: Enable service
ansible.builtin.service:
name: google-spell-pspell-container
state: started
enabled: true
- name: Copy nginx config
ansible.builtin.copy:
dest: "/etc/nginx/conf.d/{{ inventory_hostname }}/google-spell-pspell.conf"
content: |
location /tbproxy/spell {
proxy_pass http://127.0.0.1:8010/;
}
mode: "0644"
owner: root
group: "{{ ansible_wheel }}"
notify: Restart nginx