google_spell_pspell: Initial version of role
This commit is contained in:
parent
f08c478bf6
commit
80b7a7c97f
5 changed files with 105 additions and 11 deletions
|
@ -1,13 +1,14 @@
|
||||||
# Ports used by container web services
|
# Ports used by container web services
|
||||||
|
|
||||||
| Port | Ansible role | Service name |
|
| Port | Ansible role | Service name |
|
||||||
|------|----------------|------------------------|
|
|------|---------------------|----------------------------|
|
||||||
| 8001 | kerberos_kdc | Kerberos KDC |
|
| 8001 | kerberos_kdc | Kerberos KDC |
|
||||||
| 8002 | grafana | Grafana |
|
| 8002 | grafana | Grafana |
|
||||||
| 8003 | authcheck | Authentication check |
|
| 8003 | authcheck | Authentication check |
|
||||||
| 8004 | roundcube | Roundcube webmail |
|
| 8004 | roundcube | Roundcube webmail |
|
||||||
| 8005 | php4dvd | php4dvd movie catalog |
|
| 8005 | php4dvd | php4dvd movie catalog |
|
||||||
| 8006 | scanservjs | SANE Scanner webui |
|
| 8006 | scanservjs | SANE Scanner webui |
|
||||||
| 8007 | frigate | Network video recorder |
|
| 8007 | frigate | Network video recorder |
|
||||||
| 8008 | hoemeassistant | Home Assistant |
|
| 8008 | hoemeassistant | Home Assistant |
|
||||||
| 8009 | rocketchat | Rocket.Chat |
|
| 8009 | rocketchat | Rocket.Chat |
|
||||||
|
| 8010 | google-spell-pspell | Google Spell Check XML API |
|
||||||
|
|
|
@ -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
|
18
roles/google_spell_pspell/handlers/main.yml
Normal file
18
roles/google_spell_pspell/handlers/main.yml
Normal 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
|
5
roles/google_spell_pspell/meta/main.yml
Normal file
5
roles/google_spell_pspell/meta/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- {role: git}
|
||||||
|
- {role: nginx}
|
||||||
|
- {role: podman}
|
54
roles/google_spell_pspell/tasks/main.yml
Normal file
54
roles/google_spell_pspell/tasks/main.yml
Normal 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
|
Loading…
Add table
Reference in a new issue