diff --git a/container-ports.md b/container-ports.md index 63429e3..39a8bec 100644 --- a/container-ports.md +++ b/container-ports.md @@ -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 | diff --git a/roles/google_spell_pspell/files/google-spell-pspell-container.service b/roles/google_spell_pspell/files/google-spell-pspell-container.service new file mode 100644 index 0000000..705ff29 --- /dev/null +++ b/roles/google_spell_pspell/files/google-spell-pspell-container.service @@ -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 diff --git a/roles/google_spell_pspell/handlers/main.yml b/roles/google_spell_pspell/handlers/main.yml new file mode 100644 index 0000000..c6f29db --- /dev/null +++ b/roles/google_spell_pspell/handlers/main.yml @@ -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 diff --git a/roles/google_spell_pspell/meta/main.yml b/roles/google_spell_pspell/meta/main.yml new file mode 100644 index 0000000..b8e2a3e --- /dev/null +++ b/roles/google_spell_pspell/meta/main.yml @@ -0,0 +1,5 @@ +--- +dependencies: + - {role: git} + - {role: nginx} + - {role: podman} diff --git a/roles/google_spell_pspell/tasks/main.yml b/roles/google_spell_pspell/tasks/main.yml new file mode 100644 index 0000000..2fe09ee --- /dev/null +++ b/roles/google_spell_pspell/tasks/main.yml @@ -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